[FIX] product: import product.template fields using default_code
This rev. is related to 489a96c257
It wasn't possible anymore to perform an import of
a product.template field in a model
(e.g. mrp.bom), while it should be the case.
In the context of an import,
the operator of the name_search is '='.
Therefore, in this super call, the operator was '='
and the name was '' (empty).
In such a case, ('name', '=', '') is added
to the search domain by the base name_search method
(in models.py),
leading to the domain
[('id', 'in', template_ids), ('name', '=', '')]
which will lead to no results.
Forcing 'ilike' as domain is correct, as the actual
name_search, with the correct operator,
has already been performed in the lines above, the
point of this second name_search is to get
the right order along with the right name_get.
opw-632089
This commit is contained in:
parent
c06a969612
commit
83e8c54637
|
@ -816,7 +816,7 @@ class product_template(osv.osv):
|
|||
# re-apply product.template order + name_get
|
||||
return super(product_template, self).name_search(
|
||||
cr, user, '', args=[('id', 'in', template_ids)],
|
||||
operator=operator, context=context, limit=limit)
|
||||
operator='ilike', context=context, limit=limit)
|
||||
|
||||
class product_product(osv.osv):
|
||||
_name = "product.product"
|
||||
|
|
Loading…
Reference in New Issue