From 273114204f4653096ec8fcea15f33642f7c733ba Mon Sep 17 00:00:00 2001 From: Laetitia Gangloff Date: Thu, 11 Dec 2014 15:26:23 +0100 Subject: [PATCH 1/5] [FIX] note: `Use fancy note` was re-checked on update Set security group as not updatable. To be able to not use fancy note Closes #4178 --- addons/note/security/note_security.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 34f79f3de7578619951c7bcba485b5c3c1d9cce0 Mon Sep 17 00:00:00 2001 From: Laetitia Gangloff Date: Thu, 24 Sep 2015 17:57:40 +0200 Subject: [PATCH 2/5] [FIX] purchase_double_validation: do not update limit on module update In the module `purchase_double_validation`, you can change the limit to require a second approval in the purchase settings. If the module was updated, the limit was re-set to its default value. Closes #4183 --- .../purchase_double_validation_workflow.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 + + From be33912a2580779d747c504e16580065e496c884 Mon Sep 17 00:00:00 2001 From: Pierre Verkest Date: Thu, 24 Sep 2015 18:05:23 +0200 Subject: [PATCH 3/5] [FIX] report_webkit: get webkit path as SUPERUSER_ID `ir.config_parameter` is readable by employees only. It could happen to print a webkit report as a portal / public user. Closes #4181 --- addons/report_webkit/webkit_report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index cccaec76bc3..ab2ae27e4e6 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -48,6 +48,7 @@ from openerp import pooler from report_helper import WebKitHelper from openerp.report.report_sxw import * from openerp import addons +from openerp import SUPERUSER_ID from openerp import tools from openerp.tools.translate import _ from openerp.osv.osv import except_osv @@ -76,7 +77,7 @@ class WebKitParser(report_sxw): def get_lib(self, cursor, uid): """Return the lib wkhtml path""" proxy = self.pool.get('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: From fc11b58239f4097be907be3ad41b1c0757b00e7a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 12 Dec 2014 12:21:35 +0100 Subject: [PATCH 4/5] [FIX] stock: service lines duplication when grouping DO invoices This is possible that changes happen during the loop in the multiple pickings: an update in a picking could update another picking. The browse must therefore be done inside the loop to update the pickings with the latest changes. Fixes #4201 --- addons/stock/stock.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 276e24b4e2d..7fa2f4e92a2 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1132,7 +1132,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) From 117b636d3fdcc32b1e430d41d245a7d8237ca87f Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 25 Sep 2015 14:43:00 +0200 Subject: [PATCH 5/5] [FIX] mail: catch database errors when sending mails --- addons/mail/mail_mail.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 19852e1b182..aa02654ef58 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.osv import fields, osv @@ -338,6 +340,12 @@ class mail_mail(osv.Model): # prevent catching transient MemoryErrors, bubble up to notify user or abort cron job # instead of marking the mail as failed 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: _logger.exception('failed sending mail.mail %s', mail.id) mail.write({'state': 'exception'})