[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 urllib import urlencode
from urlparse import urljoin from urlparse import urljoin
import psycopg2
from openerp import tools from openerp import tools
from openerp import SUPERUSER_ID from openerp import SUPERUSER_ID
from openerp.addons.base.ir.ir_mail_server import MailDeliveryException 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', 'Consider raising the --limit-memory-hard startup option',
mail.id, mail.message_id) mail.id, mail.message_id)
raise 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: except Exception as e:
_logger.exception('failed sending mail.mail %s', mail.id) _logger.exception('failed sending mail.mail %s', mail.id)
mail.write({'state': 'exception'}) mail.write({'state': 'exception'})

View File

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

View File

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

View File

@ -43,6 +43,7 @@ from report_helper import WebKitHelper
import openerp import openerp
from openerp.modules.module import get_module_resource from openerp.modules.module import get_module_resource
from openerp.report.report_sxw import * from openerp.report.report_sxw import *
from openerp import SUPERUSER_ID
from openerp import tools from openerp import tools
from openerp.tools.translate import _ from openerp.tools.translate import _
from openerp.osv.osv import except_osv from openerp.osv.osv import except_osv
@ -127,7 +128,7 @@ class WebKitParser(report_sxw):
def get_lib(self, cursor, uid): def get_lib(self, cursor, uid):
"""Return the lib wkhtml path""" """Return the lib wkhtml path"""
proxy = self.pool['ir.config_parameter'] 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: if not webkit_path:
try: try:

View File

@ -1126,7 +1126,9 @@ class stock_picking(osv.osv):
invoices_group = {} invoices_group = {}
res = {} res = {}
inv_type = type 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': if picking.invoice_state != '2binvoiced':
continue continue
partner = self._get_partner_to_invoice(cr, uid, picking, context=context) partner = self._get_partner_to_invoice(cr, uid, picking, context=context)