Skip to content

Commit

Permalink
[FIX] account_ux: change currency when round change taxes
Browse files Browse the repository at this point in the history
Esto resuelve un error poco comun cuando un cambio de moneda hace que un imuesto deje de existir. Pasa por ej en chile donde no hay decimales.
Entonces si se convierten importes "bajos" la línea de impuesto deja de existir pero no se recomputaba.
Con esto quedaria resuelto.

closes #456

Related: ingadhoc/multi-company#130
Signed-off-by: Juan José Scarafía <[email protected]>
  • Loading branch information
jjscarafia committed Oct 19, 2023
1 parent 7bab116 commit 2f2407a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions account_ux/wizards/account_change_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ def change_currency(self):
self.currency_rate)

move = self.move_id.with_context(check_move_validity=False)
move.currency_id = self.currency_to_id.id
move._onchange_currency()
for line in move.line_ids:
# do not round on currency digits, it is rounded automatically
# on price_unit precision
line.price_unit = line.price_unit * self.currency_rate
move.currency_id = self.currency_to_id.id
move._onchange_currency()

# This is required to compute to recompute the tax lines again
if self.currency_rate != 1:
Expand Down

0 comments on commit 2f2407a

Please sign in to comment.