[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

closes odoo/odoo#66260

X-original-commit: 415a65f6b6da4a8aca394e189d72b93244af745b
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Yuchen Huang <yhu-odoo@users.noreply.github.com>
This commit is contained in:
yhu-odoo
2021-02-16 12:19:12 +00:00
parent 6c4ceed356
commit 0e83fb5493
@@ -10,7 +10,7 @@ class StockQuantityHistory(models.TransientModel):
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