Use direct access to backend classes.

This commit is contained in:
Juanjo Garcia 2019-12-11 11:16:18 +01:00
parent 9b3b8de717
commit 70fe0ec291

View file

@ -32,16 +32,15 @@ class Party(metaclass=PoolMeta):
@classmethod @classmethod
def __register__(cls, module_name): def __register__(cls, module_name):
TableHandler = backend.get('TableHandler')
cursor = Transaction().connection.cursor() cursor = Transaction().connection.cursor()
table = TableHandler(cls, module_name) table = backend.TableHandler(cls, module_name)
created_347 = table.column_exist('include_347') created_347 = table.column_exist('include_347')
super(Party, cls).__register__(module_name) super(Party, cls).__register__(module_name)
# We need to reload table as it may be modified by __register__ # We need to reload table as it may be modified by __register__
table = TableHandler(cls, module_name) table = backend.TableHandler(cls, module_name)
if (not created_347 and table.column_exist('include_347')): if (not created_347 and table.column_exist('include_347')):
sql_table = cls.__table__() sql_table = cls.__table__()
identifier = Pool().get('party.identifier').__table__() identifier = Pool().get('party.identifier').__table__()