book: remove lef/right-fields

This commit is contained in:
Frederik Jaeckel 2023-01-26 23:07:01 +01:00
parent f5eef66f78
commit 984aab168a

15
book.py
View file

@ -144,12 +144,9 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView):
state_string = state.translated('state')
parent = fields.Many2One(string="Parent",
model_name='cashbook.book', ondelete='RESTRICT',
left='left', right='right')
model_name='cashbook.book', ondelete='RESTRICT')
childs = fields.One2Many(string='Children', field='parent',
model_name='cashbook.book')
left = fields.Integer(string='Left', required=True, select=True)
right = fields.Integer(string='Right', required=True, select=True)
@classmethod
def __register__(cls, module_name):
@ -157,6 +154,8 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView):
table = cls.__table_handler__(module_name)
table.drop_column('start_balance')
table.drop_column('left')
table.drop_column('right')
@classmethod
def __setup__(cls):
@ -189,14 +188,6 @@ class Book(tree(separator='/'), Workflow, ModelSQL, ModelView):
},
})
@staticmethod
def default_left():
return 0
@staticmethod
def default_right():
return 0
@classmethod
def default_number_atcheck(cls):
return True