[FIX] product, web: many2one child of value

Before this commit, when a product category had a similar name than an other
e.g. ALL / Exp and ALL / Expenses

When entering the list view of its products, it displayed the product linked to the category with the similar name
e.g. When opening ALL/Exp products list, it displayed its products **plus** the products of ALL/Expenses

After this commit the list view just contains the active category's products

OPW 782905
This commit is contained in:
Lucas Perais (lpe)
2017-12-04 15:42:49 +01:00
parent 4aef443135
commit 067a241ea8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -102,7 +102,7 @@
<field name="arch" type="xml">
<search string="Product">
<field name="name" string="Product" filter_domain="['|','|',('default_code','ilike',self),('name','ilike',self),('barcode','ilike',self)]"/>
<field name="categ_id" filter_domain="[('categ_id', 'child_of', self)]"/>
<field name="categ_id" filter_domain="[('categ_id', 'child_of', raw_value)]"/>
<separator/>
<filter string="Services" name="services" domain="[('type','=','service')]"/>
<filter string="Products" name="consumable" domain="[('type', 'in', ['consu', 'product'])]" help="Products your store in the inventory"/>
@@ -152,7 +152,7 @@ var Field = Input.extend( /** @lends instance.web.search.Field# */ {
if (domain) {
value_to_domain = function (facetValue) {
return new data.CompoundDomain(domain)
.set_eval_context({self: self.value_from(facetValue)});
.set_eval_context({self: self.value_from(facetValue), raw_value: facetValue.attributes.value});
};
} else {
value_to_domain = function (facetValue) {