From 65915d80a3607326dc6226cd61a14125aea494b3 Mon Sep 17 00:00:00 2001 From: Jared Esparza Date: Thu, 30 Sep 2021 09:25:05 +0200 Subject: [PATCH] Fix table handler use --- animal.py | 3 +-- stock.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/animal.py b/animal.py index 4940868..88d388e 100644 --- a/animal.py +++ b/animal.py @@ -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( diff --git a/stock.py b/stock.py index 961dd27..1046fd1 100644 --- a/stock.py +++ b/stock.py @@ -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(