Created
July 15, 2017 07:22
-
-
Save tienhieuD/68127a7381803c66634306b6681f4cc1 to your computer and use it in GitHub Desktop.
sum of the teachers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class gvdd_hskt(models.Model): | |
_name = 'solienlac.baocao.gvdd_hskt' | |
'''Số hiệu giáo viên giảng dạy và học sinh khuyết tật''' | |
khoi = fields.Many2one('solienlac.khoi', string='Khối', required='True') | |
giaovien_ts = fields.Integer('Số lượng giáo viên') | |
stringlog = fields.Char('logging') | |
@api.multi | |
@api.onchange('khoi') | |
def demsogiaovien(self): | |
list_gv = self.env['solienlac.monhoc_has_giaovien'].search([('lop.khoi.id', '=', self.khoi.id)]) | |
list_gv_id = [] | |
for gv in list_gv: | |
list_gv_id.append(gv.id) | |
list_gv_id = map(lambda x: int(x), list_gv_id) | |
list_gv_id = list(set(list_gv_id)) | |
self.stringlog = str(len(list_gv_id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment