diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 084b8d796fb..556d66cf447 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -26,6 +26,8 @@ from email.utils import formataddr from urllib import urlencode from urlparse import urljoin +import psycopg2 + from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.base.ir.ir_mail_server import MailDeliveryException @@ -318,6 +320,12 @@ class mail_mail(osv.Model): 'Consider raising the --limit-memory-hard startup option', mail.id, mail.message_id) raise + except psycopg2.Error: + # If an error with the database occurs, chances are that the cursor is unusable. + # This will lead to an `psycopg2.InternalError` being raised when trying to write + # `state`, shadowing the original exception and forbid a retry on concurrent + # update. Let's bubble it. + raise except Exception as e: _logger.exception('failed sending mail.mail %s', mail.id) mail.write({'state': 'exception'}) diff --git a/addons/note/security/note_security.xml b/addons/note/security/note_security.xml index 8fedb29ea2e..c4933e89dbb 100644 --- a/addons/note/security/note_security.xml +++ b/addons/note/security/note_security.xml @@ -1,6 +1,6 @@ - + Notes / Fancy mode diff --git a/addons/purchase_double_validation/purchase_double_validation_workflow.xml b/addons/purchase_double_validation/purchase_double_validation_workflow.xml index 673063ff049..9c9cd7c9359 100644 --- a/addons/purchase_double_validation/purchase_double_validation_workflow.xml +++ b/addons/purchase_double_validation/purchase_double_validation_workflow.xml @@ -23,7 +23,6 @@ - amount_untaxed >= 5000 purchase_approve @@ -31,7 +30,6 @@ - amount_untaxed < 5000 @@ -40,4 +38,12 @@ + + + amount_untaxed >= 5000 + + + amount_untaxed < 5000 + + diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 53fe353f898..6024ec34c6d 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -43,6 +43,7 @@ from report_helper import WebKitHelper import openerp from openerp.modules.module import get_module_resource from openerp.report.report_sxw import * +from openerp import SUPERUSER_ID from openerp import tools from openerp.tools.translate import _ from openerp.osv.osv import except_osv @@ -127,7 +128,7 @@ class WebKitParser(report_sxw): def get_lib(self, cursor, uid): """Return the lib wkhtml path""" proxy = self.pool['ir.config_parameter'] - webkit_path = proxy.get_param(cursor, uid, 'webkit_path') + webkit_path = proxy.get_param(cursor, SUPERUSER_ID, 'webkit_path') if not webkit_path: try: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index b3e9d951673..49ee9cf3c61 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1126,7 +1126,9 @@ class stock_picking(osv.osv): invoices_group = {} res = {} inv_type = type - for picking in self.browse(cr, uid, ids, context=context): + for picking_id in ids: + # The browse inside the loop is done on purpose, as a change in the pickings during the loop is possible + picking = self.browse(cr, uid, picking_id, context=context) if picking.invoice_state != '2binvoiced': continue partner = self._get_partner_to_invoice(cr, uid, picking, context=context)