[FIX] sale: smart button "Sales"
Steps to reproduce the bug: - Let's consider a customer company partner P - Let's consider, P1, a child partner of P - Create a SO for P1 - Archive P1 Bug: The SO count in the smart button Sales of P was 0 instead of 1 opw:2267828 closes odoo/odoo#52340 X-original-commit: 31ded31dab5c389e6cb1b85f65e780a1e5ab5b28 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
@@ -15,7 +15,7 @@ class ResPartner(models.Model):
|
||||
|
||||
def _compute_sale_order_count(self):
|
||||
# retrieve all children partners and prefetch 'parent_id' on them
|
||||
all_partners = self.search([('id', 'child_of', self.ids)])
|
||||
all_partners = self.with_context(active_test=False).search([('id', 'child_of', self.ids)])
|
||||
all_partners.read(['parent_id'])
|
||||
|
||||
sale_order_groups = self.env['sale.order'].read_group(
|
||||
|
||||
Reference in New Issue
Block a user