changeset e1bf5df1b996 in modules/purchase:default
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=e1bf5df1b996
description:
Use direct access to backend classes
issue8836
review258421002
diffstat:
configuration.py | 6 ++----
purchase.py | 7 +++----
2 files changed, 5 insertions(+), 8 deletions(-)
diffs (47 lines):
diff -r 54b794918a9d -r e1bf5df1b996 configuration.py
--- a/configuration.py Wed Dec 04 11:09:36 2019 +0100
+++ b/configuration.py Fri Dec 06 17:33:46 2019 +0100
@@ -75,8 +75,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(ConfigurationSequence, cls).__register__(module_name)
@@ -110,8 +109,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(ConfigurationPurchaseMethod, cls).__register__(module_name)
diff -r 54b794918a9d -r e1bf5df1b996 purchase.py
--- a/purchase.py Wed Dec 04 11:09:36 2019 +0100
+++ b/purchase.py Fri Dec 06 17:33:46 2019 +0100
@@ -278,7 +278,6 @@
PurchaseLine = pool.get('purchase.line')
Move = pool.get('stock.move')
InvoiceLine = pool.get('account.invoice.line')
- TableHandler = backend.get('TableHandler')
cursor = Transaction().connection.cursor()
sql_table = cls.__table__()
@@ -294,9 +293,9 @@
# Migration from 3.2
# state confirmed splitted into confirmed and processing
- if (TableHandler.table_exist(PurchaseLine._table)
- and TableHandler.table_exist(Move._table)
- and TableHandler.table_exist(InvoiceLine._table)):
+ if (backend.TableHandler.table_exist(PurchaseLine._table)
+ and backend.TableHandler.table_exist(Move._table)
+ and backend.TableHandler.table_exist(InvoiceLine._table)):
purchase_line = PurchaseLine.__table__()
move = Move.__table__()
invoice_line = InvoiceLine.__table__()