Anup(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-16889-name_search-ach into 
lp:openobject-addons/6.0.

Requested reviews:
  Raphael Collet (OpenERP) (rco-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-16889-name_search-ach/+merge/76005

Hello,

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

This fixes the issue.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-16889-name_search-ach/+merge/76005
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-16889-name_search-ach.
=== 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 @@
             res.append((record['id'], name))
         return res
 
+    def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
+        if not args:
+            args = []
+        if context is None:
+            context = {}
+        name = name.split(' / ')[-1]
+        return super(product_category,self).name_search(cr, user, name, args=args, operator=operator, context=context, limit=limit)
+    
     def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
         res = self.name_get(cr, uid, ids, context=context)
         return dict(res)

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to