Skip to content

Commit

Permalink
[FIX] l10n_ar_ux: forced currency rate on invoice
Browse files Browse the repository at this point in the history
Ticket: 59842
Al forzar la moneda en factura no se toma esa cotización y al volver a la moneda anterior se actualizan incorrectamente los importes de las líneas.
  • Loading branch information
pablohmontenegro committed Mar 16, 2023
1 parent 81ce31b commit 0471177
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions account_ux/wizards/account_change_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def onchange_currency(self):
1.0, self.currency_to_id, self.move_id.company_id,
date=self.move_id.date or
fields.Date.context_today(self))
if self.move_id.company_currency_id == self.currency_to_id:
self.move_id.l10n_ar_currency_rate = 0

def change_currency(self):
self.ensure_one()
Expand All @@ -64,6 +66,7 @@ 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
for line in move.line_ids:
# do not round on currency digits, it is rounded automatically
# on price_unit precision
Expand Down

0 comments on commit 0471177

Please sign in to comment.