diff options
| author | sbh (Open ERP) <sbh@tinyerp.com> | 2010-01-19 15:07:41 +0530 |
|---|---|---|
| committer | sbh (Open ERP) <sbh@tinyerp.com> | 2010-01-19 15:07:41 +0530 |
| commit | cf5915ae43256ef8aeebcaea351d9ddee1ea8de6 (patch) | |
| tree | 23be8a142f7d99c193fdfa03316dafb839ad035b | |
| parent | 031765285d68512756933ab59b03fd7a48419a7f (diff) | |
[IMP] CRM_HR:set section_id and phonecall_id in crm_job
bzr revid: sbh@tinyerp.com-20100119093741-8hry1uow77eomqmm
| -rw-r--r-- | addons/crm_hr/crm_hr.py | 1 | ||||
| -rw-r--r-- | addons/crm_hr/crm_hr_view.xml | 6 | ||||
| -rw-r--r-- | addons/crm_hr/wizard/crm_hr_wizard.py | 9 |
3 files changed, 10 insertions, 6 deletions
diff --git a/addons/crm_hr/crm_hr.py b/addons/crm_hr/crm_hr.py index da144da950a..7fe2f2c4878 100644 --- a/addons/crm_hr/crm_hr.py +++ b/addons/crm_hr/crm_hr.py @@ -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'), } diff --git a/addons/crm_hr/crm_hr_view.xml b/addons/crm_hr/crm_hr_view.xml index 7e9d4249075..ca0a7d635d7 100644 --- a/addons/crm_hr/crm_hr_view.xml +++ b/addons/crm_hr/crm_hr_view.xml @@ -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"> diff --git a/addons/crm_hr/wizard/crm_hr_wizard.py b/addons/crm_hr/wizard/crm_hr_wizard.py index 28491098c27..d682a72b044 100644 --- a/addons/crm_hr/wizard/crm_hr_wizard.py +++ b/addons/crm_hr/wizard/crm_hr_wizard.py @@ -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]) |
