Skip to content

Commit 407ba06

Browse files
committed
[FIX] prodct_catalog_tree: left a minimal context when updating line
closes #842 X-original-commit: 7f8cd31 Signed-off-by: Camila Vives <cav@adhoc.inc>
1 parent 0a2cd36 commit 407ba06

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

product_catalog_tree/models/product_product.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,17 @@ def _inverse_catalog_values(self, product_catalog_qty):
5858

5959
order = self.env[res_model].browse(order_id)
6060
for rec in self:
61-
order.with_company(order.company_id)._update_order_line_info(rec.id, product_catalog_qty)
61+
# Actualizar la información de la línea de orden
62+
# Call the order method with a cleared context to avoid errors on creating move line
63+
minimal_context = {
64+
"lang": self._context.get("lang"),
65+
"tz": self._context.get("tz"),
66+
"uid": self._context.get("uid"),
67+
"allowed_company_ids": self._context.get("allowed_company_ids"),
68+
}
69+
order.with_company(order.company_id).with_env(self.env(context=minimal_context))._update_order_line_info(
70+
rec.id, product_catalog_qty
71+
)
6272

6373
def increase_quantity(self):
6474
for rec in self:

0 commit comments

Comments
 (0)