From 4ae43cdc3d43954d3468182b9dc647a2920f84ed 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 --- dashboard.py | 6 ++---- res.py | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/dashboard.py b/dashboard.py index cdd96b837b..7f1b01dedc 100644 --- a/dashboard.py +++ b/dashboard.py @@ -1,7 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. from trytond.model import ModelView, ModelSQL, fields, sequence_ordered -from trytond import backend from trytond.pyson import Eval __all__ = ['DashboardAction'] @@ -26,10 +25,9 @@ class DashboardAction(sequence_ordered(), ModelSQL, ModelView): @classmethod def __register__(cls, module_name): - TableHandler = backend.get('TableHandler') - table = TableHandler(cls, module_name) - super(DashboardAction, cls).__register__(module_name) + table = cls.__table_handler__(module_name) + # Migration from 2.4: drop required on sequence table.not_null_action('sequence', action='remove') diff --git a/res.py b/res.py index 297a9e81a2..dce60c35ad 100644 --- a/res.py +++ b/res.py @@ -1,7 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. from trytond.model import fields -from trytond import backend from trytond.pool import PoolMeta __all__ = ['User'] @@ -29,11 +28,9 @@ class User(metaclass=PoolMeta): @classmethod def __register__(cls, module_name): - TableHandler = backend.get('TableHandler') - super(User, cls).__register__(module_name) - table = TableHandler(cls, module_name) + table = cls.__table_handler__(module_name) # Migration from 1.6 table.not_null_action('dashboard_layout', action='remove')