[Merge] Merge the Sales/CRM section.
bzr revid: mdi@tinyerp.com-20121121053405-l0djdvl84m0oqts8
This commit is contained in:
@@ -272,6 +272,10 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
'color': 0,
|
||||
}
|
||||
|
||||
_sql_constraints = [
|
||||
('check_probability', 'check(probability >= 0 and probability <= 100)', 'Probability should be between 0-100% !')
|
||||
]
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
obj_id = super(crm_lead, self).create(cr, uid, vals, context)
|
||||
section_id = self.browse(cr, uid, obj_id, context=context).section_id
|
||||
@@ -281,6 +285,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">
|
||||
|
||||
Reference in New Issue
Block a user