From a5c1dde783cc811be045ed4e271c9024d19aa06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 24 Jul 2018 22:01:07 +0200 Subject: [PATCH] Add __table_handler__ to ModelSQL issue7581 review48531002 --- asset.py | 4 +--- product.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/asset.py b/asset.py index 717531d646..c41138a97f 100644 --- a/asset.py +++ b/asset.py @@ -16,7 +16,6 @@ from trytond.wizard import (Wizard, StateView, StateTransition, StateReport, Button) from trytond.tools import grouped_slice from trytond.modules.company import CompanyReport -from trytond import backend __all__ = ['Asset', 'AssetLine', 'AssetUpdateMove', 'CreateMovesStart', 'CreateMoves', @@ -210,8 +209,7 @@ class Asset(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/product.py b/product.py index b6ee44e34a..6d6b2b58bc 100644 --- a/product.py +++ b/product.py @@ -76,7 +76,7 @@ class CategoryAccount(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('account_depreciation') and table.column_exist('account_asset'))