[FIX] sale: correct dependency for SO line currency

Ensure that the currency of a line always matches the currency of its
order; indeed, with the previous depends, changing the currency of an
order (through its pricelist) would not trigger the recompute of the SO
line's currency.

Was initially fixed in 2dfc0ea8c then reverted at 34e679598 for breaking
a test. I'd rather have the fix and adapt the test though, since this
breaks excpected relations.

Closes #48156

closes odoo/odoo#49491

X-original-commit: 36383d69802503606125f63d7641d4e733908b60
Related: odoo/enterprise#9844
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
Damien Bouvy
2020-04-14 08:58:48 +00:00
parent dafba22a6c
commit d007b6a6d6
+1 -1
View File
@@ -1323,7 +1323,7 @@ class SaleOrderLine(models.Model):
untaxed_amount_to_invoice = fields.Monetary("Untaxed Amount To Invoice", compute='_compute_untaxed_amount_to_invoice', compute_sudo=True, store=True)
salesman_id = fields.Many2one(related='order_id.user_id', store=True, string='Salesperson', readonly=True)
currency_id = fields.Many2one(related='order_id.currency_id', store=True, string='Currency', readonly=True)
currency_id = fields.Many2one(related='order_id.currency_id', depends=['order_id.currency_id'], store=True, string='Currency', readonly=True)
company_id = fields.Many2one(related='order_id.company_id', string='Company', store=True, readonly=True, index=True)
order_partner_id = fields.Many2one(related='order_id.partner_id', store=True, string='Customer', readonly=False)
analytic_tag_ids = fields.Many2many(