[FIX] Calendar - Override _name_search to convert virtual_id to real_id

bzr revid: jke@openerp.com-20140424101036-1twaii8oj70e4fx5
This commit is contained in:
Kersten Jeremy 2014-04-24 12:10:36 +02:00
parent 2ce61258ad
commit 1a4177d777
1 changed files with 7 additions and 0 deletions

View File

@ -1397,6 +1397,13 @@ class calendar_event(osv.Model):
'flags': {'form': {'action_buttons': True, 'options': {'mode': 'edit'}}}
}
def _name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100, name_get_uid=None):
for arg in args:
if arg[0] == 'id':
for n, calendar_id in enumerate(arg[2]):
arg[2][n] = calendar_id.split('-')[0]
return super(calendar_event, self)._name_search(cr, user, name=name, args=args, operator=operator, context=context, limit=limit, name_get_uid=name_get_uid)
def write(self, cr, uid, ids, values, context=None):
def _only_changes_to_apply_on_real_ids(field_names):
''' return True if changes are only to be made on the real ids'''