[FIX] account: don't write the foreign currency on writeoff when several secondary currencies are involved
This commit is contained in:
@@ -830,7 +830,14 @@ class AccountMoveLine(models.Model):
|
||||
|
||||
#if writeoff_acc_id specified, then create write-off move with value the remaining amount from move in self
|
||||
if writeoff_acc_id and writeoff_journal_id and remaining_moves:
|
||||
writeoff_to_reconcile = remaining_moves._create_writeoff({'account_id': writeoff_acc_id.id, 'journal_id': writeoff_journal_id.id})
|
||||
all_aml_share_same_currency = all([x.currency_id == self[0].currency_id for x in self])
|
||||
writeoff_vals = {
|
||||
'account_id': writeoff_acc_id.id,
|
||||
'journal_id': writeoff_journal_id.id
|
||||
}
|
||||
if not all_aml_share_same_currency:
|
||||
writeoff_vals['amount_currency'] = False
|
||||
writeoff_to_reconcile = remaining_moves._create_writeoff(writeoff_vals)
|
||||
#add writeoff line to reconcile algo and finish the reconciliation
|
||||
remaining_moves = (remaining_moves + writeoff_to_reconcile).auto_reconcile_lines()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user