[FIX] account: compute methods do not always assign value

This commit is contained in:
Raphael Collet
2020-08-20 14:23:15 +00:00
parent a0d075955c
commit 4e7161a12c
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -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()
+2 -1
View File
@@ -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]