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')