Skip to content

Commit c776724

Browse files
committed
[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: f12fe06
1 parent cd87c83 commit c776724

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

product_catalog_tree/models/product_product.py

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

5959
order = self.env[res_model].browse(order_id)
6060
for rec in self:
61+
<<<<<<< cd87c83ef0e032eb6f2fdb8bbd932997c93247a7
6162
order.with_company(order.company_id)._update_order_line_info(rec.id, product_catalog_qty)
63+
||||||| cddeac9272cc97cec41cdedfab8bfffd8b73841f
64+
# Actualizar la información de la línea de orden
65+
order.with_company(order.company_id)._update_order_line_info(rec.id, product_catalog_qty)
66+
=======
67+
# Actualizar la información de la línea de orden
68+
# Call the order method with a cleared context to avoid errors on creating move line
69+
order.with_company(order.company_id).with_context(clear_context=True)._update_order_line_info(
70+
rec.id, product_catalog_qty
71+
)
72+
>>>>>>> 351eb26d109ac236f653f163a50710e31705355a
6273

6374
def increase_quantity(self):
6475
for rec in self:

0 commit comments

Comments
 (0)