From b6eaf4964a3f19d4094b1eced283f2126e79969c Mon Sep 17 00:00:00 2001 From: "Louis (loti)" Date: Tue, 16 Jan 2024 09:41:17 +0100 Subject: [PATCH] [FIX] product: fix template tag creation in variant view Before this fix, the ORM tried to fetch the `product.template` using the `product.product`'s id when creating a new product tag. This was caused by the `context="{'product_template_id': id}"` attribute on the `product_tag_ids` field in `product_template_form_view` [1]. However, `product_normal_form_view` inherits `product_template_form_view` [2], so `context="{'product_template_id': id}"` ended up assigning a `product.product` id to `product_template_id`. The fix overrides the context attribute in `product_normal_form_view`. [1] https://github.com/odoo/odoo/blob/06c4d0363e56a640b2239a17ff32e6681ba78018/addons/product/views/product_views.xml#L85 [2] https://github.com/odoo/odoo/blob/06c4d0363e56a640b2239a17ff32e6681ba78018/addons/product/views/product_views.xml#L387 task-3619625 closes odoo/odoo#152739 X-original-commit: 44738fb2306bc18f6eee6412a62689f45bc5f009 Signed-off-by: Antoine Vandevenne (anv) --- addons/product/views/product_views.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml index e0a6c5e950b..3bef0de1fd0 100644 --- a/addons/product/views/product_views.xml +++ b/addons/product/views/product_views.xml @@ -425,6 +425,7 @@ {'no_open': True} + {'product_template_id': product_tmpl_id}