I have overriden the product.packagings table to move from product.template to product.product where it should be (check \Github issue #8237).
Now I want to display packaging info on the website for each variant (aka product.product).
I insert a very crude qweb to test:
<table>
<tbody>
<t t-foreach="product.product_variant_ids[0].packaging_ids" t-as="packaging_id">
<tr>
<td><span t-field="packaging_id.ean"/></td>
<td><span t-field="packaging_id.qty"/></td>
</tr>
</t>
</tbody>
</table>
It works but (as expected) fetches values for the first variant found. I want the table to change according to the variant selected from the combination of variant values.
The problem here is that I didn't find the selected variant_id as it is built dynamically in javascript (by evaluating attribute value selections).
Is there a way to get the variant_id (product_id in website_sale.js) exposed as a variable in qweb so that I can use:
<t t-foreach="variant_id.packaging_ids" t-as="packaging_id">
How can I auto-update the table when the variant changes?
Using Odoo Community V8 on OpenSuse 42.2
I know this has been a long time, but I’m trying to do something similar and have asked the question but no one has answered. Were you ever able to solve this? If so could you share your solution with me?
Your help is greatly appreciated.