[IMP] CRM_HR:set section_id and phonecall_id in crm_job

bzr revid: sbh@tinyerp.com-20100119093741-8hry1uow77eomqmm
This commit is contained in:
sbh (Open ERP)
2010-01-19 15:07:41 +05:30
parent 031765285d
commit cf5915ae43
3 changed files with 10 additions and 6 deletions
+1
View File
@@ -62,6 +62,7 @@ class crm_job(osv.osv):
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
"the partner mentality in relation to our services.The scale has" \
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
}
+4 -2
View File
@@ -65,8 +65,6 @@
<field name="name" string="Description" colspan="2"/>
<field name="section_id" colspan="1" widget="selection"/>
<field name="user_id" string="Responsible" select="2"/>
<button string="Schedule a Phone Call"
name="%(wizard_crm_job_reschedule_phone_call)d" icon="gtk-redo" type="action" />
<newline/>
<label string="Stage: " align="1.0"/>
<group colspan="1" col="2">
@@ -76,6 +74,10 @@
<field name="date" string="Next Interview"/>
<field name="duration" widget="float_time"/>
<button name="%(wizard_crm_job_meeting_set)d" string="Schedule Meeting" icon="terp-crm" type="action"/>
<field name="phonecall_id" select="1"/>
<button string="Schedule a Phone Call"
name="%(wizard_crm_job_reschedule_phone_call)d" icon="gtk-redo" type="action" attrs="{'invisible':[('phonecall_id','!=',False)]}"/>
</group>
<notebook colspan="4">
<page string="Job Info">
+5 -4
View File
@@ -58,7 +58,8 @@ class job2phonecall(wizard.interface):
case = case_obj.browse(cr, uid, data['id'])
return {
'user_id' : case.user_id and case.user_id.id,
'category_id' : categ_id and categ_id[0] or case.categ_id and case.categ_id.id,
'category_id' : categ_id and categ_id[0] or case.categ_id and case.categ_id.id,
'section_id' : case.section_id and case.section_id.id or False,
'note' : case.description
}
@@ -84,17 +85,17 @@ class job2phonecall(wizard.interface):
#TODO : Take other info from job
new_phonecall_id = phonecall_case_obj.create(cr, uid, {
'name' : job.name,
'case_id' : job.inherit_case_id.id,
'user_id' : form['user_id'],
'categ_id' : form['category_id'],
'description' : form['note'],
'date' : form['deadline'],
'section_id' : form['section_id']
'section_id' : form['section_id'],
'description':job.description,
}, context=context)
new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id)
vals = {}
if not job.case_id:
vals.update({'case_id' : new_phonecall.inherit_case_id.id})
vals.update({'phonecall_id' : new_phonecall.id})
job_case_obj.write(cr, uid, [job.id], vals)
job_case_obj.case_cancel(cr, uid, [job.id])
phonecall_case_obj.case_open(cr, uid, [new_phonecall_id])