[FIX] account_reconcile_model_oca: Fix unassigned variable 'balance'
It seems some people are getting an "unassigned variable 'balance'".
This shouldn't happen with the standard code because _get_write_off_move_lines_dict is only
called from the manual reconciliation widget in which, you only have access to models having
strictly lines being percentage or fixed (see get_reconcile_modelds_for_manual_reconciliation).
This method is not called from the bank reco widget pointed by "RECONCILE x ITEMS" on the accounting dashboard.
It probably comes from some customization but I don't know which ones.
Related to 99525f8dac
pull/819/head
parent
c533e46623
commit
0510276a36
|
@ -131,6 +131,8 @@ class AccountReconcileModel(models.Model):
|
|||
balance = currency.round(
|
||||
line.amount * (1 if residual_balance > 0.0 else -1)
|
||||
)
|
||||
else:
|
||||
balance = 0.0
|
||||
|
||||
if currency.is_zero(balance):
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue