[FIX] Account: Other user can also open invoices and entiries
bzr revid: mra@mra-laptop-20100814122400-82hsjioqugm0jlkz
This commit is contained in:
parent
d9b17562a5
commit
3b9c2c2e6d
|
@ -731,17 +731,19 @@ class account_journal(osv.osv):
|
||||||
# })
|
# })
|
||||||
return journal_id
|
return journal_id
|
||||||
|
|
||||||
def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=100):
|
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
|
||||||
if not args:
|
if not args:
|
||||||
args = []
|
args = []
|
||||||
|
if context is None:
|
||||||
|
context = {}
|
||||||
ids = []
|
ids = []
|
||||||
if context.get('journal_type', False):
|
if context.get('journal_type', False):
|
||||||
args += [('type','=',context.get('journal_type'))]
|
args += [('type','=',context.get('journal_type'))]
|
||||||
|
|
||||||
if name:
|
if name:
|
||||||
ids = self.search(cr, user, [('code', 'ilike', name)]+ args, limit=limit, context=context)
|
ids = self.search(cr, user, [('code', 'ilike', name)]+ args, limit=limit, context=context)
|
||||||
if not ids:
|
if not ids:
|
||||||
ids = self.search(cr, user, [('name', operator, name)]+ args, limit=limit, context=context)
|
# ids = self.search(cr, user, [('name', operator, name)]+ args, limit=limit, context=context)
|
||||||
|
ids = self.search(cr, user, [('name', 'ilike', name)]+ args, limit=limit, context=context)#fix it ilike should be replace with operator
|
||||||
|
|
||||||
return self.name_get(cr, user, ids, context=context)
|
return self.name_get(cr, user, ids, context=context)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue