[FIX] account: onchange of product and uom should not use currency rounding

As the price_unit and the uom rounding can be more detailed than the currency/accounting rounding (2 decimals as a standard) to cut the number before subtotal is wrong.

closes odoo/odoo#63817

X-original-commit: 1b4005f50ac45b53a73e0b95cfb661e8ccf040cd
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Wolfgang Taferner
2020-12-28 10:21:46 +00:00
parent a47143ed6e
commit 1e6dce9d4e
+2 -2
View File
@@ -3409,7 +3409,7 @@ class AccountMoveLine(models.Model):
# Convert the unit price to the invoice's currency.
company = line.move_id.company_id
line.price_unit = company.currency_id._convert(line.price_unit, line.move_id.currency_id, company, line.move_id.date)
line.price_unit = company.currency_id._convert(line.price_unit, line.move_id.currency_id, company, line.move_id.date, round=False)
@api.onchange('product_uom_id')
def _onchange_uom_id(self):
@@ -3426,7 +3426,7 @@ class AccountMoveLine(models.Model):
# Convert the unit price to the invoice's currency.
company = self.move_id.company_id
self.price_unit = company.currency_id._convert(price_unit, self.move_id.currency_id, company, self.move_id.date)
self.price_unit = company.currency_id._convert(price_unit, self.move_id.currency_id, company, self.move_id.date, round=False)
@api.onchange('account_id')
def _onchange_account_id(self):