[MOD] crm_lead : set an error message when stage is not defined
bzr revid: vir@tinyerp.com-20100728060048-wptqdxwrbq8dqk77
This commit is contained in:
parent
635fbbd2c0
commit
60afe7e093
|
@ -164,6 +164,13 @@ class crm_lead(osv.osv, crm_case):
|
|||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
|
||||
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
lead_id = vals and vals.get('stage_id',False)
|
||||
if not lead_id:
|
||||
raise osv.except_osv('Error', _('There is no stage defined for this Sales Team'))
|
||||
res_id = super(crm_lead, self).create(cr, uid, vals, context=context)
|
||||
return res_id
|
||||
|
||||
def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
|
||||
"""This function returns value of partner email based on Partner Address
|
||||
|
|
|
@ -131,6 +131,7 @@
|
|||
<field eval=""Smith John"" name="partner_name2"/>
|
||||
<field eval=""(487) 013-1504"" name="partner_mobile"/>
|
||||
<field name="categ_id" ref="crm.categ_oppor6"/>
|
||||
<field name="stage_id" ref="crm.stage_lead1"/>
|
||||
<field eval=""Website Visitor"" name="partner_name"/>
|
||||
<field eval=""smith_john@gmail.com"" name="email_from"/>
|
||||
<field eval="time.strftime('%Y-%m-16 10:05:15')" name="date"/>
|
||||
|
|
Loading…
Reference in New Issue