I am working on Recruitment module. I have five stages. When a candidate reach the last stage, the candidates some details should be saved into another table. Is it possible? I know all the datas are available in recruitment table. But i want some datas in another table. Please help anyone.
1 Trả lời
New Table:
_columns = {
'hr_applicant_id': fields.many2one('hr.applicant', 'Hr Applicant Ref'),
'x_project_start_date': fields.date('Start Date', required=True, select=True),
'x_project_end date': fields.date('End Date', required=True, select=True),
}
hr_applicant:
active_id = context.get('active_id')
applicant_obj = self.pool.get('hr.applicant')
project_obj = self.pool.get('x_project.details')
applicant_record = self.browse(cr, uid, ids, active_id, context=context)
x_project_sr = project_obj .search(cr, uid, [('hr_applicant_id', '=', applicant_record .id)])
if not x_project_sr:
project_obj.create(cr, uid, {'hr_applicant_id': applicant_record .id,'x_project_start_date':applicant_record.x_project_start_date, 'x_project_end_date':applicant_record.x_project_end_date})
else:
project_obj.write(cr, uid, x_project_sr[0], {'x_project_start_date':applicant_record.x_project_start_date, 'x_project_end_date':applicant_record.x_project_end_date})
Hr_applicant form value : id =1, start_date = 23/12/2013, end_date = 24/12/2013 while saving the record one x_project.details will be created. right? but in case you edit the hr_applicant same form like : id =1, start_date = 23/12/2013, end_date = 25/12/2013, while saving again this form it will create a new x_project.details form or update the value?
active_id = context.get('active_id') applicant_obj = self.pool.get('hr.applicant') project_obj = self.pool.get('x_project.details') applicant_record = self.browse(cr, uid, ids, active_id, context=context) project_obj.create(cr, uid, {'hr_applicant_id': applicant_record .id,'x_project_start_date':applicant_record.x_project_start_date, 'x_project_end_date':applicant_record.x_project_end_date})
can you help me to get started, am a beginner, this is ma first project inopen erp..where can i find administration-modules-import modules, provideme screen shots...buddy
When you reach the last stage, use "create"(ORM) function and write the values in another table.
I need your tables details,and what are the fields will be updated in new table.
In hr.applicant i have added x_project(many2one),x_project_start_date,x_project_end date(both are date field) etc. Create a new table ie,x_project.details add all these fields as char. When the candidate reach last stage. All its datas that we want to save in x_project.details, wants to save automatically.
without any action like click a button, you have to save the record in another table?
We have to write the values from hr.applicant to x_project.details. right?