Files
Odoo-Tutorial/education/models/education_student.py
T
2025-02-21 18:00:17 +07:00

10 lines
372 B
Python

from odoo import models, fields
class EducationStudent(models.Model):
_name = 'education.student'
name = fields.Char(string="Name")
student_code = fields.Char(string='Student Code')
class_id = fields.Many2one('education.class', string='Class')
def get_student_has_class(self):
return self.env['education.student'].search([('class_id', '!=', False)])