mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] account_mass_reconcile: Fix writeoff variables passed to reconcile method
This commit is contained in:
@@ -155,13 +155,13 @@ class MassReconcileBase(models.AbstractModel):
|
||||
)
|
||||
if below_writeoff:
|
||||
if sum_credit > sum_debit:
|
||||
writeoff_account_id = self.account_profit_id.id
|
||||
writeoff_account = self.account_profit_id
|
||||
else:
|
||||
writeoff_account_id = self.account_lost_id.id
|
||||
writeoff_account = self.account_lost_id
|
||||
line_rs = ml_obj.browse(line_ids)
|
||||
line_rs.reconcile(
|
||||
writeoff_acc_id=writeoff_account_id,
|
||||
writeoff_journal_id=self.journal_id.id
|
||||
writeoff_acc_id=writeoff_account,
|
||||
writeoff_journal_id=self.journal_id
|
||||
)
|
||||
return True, True
|
||||
elif allow_partial:
|
||||
@@ -173,13 +173,13 @@ class MassReconcileBase(models.AbstractModel):
|
||||
# it will do a full reconcile instead of a partial reconcile
|
||||
# and make a write-off for exchange
|
||||
if sum_credit > sum_debit:
|
||||
writeoff_account_id = self.income_exchange_account_id.id
|
||||
writeoff_account = self.income_exchange_account_id
|
||||
else:
|
||||
writeoff_account_id = self.expense_exchange_account_id.id
|
||||
writeoff_account = self.expense_exchange_account_id
|
||||
line_rs = ml_obj.browse(line_ids)
|
||||
line_rs.reconcile(
|
||||
writeoff_acc_id=writeoff_account_id,
|
||||
writeoff_journal_id=self.journal_id.id
|
||||
writeoff_acc_id=writeoff_account,
|
||||
writeoff_journal_id=self.journal_id
|
||||
)
|
||||
return True, False
|
||||
return False, False
|
||||
|
||||
Reference in New Issue
Block a user