[IMP] crm: added method to view phone calls related to partner
bzr revid: cha@tinyerp.com-20121120114706-80kw0u0zks4y2hoc
This commit is contained in:
parent
087fe434b8
commit
b76352405b
|
@ -289,6 +289,17 @@ class crm_lead(base_stage, format_address, osv.osv):
|
|||
self.create_send_note(cr, uid, [obj_id], context=context)
|
||||
return obj_id
|
||||
|
||||
def view_phone_calls(self, cr, uid, ids, context=None):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
partner = self.pool.get('crm.lead').browse(cr, uid, ids[0], context=context).partner_id.id
|
||||
|
||||
result = mod_obj.get_object_reference(cr, uid, 'crm', 'crm_case_categ_phone_incoming0')
|
||||
id = result and result[1] or False
|
||||
result = act_obj.read(cr, uid, [id], context=context)[0]
|
||||
result.update({'context':{'search_default_partner_id': partner}})
|
||||
return result
|
||||
|
||||
def onchange_stage_id(self, cr, uid, ids, stage_id, context=None):
|
||||
if not stage_id:
|
||||
return {'value':{}}
|
||||
|
|
|
@ -105,14 +105,6 @@
|
|||
<!--
|
||||
LEADS
|
||||
-->
|
||||
<act_window
|
||||
id="act_crm_opportunity_crm_phonecall_new"
|
||||
name="Phone calls"
|
||||
groups="base.group_sale_salesman"
|
||||
res_model="crm.phonecall"
|
||||
view_mode="tree,calendar,form"
|
||||
context="{'default_duration': 1.0 ,'default_opportunity_id': active_id}"
|
||||
view_type="form"/>
|
||||
|
||||
<act_window
|
||||
id="act_crm_opportunity_crm_meeting_new"
|
||||
|
@ -141,8 +133,8 @@
|
|||
</header>
|
||||
<sheet>
|
||||
<div class="oe_right oe_button_box" name="buttons">
|
||||
<button type="action"
|
||||
name="%(act_crm_opportunity_crm_phonecall_new)d"
|
||||
<button type="object"
|
||||
name="view_phone_calls"
|
||||
string="Phone Calls" />
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
|
|
Loading…
Reference in New Issue