From 5f7602f4e1facf3a21da7f51775eb07052b9290e Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 17 May 2022 12:30:25 +0000 Subject: [PATCH] [FIX] account: make action consistent with smart button value Total invoiced is computed with `active_test=False` [1], however the corresponding action didn't have that context. Since Odoo 14 `child_of` domain filters out unaccessible records (including archived ones) [2]. Fix it by adding the context to the action. STEPS: 1. Have a active contact that has an amount invoiced (invoices pointing to this contact name). 2. Click through on the amount invoiced button, and receive a list of relevant invoices. 3. Now go back to the contact, and archive the contact. 4. The smart button containing the amount invoiced stays the same. 5. Click through on the smart button again BEFORE: no invoices AFTER : listed invoices corresponds to the computed total value [1]: https://github.com/odoo/odoo/blob/574ca75ab6fa583aabc0c1cfc65206e72864e546/addons/account/models/partner.py#L379 [2]: https://github.com/odoo/odoo/commit/3e1b960acf3f6a726338476ba9e62e5ef5c84ef9 opw-2853525 closes odoo/odoo#91828 X-original-commit: bf96188abbf8ad19d1a2f8f82a1e6248245778b5 Signed-off-by: Josse Colpaert Signed-off-by: Ivan Elizaryev (iel) --- addons/account/models/partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index a64432eb063..01603df21d2 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -568,7 +568,7 @@ class ResPartner(models.Model): ('move_type', 'in', ('out_invoice', 'out_refund')), ('partner_id', 'child_of', self.id), ] - action['context'] = {'default_move_type':'out_invoice', 'move_type':'out_invoice', 'journal_type': 'sale', 'search_default_open': 1} + action['context'] = {'default_move_type':'out_invoice', 'move_type':'out_invoice', 'journal_type': 'sale', 'search_default_open': 1, 'active_test': False} return action def action_view_partner_with_same_bank(self):