From 4c5bc5f83d6dbb0e04ba27a11a85c3e5f6c65089 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Mon, 24 Feb 2025 12:57:17 +0100 Subject: [PATCH] [FIX] product_import: use update() instead of write() It is needed in order to have a safe recomputation of fields of other models. There was an issue in a third-party add-on which has a field recomputed when a new is added to of the product. --- product_import/wizard/product_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_import/wizard/product_import.py b/product_import/wizard/product_import.py index 82fae5661a..9cf6eae1b1 100644 --- a/product_import/wizard/product_import.py +++ b/product_import/wizard/product_import.py @@ -200,7 +200,7 @@ def _save_product(self, product_vals, chatter_msg): """Create / Update a product.""" product = product_vals.pop("recordset", None) if product: - product.write(product_vals) + product.update(product_vals) logger.debug("Product %s updated", product.default_code) else: product_active = product_vals.pop("active")