From 1736bd74ff3edab33c8e8fe77d93a2f9fe5d72d2 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Fri, 6 Sep 2019 15:02:32 +0000 Subject: [PATCH] [FIX] stock_account, mrp_account: linked valuation layers disable the inventory at date from these views closes odoo/odoo#36524 Signed-off-by: Simon Lejeune (sle) --- addons/mrp_account/models/mrp_production.py | 7 ++++++- addons/stock_account/models/stock_picking.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/mrp_account/models/mrp_production.py b/addons/mrp_account/models/mrp_production.py index d89c916c1fa..5e97dbff4dd 100644 --- a/addons/mrp_account/models/mrp_production.py +++ b/addons/mrp_account/models/mrp_production.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +from ast import literal_eval + from odoo import api, fields, models from odoo.tools import float_is_zero @@ -72,5 +74,8 @@ class MrpProduction(models.Model): self.ensure_one() domain = [('id', 'in', (self.move_raw_ids + self.move_finished_ids + self.scrap_ids.move_id).stock_valuation_layer_ids.ids)] action = self.env.ref('stock_account.stock_valuation_layer_action').read()[0] - return dict(action, domain=domain) + context = literal_eval(action['context']) + context.update(self.env.context) + context['no_at_date'] = True + return dict(action, domain=domain, context=context) diff --git a/addons/stock_account/models/stock_picking.py b/addons/stock_account/models/stock_picking.py index a1646e484fb..4169320109a 100644 --- a/addons/stock_account/models/stock_picking.py +++ b/addons/stock_account/models/stock_picking.py @@ -16,6 +16,6 @@ class StockPicking(models.Model): action = self.env.ref('stock_account.stock_valuation_layer_action').read()[0] context = literal_eval(action['context']) context.update(self.env.context) - context['not_at_date'] = True + context['no_at_date'] = True return dict(action, domain=domain, context=context)