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
1=== modified file 'product/product.py'
2--- product/product.py 2011-09-05 10:26:44 +0000
3+++ product/product.py 2011-09-19 11:32:27 +0000
4@@ -197,6 +197,14 @@
5 res.append((record['id'], name))
6 return res
7
8+ def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
9+ if not args:
10+ args = []
11+ if context is None:
12+ context = {}
13+ name = name.split(' / ')[-1]
14+ return super(product_category,self).name_search(cr, user, name, args=args, operator=operator, context=context, limit=limit)
15+
16 def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
17 res = self.name_get(cr, uid, ids, context=context)
18 return dict(res)