Skip to content

Commit

Permalink
[FIX] product_import: use update() instead of write()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
florentx committed Feb 24, 2025
1 parent eab0720 commit 4c5bc5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion product_import/wizard/product_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 204 in product_import/wizard/product_import.py

View check run for this annotation

Codecov / codecov/patch

product_import/wizard/product_import.py#L203-L204

Added lines #L203 - L204 were not covered by tests
else:
product_active = product_vals.pop("active")
Expand Down

0 comments on commit 4c5bc5f

Please sign in to comment.