From 02f548ce9e1cfb5b96c847704ec4ee7eb115dbb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 2 Apr 2019 11:13:47 +0000 Subject: [PATCH] [FIX] stock_account: fix reference to undefined variable post_inventory method does not return anything (in stock), and True (in mrp). Anyway the returned result is not used anywhere and does not have any meaning. In stock_account call to super is done on some sub record sets and result of super is returned. However due to code architecture it is unsure whether super is actually called. Let us avoid any issue with res being undefined if there is no call to super done. --- addons/stock_account/models/stock.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/stock_account/models/stock.py b/addons/stock_account/models/stock.py index f7ccabb3089..f8d6655a21d 100644 --- a/addons/stock_account/models/stock.py +++ b/addons/stock_account/models/stock.py @@ -24,11 +24,10 @@ class StockInventory(models.Model): def post_inventory(self): acc_inventories = self.filtered(lambda inventory: inventory.accounting_date) for inventory in acc_inventories: - res = super(StockInventory, inventory.with_context(force_period_date=inventory.accounting_date)).post_inventory() + super(StockInventory, inventory.with_context(force_period_date=inventory.accounting_date)).post_inventory() other_inventories = self - acc_inventories if other_inventories: - res = super(StockInventory, other_inventories).post_inventory() - return res + super(StockInventory, other_inventories).post_inventory() class StockLocation(models.Model):