[FIX] procurement: missing variable
authorMartin Trigaux <mat@openerp.com>
Mon, 4 Aug 2014 10:14:11 +0000 (12:14 +0200)
committerMartin Trigaux <mat@openerp.com>
Mon, 4 Aug 2014 12:43:28 +0000 (14:43 +0200)
scheduler_cron_id was not initialised so the scheduler always crashed (with just info message)

addons/procurement/wizard/schedulers_all.py

index 5d05291..1f5ed8f 100644 (file)
@@ -21,6 +21,7 @@
 
 import logging
 import threading
+from openerp import SUPERUSER_ID
 from openerp import tools
 
 from openerp.osv import osv
@@ -45,6 +46,7 @@ class procurement_compute_all(osv.osv_memory):
             #As this function is in a new thread, i need to open a new cursor, because the old one may be closed
 
             new_cr = self.pool.cursor()
+            scheduler_cron_id = self.pool['ir.model.data'].get_object_reference(new_cr, SUPERUSER_ID, 'procurement', 'ir_cron_scheduler_action')[1]
             # Avoid to run the scheduler multiple times in the same time
             try:
                 with tools.mute_logger('openerp.sql_db'):