Merge lp:~openerp-dev/openobject-addons/6.0-opw-16889-name_search-ach into lp:openobject-addons/6.0

Proposed by Anup(SerpentCS)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-16889-name_search-ach
Merge into: lp:openobject-addons/6.0
Diff against target: 18 lines (+8/-0)
1 file modified
product/product.py (+8/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-16889-name_search-ach
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) Pending
Review via email: mp+76005@code.launchpad.net

Description of the change

Hello,

When you try to import a product with it's category it gives an error.

This fixes the issue.

Thanks.

To post a comment you must log in.

Unmerged revisions

4830. By Anup(SerpentCS)

[FIX] product : Implemented name_search() Method to import Product Catogery om Products(Case:16889)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'product/product.py'
--- product/product.py 2011-09-05 10:26:44 +0000
+++ product/product.py 2011-09-19 11:32:27 +0000
@@ -197,6 +197,14 @@
197 res.append((record['id'], name))197 res.append((record['id'], name))
198 return res198 return res
199199
200 def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
201 if not args:
202 args = []
203 if context is None:
204 context = {}
205 name = name.split(' / ')[-1]
206 return super(product_category,self).name_search(cr, user, name, args=args, operator=operator, context=context, limit=limit)
207
200 def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):208 def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
201 res = self.name_get(cr, uid, ids, context=context)209 res = self.name_get(cr, uid, ids, context=context)
202 return dict(res)210 return dict(res)