From 3b9c2c2e6d57123ec1157d7ace285096460e138f Mon Sep 17 00:00:00 2001 From: "PSI(OpenERP)" <> Date: Sat, 14 Aug 2010 17:54:00 +0530 Subject: [PATCH] [FIX] Account: Other user can also open invoices and entiries bzr revid: mra@mra-laptop-20100814122400-82hsjioqugm0jlkz --- addons/account/account.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index cdde644487b..37455e59cd1 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -731,17 +731,19 @@ class account_journal(osv.osv): # }) 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: args = [] + if context is None: + context = {} ids = [] if context.get('journal_type', False): args += [('type','=',context.get('journal_type'))] - if name: ids = self.search(cr, user, [('code', 'ilike', name)]+ args, limit=limit, context=context) 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)