From 1a4177d7778df6469e51f60be31829306f8024f4 Mon Sep 17 00:00:00 2001 From: Kersten Jeremy Date: Thu, 24 Apr 2014 12:10:36 +0200 Subject: [PATCH] [FIX] Calendar - Override _name_search to convert virtual_id to real_id bzr revid: jke@openerp.com-20140424101036-1twaii8oj70e4fx5 --- addons/calendar/calendar.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 52ed2ef..22d5695 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -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''' -- 1.7.10.4