Fix table handler use

This commit is contained in:
Jared Esparza 2021-09-30 09:25:05 +02:00
parent 918da270db
commit 65915d80a3
2 changed files with 2 additions and 4 deletions

View File

@ -222,7 +222,6 @@ class Animal(ModelSQL, ModelView, AnimalMixin):
@classmethod
def __register__(cls, module_name):
TableHandler = backend.get('TableHandler')
table = cls.__table_handler__(module_name)
sql_table = cls.__table__()
update_lot = False
@ -232,7 +231,7 @@ class Animal(ModelSQL, ModelView, AnimalMixin):
table = cls.__table_handler__(module_name)
if update_lot:
sql_table_animal_lot = 'stock_lot-farm_animal'
if TableHandler.table_exist(sql_table_animal_lot):
if table.table_exist(sql_table_animal_lot):
sql_table_animal_lot = Table(sql_table_animal_lot)
cursor = Transaction().connection.cursor()
cursor.execute(*sql_table_animal_lot.select(

View File

@ -45,7 +45,6 @@ class Lot(metaclass=PoolMeta):
@classmethod
def __register__(cls, module_name):
TableHandler = backend.get('TableHandler')
table = cls.__table_handler__(module_name)
sql_table = cls.__table__()
update_animal = False
@ -55,7 +54,7 @@ class Lot(metaclass=PoolMeta):
table = cls.__table_handler__(module_name)
if update_animal:
sql_table_animal_lot = 'stock_lot-farm_animal'
if TableHandler.table_exist(sql_table_animal_lot):
if table.table_exist(sql_table_animal_lot):
sql_table_animal_lot = Table(sql_table_animal_lot)
cursor = Transaction().connection.cursor()
cursor.execute(*sql_table_animal_lot.select(