From 612f6917771074e9ee3e101148317548f038f6cb Mon Sep 17 00:00:00 2001 From: yhu-odoo Date: Mon, 8 Feb 2021 13:50:08 +0000 Subject: [PATCH] [FIX]stock_account: don't show consumable in valuation report In "Inventory Valuation", when click "Inventory at Date" then "confirm". Record for consumable products will be shown in the report. Previously fix in #62622 which disabled svl for consumable products, then rolled back in #63386 due to mrp need to create svl for consumables to analyse cost. In this commit, we add a domian filter to not show consumables in "Inventory Valuation" Task 2449211 PR #65726 X-original-commit: 415a65f6b6da4a8aca394e189d72b93244af745b --- addons/stock_account/wizard/stock_quantity_history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/wizard/stock_quantity_history.py b/addons/stock_account/wizard/stock_quantity_history.py index 8897a32962891..aaddf96734cab 100644 --- a/addons/stock_account/wizard/stock_quantity_history.py +++ b/addons/stock_account/wizard/stock_quantity_history.py @@ -10,7 +10,7 @@ def open_at_date(self): active_model = self.env.context.get('active_model') if active_model == 'stock.valuation.layer': action = self.env["ir.actions.actions"]._for_xml_id("stock_account.stock_valuation_layer_action") - action['domain'] = [('create_date', '<=', self.inventory_datetime)] + action['domain'] = [('create_date', '<=', self.inventory_datetime), ('product_id.type', '=', 'product')] action['display_name'] = str(self.inventory_datetime) return action