From 3b2e4e1839559399ffac495532c8171d701a5f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 3 Mar 2016 21:55:43 +0100 Subject: [PATCH] Follow PEP-0249 for Transaction and backends issue4949 review19781002 --- forecast.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/forecast.py b/forecast.py index e33412bf16..67357ab356 100644 --- a/forecast.py +++ b/forecast.py @@ -103,17 +103,17 @@ class Forecast(Workflow, ModelSQL, ModelView): def __register__(cls, module_name): Location = Pool().get('stock.location') TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor + cursor = Transaction().connection.cursor() sql_table = cls.__table__() - table = TableHandler(cursor, cls, module_name) + table = TableHandler(cls, module_name) migrate_warehouse = (not table.column_exist('warehouse') and table.column_exist('location')) super(Forecast, cls).__register__(module_name) # Add index on create_date - table = TableHandler(cursor, cls, module_name) + table = TableHandler(cls, module_name) table.index_action('create_date', action='add') if migrate_warehouse: @@ -194,7 +194,7 @@ class Forecast(Workflow, ModelSQL, ModelView): forecast.check_date_overlap() def check_date_overlap(self): - cursor = Transaction().cursor + cursor = Transaction().connection.cursor() if self.state != 'done': return forcast = self.__table__() @@ -362,7 +362,7 @@ class ForecastLine(ModelSQL, ModelView): @classmethod def get_quantity_executed(cls, lines, name): - cursor = Transaction().cursor + cursor = Transaction().connection.cursor() pool = Pool() Move = pool.get('stock.move') Location = pool.get('stock.location')