mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
FIX account_payment_disperse computation for non root introduced by last FIX
This commit is contained in:
@@ -60,11 +60,10 @@ class AccountRegisterPaymentsInvoiceLine(models.TransientModel):
|
||||
amount = fields.Float(string='Amount')
|
||||
writeoff_acc_id = fields.Many2one('account.account', string='Write-off Account')
|
||||
|
||||
@api.depends('invoice_id.residual', 'wizard_id.due_date_cutoff', 'invoice_id.partner_id')
|
||||
@api.depends('invoice_id', 'invoice_id.residual', 'wizard_id.due_date_cutoff', 'invoice_id.partner_id')
|
||||
def _compute_balances(self):
|
||||
sudo_self = self.sudo()
|
||||
for line in sudo_self:
|
||||
line.residual = line.invoice_id.residual
|
||||
for line in self:
|
||||
residual = line.invoice_id.residual
|
||||
|
||||
cutoff_date = line.wizard_id.due_date_cutoff
|
||||
total_amount = 0.0
|
||||
@@ -78,12 +77,13 @@ class AccountRegisterPaymentsInvoiceLine(models.TransientModel):
|
||||
total_amount += amount
|
||||
for partial_line in (move_line.matched_debit_ids + move_line.matched_credit_ids):
|
||||
total_reconciled += partial_line.amount
|
||||
|
||||
line.residual = residual
|
||||
line.residual_due = total_amount - total_reconciled
|
||||
line.difference = line.residual - line.amount
|
||||
line.difference = residual - (line.amount or 0.0)
|
||||
line.partner_id = line.invoice_id.partner_id
|
||||
|
||||
@api.onchange('amount')
|
||||
def _onchange_amount(self):
|
||||
sudo_self = self.sudo()
|
||||
for line in sudo_self:
|
||||
for line in self:
|
||||
line.difference = line.residual - line.amount
|
||||
|
||||
Reference in New Issue
Block a user