[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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user