update education module
This commit is contained in:
@@ -7,15 +7,16 @@ class EductionClassGroup(models.Model):
|
||||
_order = 'sequence'
|
||||
|
||||
name = fields.Char(string='Name', translate=True, required=True)
|
||||
parent_id = fields.Many2one('education.class.group', string='Parent Group', ondelete='restrict')
|
||||
child_ids = fields.One2many('education.class.group', string='Child Groups', ondelete='restrict')
|
||||
class_ids = fields.One2many('education.class', 'class_group_id', string='Class of Groups')
|
||||
# parent_id = fields.Many2one('education.class.group', string='Parent Group', ondelete='restrict')
|
||||
# child_ids = fields.One2many('education.class.group', string='Child Groups', ondelete='restrict')
|
||||
|
||||
# class_ids = fields.One2many('education.class', 'class_group_id', string='Class of Groups')
|
||||
|
||||
_parent_store = True
|
||||
_parent_name = "parent_id"
|
||||
parent_path = fields.Char(index=True)
|
||||
|
||||
@api.constraints('parent_id')
|
||||
@api.constrains('parent_id')
|
||||
def _check_hierarchy(self):
|
||||
if not self._check_recursion():
|
||||
raise ValidationError('Error! You cannot create recursivecategories.')
|
||||
Reference in New Issue
Block a user