From 95f3e0aed7f50f7f219c042072b9b3eda0f30a2c Mon Sep 17 00:00:00 2001 From: hveficent Date: Tue, 16 Jul 2019 12:43:00 +0200 Subject: [PATCH] [MIG] stock_account_quantity_history_location: Migration to 12.0 --- .../__init__.py | 1 + .../__manifest__.py | 2 +- .../wizards/__init__.py | 2 ++ .../wizards/stock_quantity_history.py | 19 +++++++++++++++++++ .../wizards/stock_quantity_history.xml | 2 +- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 stock_account_quantity_history_location/wizards/__init__.py create mode 100644 stock_account_quantity_history_location/wizards/stock_quantity_history.py diff --git a/stock_account_quantity_history_location/__init__.py b/stock_account_quantity_history_location/__init__.py index e69de29..326c3db 100644 --- a/stock_account_quantity_history_location/__init__.py +++ b/stock_account_quantity_history_location/__init__.py @@ -0,0 +1 @@ +from . import wizards \ No newline at end of file diff --git a/stock_account_quantity_history_location/__manifest__.py b/stock_account_quantity_history_location/__manifest__.py index b196f0e..35b6f91 100644 --- a/stock_account_quantity_history_location/__manifest__.py +++ b/stock_account_quantity_history_location/__manifest__.py @@ -7,7 +7,7 @@ 'summary': """ Glue module between Stock Account and Stock Quantity History Location modules""", - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'author': 'Eficent,' 'Odoo Community Association (OCA)', diff --git a/stock_account_quantity_history_location/wizards/__init__.py b/stock_account_quantity_history_location/wizards/__init__.py new file mode 100644 index 0000000..500ceb8 --- /dev/null +++ b/stock_account_quantity_history_location/wizards/__init__.py @@ -0,0 +1,2 @@ +from . import stock_quantity_history + diff --git a/stock_account_quantity_history_location/wizards/stock_quantity_history.py b/stock_account_quantity_history_location/wizards/stock_quantity_history.py new file mode 100644 index 0000000..aa1ac6f --- /dev/null +++ b/stock_account_quantity_history_location/wizards/stock_quantity_history.py @@ -0,0 +1,19 @@ +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. +# Copyright 2019 Aleph Objects, Inc. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import ast +from odoo import models + + +class StockQuantityHistory(models.TransientModel): + _inherit = 'stock.quantity.history' + + def open_table(self): + action = super(StockQuantityHistory, self).open_table() + # Show 0 quantities on Inventory Valuation to display Account Valuation + # anomalies, such as, non 0 stock_value on cost_method FIFO + if self.env.context.get('valuation') and not self.location_id: + domain = ast.literal_eval(action['domain']) + domain.pop(domain.index(('qty_available', '!=', 0))) + action['domain'] = domain + return action diff --git a/stock_account_quantity_history_location/wizards/stock_quantity_history.xml b/stock_account_quantity_history_location/wizards/stock_quantity_history.xml index fc09cdf..4ce6489 100644 --- a/stock_account_quantity_history_location/wizards/stock_quantity_history.xml +++ b/stock_account_quantity_history_location/wizards/stock_quantity_history.xml @@ -9,7 +9,7 @@ -