From 9962e2c5ea0c86728b1f6b4f8b4a61b49011d461 Mon Sep 17 00:00:00 2001 From: Camila Vives Date: Tue, 16 Dec 2025 15:29:21 +0000 Subject: [PATCH] [FIX] product_catalog_tree: clear context when updating order line info When using catalog tree from invoices a context with UI keys is passed and that produces errors when creating account move lines. This commit clears the context when calling the order method to avoid such issues. X-original-commit: f12fe068e09077589667cf4869864a846f50967d --- product_catalog_tree/models/product_product.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/product_catalog_tree/models/product_product.py b/product_catalog_tree/models/product_product.py index 26bd65d3..124bcae5 100644 --- a/product_catalog_tree/models/product_product.py +++ b/product_catalog_tree/models/product_product.py @@ -58,7 +58,11 @@ def _inverse_catalog_values(self, product_catalog_qty): order = self.env[res_model].browse(order_id) for rec in self: - order.with_company(order.company_id)._update_order_line_info(rec.id, product_catalog_qty) + # Actualizar la información de la línea de orden + # Call the order method with a cleared context to avoid errors on creating move line + order.with_company(order.company_id).with_context(clear_context=True)._update_order_line_info( + rec.id, product_catalog_qty + ) def increase_quantity(self): for rec in self: