Use declarative index definition for ModelSQL

issue5757
This commit is contained in:
Raimon Esteve 2022-11-09 16:37:55 +01:00
parent 70e9642b9c
commit 8730ccec53
1 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ class Category(DeactivableMixin, tree(separator=' / '), ModelSQL, ModelView):
name = fields.Char('Name', required=True, translate=True,
help="The main identifier of the category.")
parent = fields.Many2One('activity.category', 'Parent',
select=True, help="Add the category below the parent.")
help="Add the category below the parent.")
childs = fields.One2Many('activity.category', 'parent',
'Children', help="Add children below the category.")
@ -46,6 +46,6 @@ class ActivityCategory(ModelSQL):
__name__ = 'activity.activity-activity.category'
_table = 'activity_category_rel'
activity = fields.Many2One('activity.activity', 'Activity', ondelete='CASCADE',
required=True, select=True)
required=True)
category = fields.Many2One('activity.category', 'Category',
ondelete='CASCADE', required=True, select=True)
ondelete='CASCADE', required=True)