remove left/right from category

This commit is contained in:
Frederik Jaeckel 2023-02-10 19:38:32 +01:00
parent 2d6f034a17
commit 610532f6a5
3 changed files with 4 additions and 44 deletions

View file

@ -39,16 +39,16 @@ class Category(tree(separator='/'), ModelSQL, ModelView):
company = fields.Many2One(string='Company', model_name='company.company',
required=True, ondelete="RESTRICT")
parent = fields.Many2One(string="Parent",
model_name='cashbook.category', ondelete='RESTRICT',
left='left', right='right')
model_name='cashbook.category', ondelete='RESTRICT')
childs = fields.One2Many(string='Children', field='parent',
model_name='cashbook.category')
left = fields.Integer(string='Left', required=True, select=True)
right = fields.Integer(string='Right', required=True, select=True)
@classmethod
def __register__(cls, module_name):
super(Category, cls).__register__(module_name)
table = cls.__table_handler__(module_name)
table.drop_column('left')
table.drop_column('right')
cls.migrate_sequence(module_name)
@classmethod
@ -83,14 +83,6 @@ class Category(tree(separator='/'), ModelSQL, ModelView):
def default_company():
return Transaction().context.get('company') or None
@staticmethod
def default_left():
return 0
@staticmethod
def default_right():
return 0
@staticmethod
def order_rec_name(tables):
""" order by pos