Merge lp:~openerp-dev/openobject-addons/6.0-opw-574759-ksa into lp:openobject-addons/6.0

Proposed by Kirti Savalia(OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 5227
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-574759-ksa
Merge into: lp:openobject-addons/6.0
Diff against target: 23 lines (+13/-0)
1 file modified
product/product.py (+13/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-574759-ksa
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+105633@code.launchpad.net

Description of the change

Hello,

Fixed the problem when import the data with product category in product form.

Thanks
KSA

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

5227. By Kirti Savalia(OpenERP)

[FIX]: when import the data with product category you can not import the data

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 2012-03-30 08:53:02 +0000
3+++ product/product.py 2012-05-14 10:40:24 +0000
4@@ -184,6 +184,19 @@
5 # Categories
6 #----------------------------------------------------------
7 class product_category(osv.osv):
8+
9+ def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
10+ if not args:
11+ args=[]
12+ if not context:
13+ context={}
14+ if name:
15+ # Be sure name_search is symetric to name_get
16+ name = name.split(' / ')[-1]
17+ ids = self.search(cr, uid, [('name', operator, name)] + args, limit=limit, context=context)
18+ else:
19+ ids = self.search(cr, uid, args, limit=limit, context=context)
20+ return self.name_get(cr, uid, ids, context)
21
22 def name_get(self, cr, uid, ids, context=None):
23 if not len(ids):