From 35b9ebdd1842eee92fef790fd94af776276dfa58 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 --- forecast.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/forecast.py b/forecast.py index b158f51bd7..ab4525bccc 100644 --- a/forecast.py +++ b/forecast.py @@ -12,7 +12,6 @@ from sql.conditionals import Coalesce from trytond.model import ModelView, Workflow, ModelSQL, fields, Check, Unique from trytond.wizard import Wizard, StateView, StateTransition, Button from trytond.pyson import Not, Equal, Eval, Or, Bool, If -from trytond import backend from trytond.transaction import Transaction from trytond.pool import Pool from trytond.tools import reduce_ids, grouped_slice @@ -108,18 +107,17 @@ class Forecast(Workflow, ModelSQL, ModelView): @classmethod def __register__(cls, module_name): Location = Pool().get('stock.location') - TableHandler = backend.get('TableHandler') cursor = Transaction().connection.cursor() sql_table = cls.__table__() - table = TableHandler(cls, module_name) + table = cls.__table_handler__(module_name) migrate_warehouse = (not table.column_exist('warehouse') and table.column_exist('location')) super(Forecast, cls).__register__(module_name) # Add index on create_date - table = TableHandler(cls, module_name) + table = cls.__table_handler__(module_name) table.index_action('create_date', action='add') if migrate_warehouse: