diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py index 08ec874c996..9fa8f655e2a 100644 --- a/addons/stock/models/stock_inventory.py +++ b/addons/stock/models/stock_inventory.py @@ -127,6 +127,7 @@ class Inventory(models.Model): # as they will be moved to inventory loss, and other quants will be created to the encoded quant location. This is a normal behavior # as quants cannot be reuse from inventory location (users can still manually move the products before/after the inventory if they want). self.mapped('move_ids').filtered(lambda move: move.state != 'done')._action_done() + return True def action_check(self): """ Checks the inventory and computes the stock move to do """ diff --git a/addons/stock_account/models/stock_inventory.py b/addons/stock_account/models/stock_inventory.py index ce00ed251c5..03522076eae 100644 --- a/addons/stock_account/models/stock_inventory.py +++ b/addons/stock_account/models/stock_inventory.py @@ -35,10 +35,11 @@ class StockInventory(models.Model): return action_data def post_inventory(self): + res = True acc_inventories = self.filtered(lambda inventory: inventory.accounting_date) for inventory in acc_inventories: - super(StockInventory, inventory.with_context(force_period_date=inventory.accounting_date)).post_inventory() + res = super(StockInventory, inventory.with_context(force_period_date=inventory.accounting_date)).post_inventory() other_inventories = self - acc_inventories if other_inventories: - super(StockInventory, other_inventories).post_inventory() - + res = super(StockInventory, other_inventories).post_inventory() + return res