Hi,
I am trying to add a custom attribute to the product card. The problems seems to be the template relation.
<t t-extend="Product">
<t t-jquery=".product-name" t-operation="replace">
<div class="product-name">
<t t-esc="product.display_name"/> -
<t t-if="product.product_tmpl_id">
-- <t t-esc="product.product_tmpl_id.x_season"/>
</t>
</div>
</t>
</t>
I also tried using
<t t-extend="Product">
<t t-jquery=".product-name" t-operation="replace">
<div class="product-name">
<t t-esc="product.display_name"/> -
<t t-if="product.product_tmpl_id">
-- <t t-esc="product.season"/>
</t>
</div>
</t>
</t>
and extending this way.
_inherit = 'product.product'
season = fields.Char(compute='_season')
@api.depends('product_tmpl_id')
def _season(self):
for record in self:
record.season = record.product_tmpl_id.x_season
any help would be greatly appreciated