[FIX] Functional fields should have context as an argument when we use fnct_searc method

lp bug: https://launchpad.net/bugs/504670 fixed

bzr revid: jvo@tinyerp.com-20100108113858-dp3e8pm5px4uspum
This commit is contained in:
Jay (Open ERP) 2010-01-08 17:08:58 +05:30
parent 02e18c4262
commit a23b83db01
9 changed files with 10 additions and 10 deletions

View File

@ -761,7 +761,7 @@ class account_move(osv.osv):
result.setdefault(id, 0.0)
return result
def _search_amount(self, cr, uid, obj, name, args):
def _search_amount(self, cr, uid, obj, name, args, context):
ids = []
cr.execute('select move_id,sum(debit) from account_move_line group by move_id')
result = dict(cr.fetchall())

View File

@ -284,7 +284,7 @@ class account_move_line(osv.osv):
result.append((line.id, line.name))
return result
def _invoice_search(self, cursor, user, obj, name, args):
def _invoice_search(self, cursor, user, obj, name, args, context):
if not len(args):
return []
invoice_obj = self.pool.get('account.invoice')

View File

@ -118,7 +118,7 @@ class res_partner(osv.osv):
res[pid][maps[type]] = (type=='receivable') and val or -val
return res
def _credit_search(self, cr, uid, obj, name, args):
def _credit_search(self, cr, uid, obj, name, args, context):
if not len(args):
return []
where = ' and '.join(map(lambda x: '(sum(debit-credit)'+x[1]+str(x[2])+')',args))
@ -129,7 +129,7 @@ class res_partner(osv.osv):
return [('id','=','0')]
return [('id','in',map(lambda x:x[0], res))]
def _debit_search(self, cr, uid, obj, name, args):
def _debit_search(self, cr, uid, obj, name, args, context):
if not len(args):
return []
query = self.pool.get('account.move.line')._query_get(cr, uid, context={})

View File

@ -47,7 +47,7 @@ class account_move_line(osv.osv):
r=dict(cr.fetchall())
return r
def _to_pay_search(self, cr, uid, obj, name, args):
def _to_pay_search(self, cr, uid, obj, name, args, context):
if not len(args):
return []
line_obj = self.pool.get('account.move.line')

View File

@ -492,7 +492,7 @@ class ir_action_report_xml(osv.osv):
res[data.get('id')] = False
return res
def _model_search(self, cr, uid, obj, name, args):
def _model_search(self, cr, uid, obj, name, args, context):
if not len(args):
return []
model_id= args[0][2]

View File

@ -112,7 +112,7 @@ class res_users(osv.osv):
child_ids.extend(tools.flatten(childs))
return child_ids
def _parent_search(self, cr, uid, obj, name, args):
def _parent_search(self, cr, uid, obj, name, args, context):
parent = []
for arg in args:
if arg[0] == 'parent_id':

View File

@ -346,7 +346,7 @@ class hr_timesheet_line(osv.osv):
res[line_id] = False
return res
def _sheet_search(self, cursor, user, obj, name, args):
def _sheet_search(self, cursor, user, obj, name, args, context):
if not len(args):
return []
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')

View File

@ -150,7 +150,7 @@ class sale_order(osv.osv):
res[sale.id] = False
return res
def _invoiced_search(self, cursor, user, obj, name, args):
def _invoiced_search(self, cursor, user, obj, name, args, context):
if not len(args):
return []
clause = ''

View File

@ -841,7 +841,7 @@ class stock_production_lot(osv.osv):
res.update(dict(cr.fetchall()))
return res
def _stock_search(self, cr, uid, obj, name, args):
def _stock_search(self, cr, uid, obj, name, args, context):
locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')])
cr.execute('''select
prodlot_id,