From 9b6f5dca9a63230ae45e16a25c4acc54dd54b65b Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 1 Jul 2013 18:35:32 +0200 Subject: [PATCH] [FIX] procurement: background procurement scheduler should be working in batch mode, with one transaction per order A programming error during an older refactoring lead to the scheduler working with a single monolithic transaction. This could cause unnecessary resource contention, plus undesired rollback of all previous operations in the event of an exception during scheduling. bzr revid: odo@openerp.com-20130701163532-8bekn7sbb99ua08c --- addons/procurement/procurement_data.xml | 2 +- addons/procurement/schedulers.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/procurement/procurement_data.xml b/addons/procurement/procurement_data.xml index 6a83d525c68..52503e76c44 100644 --- a/addons/procurement/procurement_data.xml +++ b/addons/procurement/procurement_data.xml @@ -12,7 +12,7 @@ - + diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py index 6bc1b6fc0c2..07280b38ae7 100644 --- a/addons/procurement/schedulers.py +++ b/addons/procurement/schedulers.py @@ -36,6 +36,8 @@ class procurement_order(osv.osv): ''' Runs through scheduler. @param use_new_cursor: False or the dbname ''' + if use_new_cursor: + use_new_cursor = cr.dbname self._procure_confirm(cr, uid, use_new_cursor=use_new_cursor, context=context) self._procure_orderpoint_confirm(cr, uid, automatic=automatic,\ use_new_cursor=use_new_cursor, context=context)