Hai everyone i want to auto fill the dropdown when i select from another dropdown list (based on dropdown choices)
i have a faculty field .when i select faculty name from the dropdown automatically fill the department and subject fields. but a faculty will teach 2 subjects i want to display 2 subjects in subjecct field then i will choose one subject how i will do please suggest me
py file:
name = fields.Many2one('faculty_id.profile', string="Faculty Name",required= True)
Date=fields.Date('Date of Attendance',default=fields.Date.today,readonly=True)
subject=fields.Many2one('subjects.list',required=True)
department_id=fields.Many2one('jntukstudent.department','Department',required=True)
@api.onchange('name')
def _onchange_name(self):
if self.name:
self.subject = self.name.subject
self.department_id = self.name.department_id
You need dependent dropdown: http://learnopenerp.blogspot.com/2016/10/onchange-many2one-filed-in-odoo.html