Skip to content

Commit

Permalink
[FIX] Fix currency amount in write_off_line_vals
Browse files Browse the repository at this point in the history
closes #625

Related: ingadhoc/odoo-argentina#1043
Signed-off-by: rov-adhoc <[email protected]>
  • Loading branch information
maq-adhoc committed Feb 11, 2025
1 parent 1227769 commit bc57d48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions account_payment_pro/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,13 @@ def _prepare_move_line_default_vals(self, write_off_line_vals=None, force_balanc
return super()._prepare_move_line_default_vals(write_off_line_vals=write_off_line_vals, force_balance=force_balance)
write_off_line_vals = []
if self.write_off_amount:
conversion_rate = self.exchange_rate or 1.0
if self.payment_type == 'inbound':
# Receive money.
write_off_amount_currency = self.write_off_amount
write_off_amount_currency = self.write_off_amount / conversion_rate
else:
# Send money.
write_off_amount_currency = -self.write_off_amount
write_off_amount_currency = -self.write_off_amount / conversion_rate

write_off_line_vals.append({
'name': self.write_off_type_id.label or self.write_off_type_id.name,
Expand Down

0 comments on commit bc57d48

Please sign in to comment.