diff options
| author | Harry (OpenERP) <hmo@tinyerp.com> | 2011-03-01 11:25:53 +0530 |
|---|---|---|
| committer | Harry (OpenERP) <hmo@tinyerp.com> | 2011-03-01 11:25:53 +0530 |
| commit | ec73645c4c7d4b160d54156b0e1f10c514e5dfc8 (patch) | |
| tree | 972538df4d46d82688c2853477efe9c6bc1672e9 /addons/hr_recruitment/wizard | |
| parent | 35df09c02820dc3486009b8cf5a88e9c9285ae89 (diff) | |
| parent | 9c7afeb2c8bbe904435d132736e95f7a354c801b (diff) | |
[MERGE] merged trunk-addons-development branch
bzr revid: hmo@tinyerp.com-20110228075715-o0wm18nhd910aubc
bzr revid: hmo@tinyerp.com-20110301055553-adkdzxqxj1fcroh6
Diffstat (limited to 'addons/hr_recruitment/wizard')
| -rw-r--r-- | addons/hr_recruitment/wizard/hr_recruitment_phonecall.py | 16 | ||||
| -rw-r--r-- | addons/hr_recruitment/wizard/hr_recruitment_phonecall_view.xml | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py index ecb6a7cb3a4..13607d41ca0 100644 --- a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py +++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py @@ -32,7 +32,7 @@ class job2phonecall(osv.osv_memory): 'deadline': fields.datetime('Planned Date'), 'note': fields.text('Goals'), 'category_id': fields.many2one('crm.case.categ', 'Category', required=True), - } + } def _date_user(self, cr, uid, context=None): case_obj = self.pool.get('hr.applicant') @@ -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('email.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"> |
