'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj.probability == 0 and obj.stage_id and obj.stage_id.fold and obj.stage_id.sequence > 1,
},
}
-
+ def schedule_meeting(self, cr, uid, id, context=None):
+ return self.pool.get('res.partner').schedule_meeting(cr, uid, id, context=context)
+
def get_empty_list_help(self, cr, uid, help, context=None):
if context.get('default_type') == 'lead':
context['empty_list_help_model'] = 'crm.case.section'
<button class="oe_inline" type="action" string="Calls"
name="%(crm.crm_case_categ_phone_incoming0)d"
context="{'default_opportunity_id': active_id, 'search_default_opportunity_id': active_id, 'default_partner_id': partner_id, 'default_duration': 1.0}"/>
- <button string="Schedule a Meeting" type="action"
- name="%(calendar.action_calendar_event)d"
- context="{'default_partner_ids': partner_id and [partner_id]}"/>
+ <button class="oe_inline" string="Schedule a Meeting" type="object"
+ name="schedule_meeting" context="{'partner_id': partner_id}"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
def schedule_meeting(self, cr, uid, id, context=None):
if context is None:
context = {}
- user_id = context.get('user_id')
- if user_id:
- partner_id = self.pool.get('res.users').browse(cr, uid, user_id).partner_id.id
+ partner_ids = []
+ partner_id = context.get('partner_id')
+ if partner_id:
+ partner_ids.append(partner_id)
+ partner_ids.append(self.pool.get('res.users').browse(cr, uid, uid).partner_id.id)
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'calendar', 'action_calendar_event', context)
res['context'] = {
- 'default_partner_ids': user_id and [partner_id],
+ 'default_partner_ids': partner_ids,
}
return res
name="%(crm.crm_case_category_act_oppor11)d"
context="{'search_default_partner_id': active_id}"/>
<button class="oe_inline" string="Schedule a Meeting" type="object"
- name="schedule_meeting" context="{'user_id': user_id}"/>
+ name="schedule_meeting" context="{'partner_id': 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}"/>