[FIX] Account, l10nbe - Respect name_search operator for account.account, so = really work as expected.
Also fix data file in l10nbe which was relying on the old implementation.
This commit is contained in:
commit
05ed1d1399
|
@ -580,7 +580,14 @@ class account_account(osv.osv):
|
||||||
pass
|
pass
|
||||||
if name:
|
if name:
|
||||||
if operator not in expression.NEGATIVE_TERM_OPERATORS:
|
if operator not in expression.NEGATIVE_TERM_OPERATORS:
|
||||||
ids = self.search(cr, user, ['|', ('code', '=like', name+"%"), '|', ('shortcut', '=', name), ('name', operator, name)]+args, limit=limit)
|
plus_percent = lambda n: n+'%'
|
||||||
|
code_op, code_conv = {
|
||||||
|
'ilike': ('=ilike', plus_percent),
|
||||||
|
'like': ('=like', plus_percent),
|
||||||
|
}.get(operator, (operator, lambda n: n))
|
||||||
|
|
||||||
|
ids = self.search(cr, user, ['|', ('code', code_op, code_conv(name)), '|', ('shortcut', '=', name), ('name', operator, name)]+args, limit=limit)
|
||||||
|
|
||||||
if not ids and len(name.split()) >= 2:
|
if not ids and len(name.split()) >= 2:
|
||||||
#Separating code and name of account for searching
|
#Separating code and name of account for searching
|
||||||
operand1,operand2 = name.split(' ',1) #name can contain spaces e.g. OpenERP S.A.
|
operand1,operand2 = name.split(' ',1) #name can contain spaces e.g. OpenERP S.A.
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue