[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
This commit is contained in:
Olivier Dony 2013-07-01 18:35:32 +02:00
parent 00c1c134fc
commit 9b6f5dca9a
2 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,7 @@
<field eval="False" name="doall"/>
<field eval="'procurement.order'" name="model"/>
<field eval="'run_scheduler'" name="function"/>
<field eval="'(False,)'" name="args"/>
<field eval="'(False,True)'" name="args"/>
</record>
<record id="sequence_mrp_op_type" model="ir.sequence.type">

View File

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