From 6afb4bb4e25cfb242ce16cd75a509b50a4b56e3f Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 2 Jun 2020 09:05:28 +0000 Subject: [PATCH] [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) --- addons/sale/models/res_partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/res_partner.py b/addons/sale/models/res_partner.py index c14e091d9ae..d77abad7559 100644 --- a/addons/sale/models/res_partner.py +++ b/addons/sale/models/res_partner.py @@ -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(