context = {}
if context.get('search_default_categ_id'):
args.append((('categ_id', 'child_of', context['search_default_categ_id'])))
- if context.get('search_variants'):
- args.append(('variants', '!=', ''))
return super(product_product, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count)
</div>
<h1>
<field name="name" class="oe_inline"/>
- <field name="product_tmpl_id" groups="product.group_product_variant" on_change="onchange_product_tmpl_id(product_tmpl_id,lst_price,price_margin,price_extra)" class="oe_inline" context="{'search_variants':1}"/>
+ <field name="product_tmpl_id" groups="product.group_product_variant" on_change="onchange_product_tmpl_id(product_tmpl_id,lst_price,price_margin,price_extra)" class="oe_inline"/>
<span attrs="{'invisible':[('variants','=',False)]}" groups="product.group_product_variant"> - </span>
<field name="variants" placeholder="Variant Name" groups="product.group_product_variant" class="oe_inline" readonly="0"/>
</h1>
<field name="arch" type="xml">
<form string="Product Variant" version="7.0">
<group col="4">
- <field name="product_tmpl_id" context="{'search_variants': 1}"/>
+ <field name="product_tmpl_id"/>
<field name="active"/>
<field name="variants" required="1"/>
<field name="default_code"/>
<field name="res_model">product.template</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_type">form</field>
- <field name="context">{'search_variants': 1}</field>
<field name="view_id" ref="product_template_kanban_view"/>
</record>
</label>
</t>
<div class="product_price mt16" t-if="product.product_variant_ids">
- <t t-if="len(product.product_variant_ids) < 2 and product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
- <span class="text-danger" style="text-decoration: line-through;"
- t-field="product.product_variant_ids[0].lst_price"
- t-field-options='{
- "widget": "monetary",
- "display_currency": "website.pricelist_id.currency_id"
- }'/><br/>
- </t>
<h4>
+ <t t-if="len(product.product_variant_ids) < 2 and product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
+ <span class="text-danger" style="text-decoration: line-through;"
+ t-field="product.product_variant_ids[0].lst_price"
+ t-field-options='{
+ "widget": "monetary",
+ "display_currency": "website.pricelist_id.currency_id"
+ }'/><br/>
+ </t>
<b class="oe_price"
t-field="product.product_variant_ids[0].price"
t-field-options='{