[IMP] hr_recruitment:improve job position

bzr revid: pna@tinyerp.com-20120522095532-7xbgeci6eatv3r5p
This commit is contained in:
Pinakin Nayi (OpenERP)
2012-05-22 15:25:32 +05:30
parent 9fcd0f639b
commit 0c44d4c9a7
2 changed files with 15 additions and 9 deletions
+13 -5
View File
@@ -542,11 +542,19 @@ class hr_job(osv.osv):
def action_print_survey(self, cr, uid, ids, context=None):
if context is None:
context = {}
for rec in self.browse(cr, uid, ids, context=context):
if rec.survey_id:
context.update({'survey_id': rec.survey_id.id, 'response_id': [0], 'response_no': 0,})
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context=context)
return value
datas = {}
record = self.browse(cr, uid, ids, context=context)[0]
if record.survey_id:
datas['ids'] = [record.survey_id.id]
datas['model'] = 'survey.print'
context.update({'response_id': [0], 'response_no': 0,})
return {
'type': 'ir.actions.report.xml',
'report_name': 'survey.form',
'datas': datas,
'context' : context,
'nodestroy':True,
}
hr_job()
@@ -352,11 +352,9 @@
<field name="type">form</field>
<field name="inherit_id" ref="hr.view_hr_job_form"/>
<field name="arch" type="xml">
<field name="department_id" position="after">
<field name="survey_id"/>
</field>
<field name="expected_employees" position="after">
<button name="action_print_survey" string="Interview" type="object" icon="gtk-print" attrs="{'invisible':[('survey_id','=',False)]}" colspan="2"/>
<field name="survey_id" />
<button name="action_print_survey" string="Interview" type="object" icon="gtk-print" attrs="{'invisible':[('survey_id','=',False)]}"/>
</field>
</field>
</record>