Follow PEP-0249 for Transaction and backends
issue4949 review19781002
This commit is contained in:
1 parent
134acffc61
commit
4bfa58acd9
2 files changed
+2
-6
No files matched your search
+1
-3
@@ -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)
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user