Add __table_handler__ to ModelSQL

issue7581
review48531002
This commit is contained in:
Cédric Krier committed 2018-07-24 22:01:08 +02:00
1 parent 7b5e4ffc86
commit 4ae43cdc3d
2 files changed
+3 -8

No files matched your search

+2 -4
View File
@@ -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')
+1 -4
View File
@@ -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')