[FIX] account_mass_reconcile: Fix writeoff variables passed to reconcile method

This commit is contained in:
Florian da Costa
2016-09-22 18:39:51 +02:00
parent dd30635c67
commit 9938647c60

View File

@@ -155,13 +155,13 @@ class MassReconcileBase(models.AbstractModel):
) )
if below_writeoff: if below_writeoff:
if sum_credit > sum_debit: if sum_credit > sum_debit:
writeoff_account_id = self.account_profit_id.id writeoff_account = self.account_profit_id
else: else:
writeoff_account_id = self.account_lost_id.id writeoff_account = self.account_lost_id
line_rs = ml_obj.browse(line_ids) line_rs = ml_obj.browse(line_ids)
line_rs.reconcile( line_rs.reconcile(
writeoff_acc_id=writeoff_account_id, writeoff_acc_id=writeoff_account,
writeoff_journal_id=self.journal_id.id writeoff_journal_id=self.journal_id
) )
return True, True return True, True
elif allow_partial: elif allow_partial:
@@ -173,13 +173,13 @@ class MassReconcileBase(models.AbstractModel):
# it will do a full reconcile instead of a partial reconcile # it will do a full reconcile instead of a partial reconcile
# and make a write-off for exchange # and make a write-off for exchange
if sum_credit > sum_debit: if sum_credit > sum_debit:
writeoff_account_id = self.income_exchange_account_id.id writeoff_account = self.income_exchange_account_id
else: 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 = ml_obj.browse(line_ids)
line_rs.reconcile( line_rs.reconcile(
writeoff_acc_id=writeoff_account_id, writeoff_acc_id=writeoff_account,
writeoff_journal_id=self.journal_id.id writeoff_journal_id=self.journal_id
) )
return True, False return True, False
return False, False return False, False