Skip to content
Snippets Groups Projects
Commit 7276e820 authored by Christophe Simonis's avatar Christophe Simonis
Browse files

[FIX] purchase: correct previous forward-port.

Domain was apply on the wrong model.
parent a337b9ec
Branches
Tags
No related merge requests found
......@@ -29,12 +29,12 @@ class res_partner(models.Model):
@api.multi
def _compute_supplier_invoice_count(self):
# retrieve all children partners and prefetch 'parent_id' on them
all_partners = self.search([('id', 'child_of', self.ids), ('type', 'in', ('in_invoice', 'in_refund')])
all_partners = self.search([('id', 'child_of', self.ids)])
all_partners.read(['parent_id'])
supplier_invoice_groups = self.env['account.invoice'].read_group(
domain=[('partner_id', 'in', all_partners.ids),
('type', '=', 'in_invoice')],
('type', 'in', ('in_invoice', 'in_refund'))],
fields=['partner_id'], groupby=['partner_id']
)
for group in supplier_invoice_groups:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment