From 2e7c4e740ebdce5034a3af93657546d1fec9ab0e 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 --- purchase_request.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/purchase_request.py b/purchase_request.py index 9f1fdfaadc..d52cb3cca7 100644 --- a/purchase_request.py +++ b/purchase_request.py @@ -5,7 +5,6 @@ from decimal import Decimal from itertools import groupby from functools import partial -from trytond import backend from trytond.model import ModelView, ModelSQL, fields from trytond.wizard import Wizard, StateView, StateTransition, Button from trytond.pyson import If, In, Eval, Bool @@ -105,19 +104,18 @@ class PurchaseRequest(ModelSQL, ModelView): ModelData = pool.get('ir.model.data') Purchase = pool.get('purchase.purchase') PurchaseLine = pool.get('purchase.line') - TableHandler = backend.get('TableHandler') model_data = ModelData.__table__() purchase = Purchase.__table__() purchase_line = PurchaseLine.__table__() request = cls.__table__() - tablehandler = TableHandler(cls, module_name) + tablehandler = cls.__table_handler__(module_name) state_exist = tablehandler.column_exist('state') super(PurchaseRequest, cls).__register__(module_name) # Migration from 3.6: removing the constraint on the quantity - tablehandler = TableHandler(cls, module_name) + tablehandler = cls.__table_handler__(module_name) tablehandler.drop_constraint('check_purchase_request_quantity') # Migration from 3.8: renaming module of Purchase Request group entry