summaryrefslogtreecommitdiff
path: root/addons/hr_recruitment/wizard
diff options
context:
space:
mode:
authorRucha (Open ERP) <rpa@tinyerp.com>2011-02-28 13:05:11 +0530
committerRucha (Open ERP) <rpa@tinyerp.com>2011-02-28 13:05:11 +0530
commit68b1f5ee11cb761f9acc77e03d498fcd9a391aa1 (patch)
treef504fd95cb7e2fcaa93a4a3ffa8ac68156175ed1 /addons/hr_recruitment/wizard
parent157a089b3d60ba56df60ec397efdd3084a795de6 (diff)
parent1bfe6c8df9910a527f93ac3e8906f96185330a91 (diff)
[REVERT]: Reverted merge with trunk-dev-addons2 at rev-id: rha@tinyerp.com-20110215062118-pcdwql1vc0cyqkui
bzr revid: rpa@tinyerp.com-20110228073511-2b1cj4wq3qhuqh7s
Diffstat (limited to 'addons/hr_recruitment/wizard')
-rw-r--r--addons/hr_recruitment/wizard/hr_recruitment_phonecall.py14
-rw-r--r--addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml2
2 files changed, 12 insertions, 4 deletions
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py
index becef387151..edd08b5b531 100644
--- a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py
+++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py
@@ -50,11 +50,19 @@ class job2phonecall(osv.osv_memory):
return categ_id and categ_id[0] or case.categ_id and case.categ_id.id or False
def _get_note(self, cr, uid, context=None):
- case_obj = self.pool.get('hr.applicant')
+ msg_obj = self.pool.get('mailgate.message')
if context is None:
context = {}
- case = case_obj.browse(cr, uid, context.get('active_id', False), context=context)
- return case.description or ''
+ if context.get('active_id'):
+ case = self.pool.get('hr.applicant').browse(cr, uid, context['active_id'], context=context)
+ if case.description:
+ return case.description
+ else:
+ msg_ids = msg_obj.search(cr, uid, [('model', '=', 'hr.applicant'), ('res_id', '=', case.id), ('email_from', '!=', ''), ('email_to', '!=', '')], limit=1)
+ if msg_ids:
+ return msg_obj.browse(cr, uid, msg_ids[0], context=context).description
+ return False
+
_defaults = {
'user_id': _date_user,
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
index 95fe9c83018..10329c6a856 100644
--- a/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
+++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml
@@ -16,7 +16,7 @@
<newline />
<field name='note' colspan="4"/>
<newline />
- <field name='category_id'/>
+ <field name='category_id' domain="[('object_id.model', '=', 'crm.phonecall')]"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">