Skip to content

Commit

Permalink
[FIX] account: onchange of product and uom should not use currency ro…
Browse files Browse the repository at this point in the history
…unding

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#63817

X-original-commit: 1b4005f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
  • Loading branch information
wtaferner committed Dec 28, 2020
1 parent a47143e commit 1e6dce9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -3409,7 +3409,7 @@ def _onchange_product_id(self):

# 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):
Expand All @@ -3426,7 +3426,7 @@ def _onchange_uom_id(self):

# 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):
Expand Down

0 comments on commit 1e6dce9

Please sign in to comment.