diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index c8817b777ef..dcd197489fb 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -101,6 +101,7 @@ class ProductTemplate(models.Model): class ProductProduct(models.Model): _inherit = 'product.product' + stock_value_currency_id = fields.Many2one('res.currency', compute='_compute_stock_value_currency') stock_value = fields.Float( 'Value', compute='_compute_stock_value') qty_at_date = fields.Float( @@ -176,6 +177,12 @@ class ProductProduct(models.Model): moves = StockMove.search(domain) return sum(moves.mapped('remaining_value')), moves + @api.multi + def _compute_stock_value_currency(self): + currency_id = self.env.user.company_id.currency_id + for product in self: + product.stock_value_currency_id = currency_id + @api.multi @api.depends('stock_move_ids.product_qty', 'stock_move_ids.state', 'stock_move_ids.remaining_value', 'product_tmpl_id.cost_method', 'product_tmpl_id.standard_price', 'product_tmpl_id.property_valuation', 'product_tmpl_id.categ_id.property_valuation') def _compute_stock_value(self): diff --git a/addons/stock_account/views/stock_account_views.xml b/addons/stock_account/views/stock_account_views.xml index 7dde572369a..2d295145921 100644 --- a/addons/stock_account/views/stock_account_views.xml +++ b/addons/stock_account/views/stock_account_views.xml @@ -77,7 +77,8 @@ - + +