'alarm_ids': fields.many2many('calendar.alarm', string='Reminders', ondelete="restrict"),
}
+
+ def _get_default_partners(self, cr, uid, ctx=None):
+ ret = [self.pool['res.users'].browse(cr, uid, uid, context=ctx).partner_id.id]
+ active_id = ctx.get('active_id')
+ if ctx.get('active_model') == 'res.partner' and active_id:
+ if active_id not in ret:
+ ret.append(active_id)
+ return ret
+
_defaults = {
'end_type': 'count',
'count': 1,
'interval': 1,
'active': 1,
'user_id': lambda self, cr, uid, ctx: uid,
- 'partner_ids': lambda self, cr, uid, ctx: [self.pool['res.users'].browse(cr, uid, [uid], context=ctx)[0].partner_id.id]
+ 'partner_ids': _get_default_partners,
}
def _check_closing_date(self, cr, uid, ids, context=None):
<button class="oe_inline" type="action"
string="Meetings"
name="%(calendar.action_calendar_event)d"
- context="{'search_default_partner_ids': active_id, 'default_partner_ids' : [active_id]}"/>
+ context="{'search_default_partner_ids': active_id}"/>
<button class="oe_inline" type="action" string="Calls"
name="%(crm.crm_case_categ_phone_incoming0)d"
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}" />