From 7e7fb82a04d131001a57d154d888972b1333c423 Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Tue, 27 Nov 2012 16:04:37 +0530 Subject: [PATCH] [IMP]solve problem of create a recurrent meeting and reload the page try to open that meeting in calendar from bzr revid: pja@tinyerp.com-20121127103437-3drxidi21g0bbet3 --- addons/base_calendar/crm_meeting.py | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 9ceaea671ca..bd15666def6 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -66,6 +66,15 @@ class crm_meeting(base_state, osv.Model): 'state': 'open', } + def message_get_subscription_data(self, cr, uid, ids, context=None): + res = {} + for virtual_id in ids: + real_id = base_calendar.base_calendar_id2real_id(virtual_id) + result = super(crm_meeting, self).message_get_subscription_data(cr, uid, [real_id], context=context) + res[virtual_id] = result[real_id] + return res + + def copy(self, cr, uid, id, default=None, context=None): default = default or {} default['attendee_ids'] = False @@ -115,3 +124,41 @@ class crm_meeting(base_state, osv.Model): def case_close_send_note(self, cr, uid, ids, context=None): return self.message_post(cr, uid, ids, body=_("Meeting completed."), context=context) + +class mail_message(osv.osv): + _inherit = "mail.message" + + def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False): + cal_event_pool = self.pool.get('calendar.event') + for arg in args: + if arg[0] == "res_id": + if isinstance(arg[2], (str)): + args[1][2] = cal_event_pool.remove_virtual_id(arg[2]) + res = super(mail_message, self).search(cr, uid, args, offset, limit, order, context, count=False) + if count: + return len(res) + elif limit: + return res[offset:offset+limit] + else: + return res + +mail_message() + +class ir_attachment(osv.osv): + _inherit = "ir.attachment" + + def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False): + cal_event_pool = self.pool.get('calendar.event') + for arg in args: + if arg[0] == "res_id": + if isinstance(arg[2], (str)): + args[1][2] = cal_event_pool.remove_virtual_id(arg[2]) + res = super(ir_attachment, self).search(cr, uid, args, offset, limit, order, context, count=False) + if count: + return len(res) + elif limit: + return res[offset:offset+limit] + else: + return res + + \ No newline at end of file