changeset 01c131617c22 in modules/product:default
details: https://hg.tryton.org/modules/product?cmd=changeset;node=01c131617c22
description:
        Use direct access to backend classes

        issue8836
        review258421002
diffstat:

 configuration.py |   3 +--
 product.py       |  11 ++++-------
 2 files changed, 5 insertions(+), 9 deletions(-)

diffs (56 lines):

diff -r a5173d0562ed -r 01c131617c22 configuration.py
--- a/configuration.py  Wed Dec 04 11:09:36 2019 +0100
+++ b/configuration.py  Fri Dec 06 17:33:46 2019 +0100
@@ -46,8 +46,7 @@
 
     @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 -r a5173d0562ed -r 01c131617c22 product.py
--- a/product.py        Wed Dec 04 11:09:36 2019 +0100
+++ b/product.py        Fri Dec 06 17:33:46 2019 +0100
@@ -412,8 +412,7 @@
 
     @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 @@
     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 @@
     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)
 

Reply via email to