diff --git a/addons/stock/static/src/js/inventory_report_list_controller.js b/addons/stock/static/src/js/inventory_report_list_controller.js index e2a086002b8..6bbf661b2d4 100644 --- a/addons/stock/static/src/js/inventory_report_list_controller.js +++ b/addons/stock/static/src/js/inventory_report_list_controller.js @@ -31,7 +31,7 @@ var InventoryReportListController = ListController.extend({ // ------------------------------------------------------------------------- /** - * Handler called when the user clicked on the 'Inventory at Date' button. + * Handler called when the user clicked on the 'Valuation at Date' button. * Opens wizard to display, at choice, the products inventory or a computed * inventory at a given date. */ diff --git a/addons/stock/static/src/xml/inventory_report.xml b/addons/stock/static/src/xml/inventory_report.xml index 26a3d0c4adb..5b4484eeb1f 100644 --- a/addons/stock/static/src/xml/inventory_report.xml +++ b/addons/stock/static/src/xml/inventory_report.xml @@ -4,7 +4,9 @@ diff --git a/addons/stock_account/__manifest__.py b/addons/stock_account/__manifest__.py index 78c8a4a0e15..7f5849ce600 100644 --- a/addons/stock_account/__manifest__.py +++ b/addons/stock_account/__manifest__.py @@ -35,10 +35,16 @@ Dashboard / Reports for Warehouse Management includes: 'views/stock_quant_views.xml', 'wizard/stock_request_count.xml', 'wizard/stock_valuation_layer_revaluation_views.xml', + 'wizard/stock_quantity_history.xml', 'report/report_stock_forecasted.xml', ], 'installable': True, 'auto_install': True, 'post_init_hook': '_configure_journals', + 'assets': { + 'web.assets_qweb': [ + 'stock_account/static/src/xml/inventory_report.xml', + ], + }, 'license': 'LGPL-3', } diff --git a/addons/stock_account/models/stock_quant.py b/addons/stock_account/models/stock_quant.py index f569f7b0649..3736a69cf63 100644 --- a/addons/stock_account/models/stock_quant.py +++ b/addons/stock_account/models/stock_quant.py @@ -16,6 +16,7 @@ class StockQuant(models.Model): help="Date at which the accounting entries will be created" " in case of automated inventory valuation." " If empty, the inventory date will be used.") + cost_method = fields.Selection(related="product_categ_id.property_cost_method") @api.depends('company_id', 'location_id', 'owner_id', 'product_id', 'quantity') def _compute_value(self): diff --git a/addons/stock_account/models/stock_valuation_layer.py b/addons/stock_account/models/stock_valuation_layer.py index c2979edac78..3a1f11b25fe 100644 --- a/addons/stock_account/models/stock_valuation_layer.py +++ b/addons/stock_account/models/stock_valuation_layer.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import fields, models, tools +from odoo import api, fields, models, tools class StockValuationLayer(models.Model): @@ -29,6 +29,7 @@ class StockValuationLayer(models.Model): stock_valuation_layer_ids = fields.One2many('stock.valuation.layer', 'stock_valuation_layer_id') stock_move_id = fields.Many2one('stock.move', 'Stock Move', readonly=True, check_company=True, index=True) account_move_id = fields.Many2one('account.move', 'Journal Entry', readonly=True, check_company=True) + reference = fields.Char(related='stock_move_id.reference') def init(self): tools.create_index( @@ -55,3 +56,9 @@ class StockValuationLayer(models.Model): def _validate_analytic_accounting_entries(self): for svl in self: svl.stock_move_id._account_analytic_entry_move() + + @api.model + def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True): + if 'unit_cost' in fields: + fields.remove('unit_cost') + return super().read_group(domain, fields, groupby, offset, limit, orderby, lazy) diff --git a/addons/stock_account/static/src/xml/inventory_report.xml b/addons/stock_account/static/src/xml/inventory_report.xml new file mode 100644 index 00000000000..f1679721249 --- /dev/null +++ b/addons/stock_account/static/src/xml/inventory_report.xml @@ -0,0 +1,12 @@ + + + + + + + Valuation at Date + + + + + diff --git a/addons/stock_account/views/stock_quant_views.xml b/addons/stock_account/views/stock_quant_views.xml index 42da52b884e..795cdb4a741 100644 --- a/addons/stock_account/views/stock_quant_views.xml +++ b/addons/stock_account/views/stock_quant_views.xml @@ -19,8 +19,14 @@ + -