From 4bfa58acd97e08d810ec9675902bdf8ca33d22c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 3 Mar 2016 21:54:39 +0100 Subject: [PATCH] Follow PEP-0249 for Transaction and backends issue4949 review19781002 --- dashboard.py | 4 +--- res.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dashboard.py b/dashboard.py index f3805831dc..e575dc41ed 100644 --- a/dashboard.py +++ b/dashboard.py @@ -4,7 +4,6 @@ from sql import Null from sql.conditionals import Case from trytond.model import ModelView, ModelSQL, fields -from trytond.transaction import Transaction from trytond import backend from trytond.pyson import Eval @@ -37,8 +36,7 @@ class DashboardAction(ModelSQL, ModelView): @classmethod def __register__(cls, module_name): TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor - table = TableHandler(cursor, cls, module_name) + table = TableHandler(cls, module_name) super(DashboardAction, cls).__register__(module_name) diff --git a/res.py b/res.py index 99a8c0b050..10712a121b 100644 --- a/res.py +++ b/res.py @@ -2,7 +2,6 @@ # this repository contains the full copyright notices and license terms. from trytond.model import fields from trytond import backend -from trytond.transaction import Transaction from trytond.pool import PoolMeta __all__ = ['User'] @@ -32,11 +31,10 @@ class User: @classmethod def __register__(cls, module_name): TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor super(User, cls).__register__(module_name) - table = TableHandler(cursor, cls, module_name) + table = TableHandler(cls, module_name) # Migration from 1.6 table.not_null_action('dashboard_layout', action='remove')