Khushboo Bhatt(openerp) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-addons9-sale-apa-sale-kbh into 
lp:~openerp-dev/openobject-addons/trunk-addons9-sale-apa.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons9-sale-apa-sale-kbh/+merge/123912

Hello,

  sale::
  I have added method for searching product by category in sales.

Thanks,
KBH.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons9-sale-apa-sale-kbh/+merge/123912
Your team OpenERP R&D Team is requested to review the proposed merge of 
lp:~openerp-dev/openobject-addons/trunk-addons9-sale-apa-sale-kbh into 
lp:~openerp-dev/openobject-addons/trunk-addons9-sale-apa.
=== modified file 'product/product.py'
--- product/product.py	2012-09-07 09:51:55 +0000
+++ product/product.py	2012-09-12 09:29:30 +0000
@@ -743,6 +743,14 @@
         else:
             return super(product_product, self).copy(cr, uid, id, default=default,
                     context=context)
+
+    def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
+        if context is None:
+            context = {}
+        if context and context.get('search_default_categ_id', False):
+            args.append((('categ_id', 'child_of', context['search_default_categ_id'])))
+        return super(product_product, self).search(cr, uid, args, offset, limit, order, context, count)
+
 product_product()
 
 class product_packaging(osv.osv):

_______________________________________________
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