[FIX] account: amount_residual_signed should be negative for refunds only

This commit is contained in:
Cedric Snauwaert
2015-11-25 11:02:32 +01:00
parent f5bd1cc922
commit d31b1ab2a7
+1 -1
View File
@@ -84,7 +84,7 @@ class AccountInvoice(models.Model):
def _compute_residual(self):
residual = 0.0
residual_company_signed = 0.0
sign = self.type in ['in_refund', 'in_invoice'] and -1 or 1
sign = self.type in ['in_refund', 'out_refund'] and -1 or 1
for line in self.sudo().move_id.line_ids:
if line.account_id.internal_type in ('receivable', 'payable'):
residual_company_signed += line.amount_residual * sign