[FIX] account: compute methods do not always assign value
This commit is contained in:
@@ -420,7 +420,12 @@ class AccountPayment(models.Model):
|
||||
''' Retrieve the invoices reconciled to the payments through the reconciliation (account.partial.reconcile). '''
|
||||
stored_payments = self.filtered('id')
|
||||
if not stored_payments:
|
||||
self.reconciled_invoice_ids = False
|
||||
self.reconciled_invoices_count = 0
|
||||
self.reconciled_statement_ids = False
|
||||
self.reconciled_statements_count = 0
|
||||
return
|
||||
|
||||
self.env['account.move'].flush()
|
||||
self.env['account.move.line'].flush()
|
||||
self.env['account.partial.reconcile'].flush()
|
||||
|
||||
@@ -302,12 +302,13 @@ class ResPartner(models.Model):
|
||||
return self._asset_difference_search('payable', operator, operand)
|
||||
|
||||
def _invoice_total(self):
|
||||
self.total_invoiced = 0
|
||||
if not self.ids:
|
||||
return True
|
||||
|
||||
all_partners_and_children = {}
|
||||
all_partner_ids = []
|
||||
for partner in self:
|
||||
for partner in self.filtered('id'):
|
||||
# price_total is in the company currency
|
||||
all_partners_and_children[partner] = self.with_context(active_test=False).search([('id', 'child_of', partner.id)]).ids
|
||||
all_partner_ids += all_partners_and_children[partner]
|
||||
|
||||
Reference in New Issue
Block a user