[FIX] product: better expose default_code on product.template

For companies not working with variants,
it is important to be able to search in the
Products menu (product.template)  using
product codes.
It is useful as well to see the codes
in the default kanban view too, even if
it is only the code of the first variant.
This commit is contained in:
Olivier Dony
2015-01-24 04:25:51 +01:00
parent 740bf28907
commit 25b1df2eb3
+4 -4
View File
@@ -10,7 +10,7 @@
<field name="model">product.template</field>
<field name="arch" type="xml">
<search string="Product">
<field name="name" string="Product"/>
<field name="name" string="Product" filter_domain="['|',('default_code','ilike',self),('name','ilike',self)]"/>
<filter string="Services" icon="terp-accessories-archiver" domain="[('type','=','service')]"/>
<filter string="Consumable" name="consumable" icon="terp-accessories-archiver" domain="[('type','=','consu')]" help="Consumable products"/>
<separator/>
@@ -150,9 +150,6 @@
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<field name="name" position="replace">
<field name="name" string="Product" filter_domain="['|',('default_code','ilike',self),('name','ilike',self)]"/>
</field>
<field name="product_variant_ids" position="replace">
<field name="attribute_value_ids"/>
</field>
@@ -284,6 +281,9 @@
<div class="oe_kanban_details">
<h4>
<a type="open">
<span t-if="record.default_code.value">
[<field name="default_code"/>]
</span>
<field name="name"/>
</a>
</h4>