[FIX] account: reconciliation proposition div by 0
In some cases when computing reconciliation propositions against reconciliation models, there may be case where we try to divide by 0 This commit handles the case OPW 1946266 closes odoo/odoo#31534 Signed-off-by: "Lucas Perais (lpe)" <lpe@odoo.com>
This commit is contained in:
@@ -555,7 +555,7 @@ class AccountReconcileModel(models.Model):
|
||||
if line_residual > total_residual:
|
||||
amount_percentage = (total_residual / line_residual) * 100
|
||||
else:
|
||||
amount_percentage = (line_residual / total_residual) * 100
|
||||
amount_percentage = (line_residual / total_residual) * 100 if total_residual else 0
|
||||
return amount_percentage >= self.match_total_amount_param
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user