From 34f647b7c91215477d8d59e47feb0810d82c3dcf Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Thu, 26 Jan 2023 23:07:01 +0100 Subject: [PATCH] book: remove lef/right-fields --- book.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/book.py b/book.py index 3493698..cb949af 100644 --- a/book.py +++ b/book.py @@ -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