I do this :
class hr_posting(osv.osv):
_name = 'hr.posting'
_inherit = ['mail.thread']
_description = 'Posting'
_columns = {
'name': fields.char('Description', size=64),
'employee_id': fields.many2one('hr.employee', 'Employee'),
'state': fields.selection([
('draft', 'Draft'),
('confirm', 'Confirm'),
('close', 'Close'),
], 'Status', select=True),
'job_id': fields.many2one('hr.job', 'Source Job', required=True),
hr_posting()
So i define view and workflow for this object. My need is to define a function which will write state 'confirm' and also write in the hr.employee.job_id field of the selected employee from the hr.posting object (field employee_id), the selected hr.posting.job_id.id Thanks.