diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index ca86aab44dc..998916e5bae 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -171,6 +171,8 @@ class website(orm.Model): _columns = { 'pricelist_id': fields.related('user_id','partner_id','property_product_pricelist', type='many2one', relation='product.pricelist', string='Default pricelist'), + 'company_currency_id': fields.related('company_id','partner_id','property_product_pricelist','currency_id', + type='many2one', relation='res.currency', string='Default pricelist'), } def sale_product_domain(self, cr, uid, ids, context=None): @@ -265,7 +267,7 @@ class website(orm.Model): }) def compute_curency(self, cr, uid, ids, from_amount, from_currency_id=None, context=None): - from_currency_id = from_currency_id or self.browse(cr, uid, ids[0]).pricelist_id.currency_id.id + from_currency_id = from_currency_id or self.browse(cr, SUPERUSER_ID, ids[0]).company_currency_id.id to_currency_id = self.pool.get("res.users").browse(cr, uid, uid).partner_id.property_product_pricelist.currency_id.id return self.pool['res.currency'].compute(cr, uid, from_currency_id, to_currency_id, from_amount, context=context) diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index f40a16a8b79..4704908f100 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -76,7 +76,7 @@   @@ -435,7 +435,7 @@ t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "res_company.partner_id.property_product_pricelist.currency_id", + "from_currency": "website.company_currency_id", "display_currency": "user_id.partner_id.property_product_pricelist.currency_id" }'/>
@@ -486,7 +486,7 @@ t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "res_company.partner_id.property_product_pricelist.currency_id", + "from_currency": "website.company_currency_id", "display_currency": "user_id.partner_id.property_product_pricelist.currency_id" }'/>
@@ -574,7 +574,7 @@ t-field="product.lst_price" t-field-options='{ "widget": "monetary", - "from_currency": "res_company.partner_id.property_product_pricelist.currency_id", + "from_currency": "website.company_currency_id", "display_currency": "user_id.partner_id.property_product_pricelist.currency_id" }'/>
@@ -822,7 +822,7 @@   @@ -919,7 +919,7 @@