[MERGE] forward port of branch saas-3 up to 474eae9a43ad7860f11f1d3c1cb8c587eeb98412
authorDenis Ledoux <dle@odoo.com>
Wed, 23 Jul 2014 10:14:14 +0000 (12:14 +0200)
committerDenis Ledoux <dle@odoo.com>
Wed, 23 Jul 2014 10:14:14 +0000 (12:14 +0200)
1  2 
addons/crm/crm_phonecall.py
addons/procurement/wizard/schedulers_all.py
addons/website_sale/controllers/main.py
addons/website_sale/views/website_sale.xml

Simple merge
@@@ -45,7 -49,17 +49,17 @@@ class procurement_compute_all(osv.osv_m
          """
          proc_obj = self.pool.get('procurement.order')
          #As this function is in a new thread, i need to open a new cursor, because the old one may be closed
 -        new_cr = pooler.get_db(cr.dbname).cursor()
 +        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'):
+                 new_cr.execute("SELECT id FROM ir_cron WHERE id = %s FOR UPDATE NOWAIT", (scheduler_cron_id,))
+         except Exception:
+             _logger.info('Attempt to run procurement scheduler aborted, as already running')
+             new_cr.rollback()
+             new_cr.close()
+             return {}
          for proc in self.browse(new_cr, uid, ids, context=context):
              proc_obj.run_scheduler(new_cr, uid, automatic=proc.automatic, use_new_cursor=new_cr.dbname,\
                      context=context)
@@@ -707,15 -707,14 +707,15 @@@ class Ecommerce(http.Controller)
              tx = request.registry['payment.transaction'].browse(cr, uid, tx_ids[0], context=context)
              state = tx.state
              if state == 'done':
-                 message = '<p>Your payment has been received.</p>'
+                 message = '<p>%s</p>' % _('Your payment has been received.')
              elif state == 'cancel':
-                 message = '<p>The payment seems to have been canceled.</p>'
+                 message = '<p>%s</p>' % _('The payment seems to have been canceled.')
              elif state == 'pending' and tx.acquirer_id.validation == 'manual':
-                 message = '<p>Your transaction is waiting confirmation.</p>'
+                 message = '<p>%s</p>' % _('Your transaction is waiting confirmation.')
 -                message += tx.acquirer_id.post_msg
 +                if tx.acquirer_id.post_msg:
 +                    message += tx.acquirer_id.post_msg
              else:
-                 message = '<p>Your transaction is waiting confirmation.</p>'
+                 message = '<p>%s</p>' % _('Your transaction is waiting confirmation.')
              validation = tx.acquirer_id.validation
  
          return {