[FIX] account: avoid invoices paid automatically in some strange use cases.
Invoices were marked as paid as soon as validated, if the income/expenses accounts was reconciliable (for some reason?) - task https://www.odoo.com/web#id=32324&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720 - PR #16311
This commit is contained in:
@@ -95,7 +95,7 @@ class AccountInvoice(models.Model):
|
||||
residual_company_signed = 0.0
|
||||
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'):
|
||||
if line.account_id == self.account_id:
|
||||
residual_company_signed += line.amount_residual
|
||||
if line.currency_id == self.currency_id:
|
||||
residual += line.amount_residual_currency if line.currency_id else line.amount_residual
|
||||
|
||||
Reference in New Issue
Block a user