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 88948f4461
commit 9550da40e0
1 file changed
+2 -4
+2 -4
View File
@@ -1,6 +1,5 @@
# 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 import backend
from trytond.model import ModelView, ModelSQL, fields
from trytond.pool import Pool
@@ -19,12 +18,11 @@ class Allocation(ModelSQL, ModelView):
@classmethod
def __register__(cls, module_name):
TableHandler = backend.get('TableHandler')
super(Allocation, cls).__register__(module_name)
table = cls.__table_handler__(module_name)
# Migration from 3.2:
table = TableHandler(cls, module_name)
table.drop_constraint('percentage_positive')
@staticmethod