Skip to content
Snippets Groups Projects
Commit ec8699db authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] account: performance in issued total

When a partner has a lot of contacts, the computation of the issue total
takes a lot of time. Indeed, it performs the computation for the
partner, but also for all the children, despite the fact that the amount
is not displayed.

opw-726355
parent 577d9863
No related branches found
No related tags found
No related merge requests found
......@@ -349,12 +349,9 @@ class ResPartner(models.Model):
def _compute_issued_total(self):
""" Returns the issued total as will be displayed on partner view """
today = fields.Date.context_today(self)
for partner in self:
domain = partner.get_followup_lines_domain(today, overdue_only=True)
issued_total = 0
for aml in self.env['account.move.line'].search(domain):
issued_total += aml.amount_residual
partner.issued_total = issued_total
domain = self.get_followup_lines_domain(today, overdue_only=True)
for aml in self.env['account.move.line'].search(domain):
aml.partner_id.issued_total += aml.amount_residual
@api.one
def _compute_has_unreconciled_entries(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment