From 3babd28aa86a905813089ce3bb95fab9b2a8cdfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 3 Mar 2016 21:53:51 +0100 Subject: [PATCH] Follow PEP-0249 for Transaction and backends issue4949 review19781002 --- product.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/product.py b/product.py index 009ac1d39b..8ddf3a9af6 100644 --- a/product.py +++ b/product.py @@ -5,7 +5,6 @@ import copy from trytond.model import ModelSQL, fields from trytond.pyson import Eval, Or from trytond import backend -from trytond.transaction import Transaction from trytond.pool import PoolMeta, Pool __all__ = ['Category', 'CategoryCustomerTax', 'CategorySupplierTax', @@ -152,9 +151,8 @@ class CategoryCustomerTax(ModelSQL): @classmethod def __register__(cls, module_name): TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor # Migration from 1.6 product renamed into category - table = TableHandler(cursor, cls) + table = TableHandler(cls) if table.column_exist('product'): table.index_action('product', action='remove') table.drop_fk('product') @@ -174,9 +172,8 @@ class CategorySupplierTax(ModelSQL): @classmethod def __register__(cls, module_name): TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor # Migration from 1.6 product renamed into category - table = TableHandler(cursor, cls) + table = TableHandler(cls) if table.column_exist('product'): table.index_action('product', action='remove') table.drop_fk('product')