[MERGE] forward port of branch 7.0 up to 117b636

This commit is contained in:
Christophe Simonis 2015-09-25 14:56:58 +02:00
commit 504a04c823
5 changed files with 22 additions and 5 deletions

View File

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

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<data noupdate="1">
<record id="group_note_fancy" model="res.groups">
<field name="name">Notes / Fancy mode</field>

View File

@ -23,7 +23,6 @@
<record id="trans_confirmed_double_gt" model="workflow.transition">
<field name="act_from" ref="act_double_check"/>
<field name="act_to" ref="act_double_wait"/>
<field name="condition">amount_untaxed &gt;= 5000</field>
<field name="signal">purchase_approve</field>
<field name="group_id" ref="purchase.group_purchase_manager"/>
</record>
@ -31,7 +30,6 @@
<record id="trans_confirmed_double_lt" model="workflow.transition">
<field name="act_from" ref="act_double_check"/>
<field name="act_to" ref="act_double_wait"/>
<field name="condition">amount_untaxed &lt; 5000</field>
</record>
<record id="trans_double_app_conf" model="workflow.transition">
@ -40,4 +38,12 @@
</record>
</data>
<data noupdate="1">
<record id="trans_confirmed_double_gt" model="workflow.transition">
<field name="condition">amount_untaxed &gt;= 5000</field>
</record>
<record id="trans_confirmed_double_lt" model="workflow.transition">
<field name="condition">amount_untaxed &lt; 5000</field>
</record>
</data>
</openerp>

View File

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

View File

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