From fff66c9b7aad4f8883dfb5cc0e8347669f03d8be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Fri, 6 Dec 2019 17:33:46 +0100 Subject: [PATCH] Use direct access to backend classes issue8836 review258421002 --- configuration.py | 3 +-- product.py | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/configuration.py b/configuration.py index 5eeca5c24d..6f509b2482 100644 --- a/configuration.py +++ b/configuration.py @@ -46,8 +46,7 @@ class ConfigurationDefaultCostPriceMethod(ModelSQL, ValueMixin): @classmethod def __register__(cls, module_name): - TableHandler = backend.get('TableHandler') - exist = TableHandler.table_exist(cls._table) + exist = backend.TableHandler.table_exist(cls._table) super(ConfigurationDefaultCostPriceMethod, cls).__register__( module_name) diff --git a/product.py b/product.py index 430e4e1218..8c6d45a86b 100644 --- a/product.py +++ b/product.py @@ -412,8 +412,7 @@ class ProductListPrice(ModelSQL, CompanyValueMixin): @classmethod def __register__(cls, module_name): - TableHandler = backend.get('TableHandler') - exist = TableHandler.table_exist(cls._table) + exist = backend.TableHandler.table_exist(cls._table) super(ProductListPrice, cls).__register__(module_name) @@ -442,13 +441,12 @@ class ProductCostPriceMethod(ModelSQL, CompanyValueMixin): def __register__(cls, module_name): pool = Pool() ProductCostPrice = pool.get('product.cost_price') - TableHandler = backend.get('TableHandler') sql_table = cls.__table__() cost_price = ProductCostPrice.__table__() cursor = Transaction().connection.cursor() - exist = TableHandler.table_exist(cls._table) - cost_price_exist = TableHandler.table_exist(ProductCostPrice._table) + exist = backend.TableHandler.table_exist(cls._table) + cost_price_exist = backend.TableHandler.table_exist(ProductCostPrice._table) super(ProductCostPriceMethod, cls).__register__(module_name) @@ -497,12 +495,11 @@ class ProductCostPrice(ModelSQL, CompanyValueMixin): def __register__(cls, module_name): pool = Pool() Product = pool.get('product.product') - TableHandler = backend.get('TableHandler') sql_table = cls.__table__() product = Product.__table__() cursor = Transaction().connection.cursor() - exist = TableHandler.table_exist(cls._table) + exist = backend.TableHandler.table_exist(cls._table) super(ProductCostPrice, cls).__register__(module_name)