args position in product_product name_search
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP R&D Addons Team 2 |
Bug Description
If i try to inherit name_search() function of product_product with super I obtain an error. I want to extend the arguments (args parameter) passed to the function but if I insert a "|" operator the code crash. The problem is in this line:
604 -> ids = self.search(cr, user, [('default_
606 -> ids = self.search(cr, user, [('ean13'
622 -> ids = self.search(cr, user, [('default_
when the args parameter is built by adding "args" to an array.
This is my code:
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
if name:
args = ['|', ('my_field', operator, name)] + args
print args
res = super(product_
return res
If I print the args parameter at line 604 in product/product.py i read that args is:
[('default_
and this is wrong.
A simple solution is to invert the addends:
604 -> ids = self.search(cr, user, args + [('default_
606 -> ids = self.search(cr, user,args + [('ean13'
622 -> ids = self.search(cr, user,args + [('default_
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 24 lines (+3/-3)1 file modifiedproduct/product.py (+3/-3)
description: | updated |
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2) |
importance: | Undecided → Low |
status: | New → Confirmed |
Plese, it's possibile to fix this bug? I need to release a module to the community but this bug affect it...