Search code examples
webpython-3.7currencyodoo-12odoo-13

Odoo 13.0 website_sale: convert price from company currency to public pricelist


In Odoo 12 we had a function to get current website pricelist and company currency id, and then convert product price from company currency id to website currency id.

This function: _get_compute_currency()

But in Odoo 13, Odoo team removed it.

I am asking, if we use website sale in multi-currencies and my company currency is neither USD nor EUR, what option for me to convert product from my company currency to pricelist?


Solution

  • in function _get_combination_info() has a block to do this job

            if pricelist and pricelist.currency_id != product_template.currency_id:
                list_price = product_template.currency_id._convert(
                    list_price, pricelist.currency_id, product_template._get_current_company(pricelist=pricelist),
                    fields.Date.today()
                )