From 31d19afdc89030973d17de7bd5ef5a15bc3d04eb Mon Sep 17 00:00:00 2001 From: "Maruan Aguerdouh (magm)" Date: Tue, 25 Oct 2022 08:39:44 +0000 Subject: [PATCH] [FIX] sale_project: clicking on materials button projects updates working Steps to rerpoduce: - Create a sales order with a subscription that has also materials, we need that the service product creates a project when a quotation is made - Inside this project, we go to Project Updates, click on Materials. Issue: Materials is throwing an error, so we cannot check the materials in the project. Solution: After the project changes to OWL we need to change the way we pass the parameters to the 'action_profitability_items', so it matches the new changes. opw-3024598 closes odoo/odoo#104069 X-original-commit: 67731daf264fb17dbde1d360ba5e285cd193b446 Signed-off-by: Xavier --- addons/sale_project/models/project.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/sale_project/models/project.py b/addons/sale_project/models/project.py index 15e1466d49d..3b9a0fe4091 100644 --- a/addons/sale_project/models/project.py +++ b/addons/sale_project/models/project.py @@ -385,14 +385,14 @@ class Project(models.Model): ._filter_access_rules_python('read') if sale_order_items: if sale_order_items: + args = [section_name, [('id', 'in', sale_order_items.ids)]] + if len(sale_order_items) == 1: + args.append(sale_order_items.id) action_params = { 'name': 'action_profitability_items', 'type': 'object', - 'section': section_name, - 'domain': json.dumps([('id', 'in', sale_order_items.ids)]), + 'args': json.dumps(args), } - if len(sale_order_items) == 1: - action_params['res_id'] = sale_order_items.id other_revenues['action'] = action_params sequence_per_invoice_type = self._get_profitability_sequence_per_invoice_type() return {