'driver_id': fields.many2one('hr.employee','driver'),
'planning_ids': fields.one2many('asc.driver.planning', 'driver_id', 'planning driver'),
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
'driver_id': fields.many2one('hr.employee','driver'),
'planning_ids': fields.one2many('asc.driver.planning', 'driver_id', 'planning driver'),
Hello Tatek,
Try this :-
class asc_hr_employee(osv.osv):
_inherit = 'hr.employee'
_columns = {
'planning_ids': fields.one2many('asc.planning.line', 'driver_id', 'Driver'),
#Others Columns
}
class asc_driver_planning(osv.osv):
_name = "asc.planning.line"
_description = "planning driver"
_columns = {
'driver_id': fields.many2one('hr.employee','Driver'),
#Other Columns
}
Thanks,
class asc_hr_employee(osv.osv):
_inherit = 'hr.employee'
_columns = {
'planing_line': fields.one2many('asc.rental.contract','rental_employ_id','planning driver'),
'is_driver': fields.boolean(' is driver'),
'date_start':fields.function(_get_date,'date debut',type='datetime'),
'date_end':fields.function(_get_date,'date fin',type='datetime'),
}
_default= {
'is_driver':False,
}
asc_hr_employee()
----------------------------------------
class asc_driver_planning(osv.osv):
_name = "asc.planning.line"
_description = "planning driver"
columns = {
'driver_id': fields.many2one('hr.employee','driver'),
'name': fields.char('Name', size=64,readonly=True),
'start_date': fields.datetime('start date',required=True),
'end_date': fields.datetime('end date', required=True ) ,
'state': fields.selection([
('draft', 'Reservation'),
('done', 'Done'),
('cancel', 'Cancelled'),
]),
}
asc_driver_planning()
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Can you post your code ?