diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index e40525e3933..c8a1268cb52 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -62,6 +62,8 @@ class ProductTemplate(models.Model): currency_id = fields.Many2one( 'res.currency', 'Currency', compute='_compute_currency_id') + cost_currency_id = fields.Many2one( + 'res.currency', 'Cost Currency', compute='_compute_cost_currency_id') # price fields price = fields.Float( @@ -163,6 +165,10 @@ class ProductTemplate(models.Model): for template in self: template.currency_id = template.company_id.sudo().currency_id.id or main_company.currency_id.id + def _compute_cost_currency_id(self): + for template in self: + template.cost_currency_id = self.env.user.company_id.currency_id.id + @api.multi def _compute_template_price(self): prices = {} diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml index 7686d354722..2323224fcc9 100644 --- a/addons/product/views/product_views.xml +++ b/addons/product/views/product_views.xml @@ -51,13 +51,14 @@