From 75eb02135f8b8b08528ddc7e80fc4c1601ddff2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 24 Jul 2018 22:01:07 +0200 Subject: [PATCH] Add __table_handler__ to ModelSQL issue7581 review48531002 --- product.py | 2 +- stock.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/product.py b/product.py index 9d2241c4b0..4a412d6080 100644 --- a/product.py +++ b/product.py @@ -53,7 +53,7 @@ class CategoryAccount(metaclass=PoolMeta): TableHandler = backend.get('TableHandler') exist = TableHandler.table_exist(cls._table) if exist: - table = TableHandler(cls, module_name) + table = cls.__table_handler__(module_name) exist &= table.column_exist('account_cogs') super(CategoryAccount, cls).__register__(module_name) diff --git a/stock.py b/stock.py index abf4352cf9..9a97638c3c 100644 --- a/stock.py +++ b/stock.py @@ -4,7 +4,6 @@ from decimal import Decimal from trytond.model import fields, Check from trytond.pool import Pool, PoolMeta from trytond.transaction import Transaction -from trytond import backend __all__ = ['Move'] @@ -42,10 +41,9 @@ class Move(metaclass=PoolMeta): @classmethod def __register__(cls, module_name): cursor = Transaction().connection.cursor() - TableHandler = backend.get('TableHandler') super(Move, cls).__register__(module_name) - table = TableHandler(cls, module_name) + table = cls.__table_handler__(module_name) # Migration from 2.8: split anglo_saxon_quantity if table.column_exist('anglo_saxon_quantity'):