From c395a8b9e6abe0306b0ce1acf169f9e4cee6e8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Mon, 10 May 2021 08:29:07 +0200 Subject: [PATCH] [FIX] stock_quantity_history_location: Add literal_eval to prevent errors according to stock_account_quantity_history_location --- stock_quantity_history_location/__manifest__.py | 2 +- .../wizards/stock_quantity_history.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/stock_quantity_history_location/__manifest__.py b/stock_quantity_history_location/__manifest__.py index 4230f79..c8be6d3 100644 --- a/stock_quantity_history_location/__manifest__.py +++ b/stock_quantity_history_location/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Stock Quantity History Location", "summary": "Provides stock quantity by location on past date", - "version": "13.0.1.1.0", + "version": "13.0.1.1.1", "license": "AGPL-3", "author": "ForgeFlow," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/stock-logistics-reporting", diff --git a/stock_quantity_history_location/wizards/stock_quantity_history.py b/stock_quantity_history_location/wizards/stock_quantity_history.py index 623a910..b08741d 100644 --- a/stock_quantity_history_location/wizards/stock_quantity_history.py +++ b/stock_quantity_history_location/wizards/stock_quantity_history.py @@ -2,6 +2,7 @@ # Copyright 2019 Aleph Objects, Inc. # Copyright 2021 Tecnativa - Víctor Martínez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import ast from odoo import fields, models @@ -17,6 +18,8 @@ class StockQuantityHistory(models.TransientModel): def open_at_date(self): action = super(StockQuantityHistory, self).open_at_date() ctx = action["context"] + if isinstance(ctx, str): + ctx = ast.literal_eval(ctx) if self.location_id: ctx["location"] = self.location_id.id ctx["compute_child"] = self.include_child_locations