From 8e42920ced89a91a467d1d92474edceb70b3a99b Mon Sep 17 00:00:00 2001 From: har0ke Date: Wed, 21 Aug 2019 00:56:09 +0200 Subject: [PATCH] Bug: not all inventories were marked for recalculation if date was not changed --- main/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/models.py b/main/models.py index ebb666e..c7323fc 100644 --- a/main/models.py +++ b/main/models.py @@ -144,8 +144,8 @@ class Inventory(InvoiceDependencies, models.Model, FieldTrackerMixin): may_have_changed = models.BooleanField(default=True) def get_related_invoices(self): - next_inventory = Inventory.get_next_inventory_by_date(self.date, True) - return (([Inventory.get_next_inventory_by_date(self.date_original, True)] if self.date_changed else []) + + next_inventory = Inventory.get_next_inventory_by_date(self.date, False) + return (([Inventory.get_next_inventory_by_date(self.date_original, False)] if self.date_changed else []) + [self, next_inventory]) @staticmethod