[FIX] account: amount_residual_signed should be negative for refunds only
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user