FIX crash
PEP8
This commit is contained in:
@@ -22,17 +22,19 @@
|
|||||||
|
|
||||||
from openerp.osv import orm
|
from openerp.osv import orm
|
||||||
|
|
||||||
|
|
||||||
# KEEP THIS IN OLD API for the moment
|
# KEEP THIS IN OLD API for the moment
|
||||||
# Otherwise, you will have trouble in the pagination of kanban view and
|
# Otherwise, you will have trouble in the pagination of kanban view and
|
||||||
# the counter for number of records in list view
|
# the counter for number of records in list view
|
||||||
# Bug found at the Barroux Abbey on 29/5/2015
|
# Bug found at the Barroux Abbey on 29/5/2015
|
||||||
|
|
||||||
class ProductTemplate(orm.Model):
|
class ProductTemplate(orm.Model):
|
||||||
_inherit = 'product.template'
|
_inherit = 'product.template'
|
||||||
|
|
||||||
def search(
|
def search(
|
||||||
self, cr, uid, args, offset=0, limit=None, order=None,
|
self, cr, uid, args, offset=0, limit=None, order=None,
|
||||||
context=None, count=False):
|
context=None, count=False):
|
||||||
|
if context is None:
|
||||||
|
context = {}
|
||||||
seller_id = context.get('search_default_seller_id')
|
seller_id = context.get('search_default_seller_id')
|
||||||
if seller_id:
|
if seller_id:
|
||||||
seller_ids = self.pool['product.supplierinfo'].search(
|
seller_ids = self.pool['product.supplierinfo'].search(
|
||||||
@@ -42,6 +44,6 @@ class ProductTemplate(orm.Model):
|
|||||||
args.remove(argument)
|
args.remove(argument)
|
||||||
args.append((('seller_ids', 'in', seller_ids)))
|
args.append((('seller_ids', 'in', seller_ids)))
|
||||||
res = super(ProductTemplate, self).search(
|
res = super(ProductTemplate, self).search(
|
||||||
cr, uid, args, offset=offset, limit=limit, order=order, count=count,
|
cr, uid, args, offset=offset, limit=limit, order=order,
|
||||||
context=context)
|
count=count, context=context)
|
||||||
return res
|
return res
|
||||||
|
|||||||
Reference in New Issue
Block a user