From 23d9c673493307cba9efd7d5cb7280aec771e2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 3 Mar 2016 21:56:03 +0100 Subject: [PATCH] Follow PEP-0249 for Transaction and backends issue4949 review19781002 --- company.py | 3 +-- timesheet.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/company.py b/company.py index 1575a1986a..1872a0c48b 100644 --- a/company.py +++ b/company.py @@ -82,9 +82,8 @@ class EmployeeCostPrice(ModelSQL, ModelView): @classmethod def __register__(cls, module_name): TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor super(EmployeeCostPrice, cls).__register__(module_name) - table = TableHandler(cursor, cls, module_name) + table = TableHandler(cls, module_name) # Migration from 2.8 drop date_cost_price_uniq table.drop_constraint('date_cost_price_uniq') diff --git a/timesheet.py b/timesheet.py index 6f5dbd9ab0..bdbc7b078e 100644 --- a/timesheet.py +++ b/timesheet.py @@ -25,9 +25,9 @@ class TimesheetLine: Employee = pool.get('company.employee') TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor + cursor = Transaction().connection.cursor() table = cls.__table__() - table_h = TableHandler(cursor, cls, module_name) + table_h = TableHandler(cls, module_name) migrate_cost_price = not table_h.column_exist('cost_price')