From 75069b4edc8a7671cda2af71b19ea38412a732b5 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Thu, 19 Mar 2020 09:49:38 +0000 Subject: [PATCH] [IMP] sale: store the curency of sales order It is already stored on the sales order lines, which is incoherent and potentially error-prone... --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 631a64d5009..7d877ab8279 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -187,7 +187,7 @@ class SaleOrder(models.Model): required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", tracking=1, help="If you change the pricelist, only newly added lines will be affected.") - currency_id = fields.Many2one("res.currency", related='pricelist_id.currency_id', string="Currency", readonly=True, required=True) + currency_id = fields.Many2one(related='pricelist_id.currency_id', depends=["pricelist_id"], store=True) analytic_account_id = fields.Many2one( 'account.analytic.account', 'Analytic Account', readonly=True, copy=False, check_company=True, # Unrequired company