Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Products & Pricelists

Entity: product.template

Compute Method: _compute_cost_currency_id

View 17.0 View 19.0
Inputs Method Outputs
  • company_id
  • company_id.currency_id
  • company_id.currency_id.id
env_currency_id = self.env.company.currency_id.id
for template in self:
-             template.cost_currency_id = template.company_id.currency_id.id or env_currency_id
+             template.cost_currency_id = template.company_id.sudo().currency_id.id or env_currency_id
  • cost_currency_id

Back to entity