Skip to content

Instantly share code, notes, and snippets.

@tienhieuD
Last active July 18, 2017 07:19
Show Gist options
  • Save tienhieuD/50a8230b933851bd3565a06b799a17f3 to your computer and use it in GitHub Desktop.
Save tienhieuD/50a8230b933851bd3565a06b799a17f3 to your computer and use it in GitHub Desktop.
@api.multi
@api.onchange('monhoc')
def tinhhinhgiaovientrongto(self):
lst = [] #list chứa id giáo viên dạy môn học đc chọn
tmp1 = self.env['solienlac.monhoc_has_giaovien'].search([
('monhoc.id', '=', self.monhoc.id),
])
tmp2 = map(lambda x: x.giaovien.id, tmp1)
lst = tmp2
return {'domain':{'giaovien': [('id', 'in', lst)]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment