From 11ad2fcde6b84df1d8e764ccb083683b163dc814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 24 Jul 2018 22:01:08 +0200 Subject: [PATCH] Add __table_handler__ to ModelSQL issue7581 review48531002 --- complaint.py | 4 +--- sale.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/complaint.py b/complaint.py index 3bad7ca798..d2fd85aaf9 100644 --- a/complaint.py +++ b/complaint.py @@ -7,7 +7,6 @@ from trytond.model import ModelSQL, ModelView, Workflow, fields from trytond.pyson import Eval, If, Bool from trytond.pool import Pool from trytond.transaction import Transaction -from trytond import backend from trytond.modules.product import price_digits @@ -140,8 +139,7 @@ class Complaint(Workflow, ModelSQL, ModelView): @classmethod def __register__(cls, module_name): - TableHandler = backend.get('TableHandler') - table_h = TableHandler(cls, module_name) + table_h = cls.__table_handler__(module_name) # Migration from 3.8: rename reference into number if (table_h.column_exist('reference') diff --git a/sale.py b/sale.py index b58fd52a69..7e305ba263 100644 --- a/sale.py +++ b/sale.py @@ -48,7 +48,7 @@ class ConfigurationSequence(metaclass=PoolMeta): TableHandler = backend.get('TableHandler') exist = TableHandler.table_exist(cls._table) if exist: - table = TableHandler(cls, module_name) + table = cls.__table_handler__(module_name) exist &= table.column_exist('complaint_sequence') super(ConfigurationSequence, cls).__register__(module_name)