From a6480df8c54cec80ea4dc16c7e6eb2c5ef05be88 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 30 Jun 2015 23:29:15 +0200 Subject: [PATCH] FIX crash PEP8 --- partner_products_shortcut/product.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/partner_products_shortcut/product.py b/partner_products_shortcut/product.py index 4c781fc..a78826c 100644 --- a/partner_products_shortcut/product.py +++ b/partner_products_shortcut/product.py @@ -22,17 +22,19 @@ from openerp.osv import orm + # KEEP THIS IN OLD API for the moment # Otherwise, you will have trouble in the pagination of kanban view and # the counter for number of records in list view # Bug found at the Barroux Abbey on 29/5/2015 - class ProductTemplate(orm.Model): _inherit = 'product.template' def search( self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): + if context is None: + context = {} seller_id = context.get('search_default_seller_id') if seller_id: seller_ids = self.pool['product.supplierinfo'].search( @@ -42,6 +44,6 @@ class ProductTemplate(orm.Model): args.remove(argument) args.append((('seller_ids', 'in', seller_ids))) res = super(ProductTemplate, self).search( - cr, uid, args, offset=offset, limit=limit, order=order, count=count, - context=context) + cr, uid, args, offset=offset, limit=limit, order=order, + count=count, context=context) return res