[MERGE] forward port branch saas-15 up to a6900c43b4

This commit is contained in:
Christophe Simonis
2017-07-31 14:09:34 +02:00
5 changed files with 19 additions and 4 deletions
@@ -30,5 +30,6 @@ class ResPartner(models.Model):
if partner_id: # Modifying existing partner
self.browse(partner_id).write(partner)
else:
partner['lang'] = self.env.user.lang
partner_id = self.create(partner).id
return partner_id
+1 -1
View File
@@ -552,7 +552,7 @@ class StockMove(models.Model):
(move.picking_id.picking_type_id.use_existing_lots or move.picking_id.picking_type_id.use_create_lots) and \
move.product_id.tracking != 'none' and \
not (move.restrict_lot_id or (pack_operation and (pack_operation.product_id and pack_operation.pack_lot_ids)) or (pack_operation and not pack_operation.product_id)):
raise UserError(_('You need to provide a Lot/Serial Number for product %s') % move.product_id.name)
raise UserError(_('You need to provide a Lot/Serial Number for product %s') % ("%s (%s)" % (move.product_id.name, move.picking_id.name)))
@api.multi
def action_assign(self, no_prepare=False):
+2 -2
View File
@@ -1012,8 +1012,8 @@ class Binary(http.Controller):
elif status != 200 and download:
return request.not_found()
height = int(height)
width = int(width)
height = int(height or 0)
width = int(width or 0)
if content and (width or height):
# resize maximum 500*500
if width > 500:
+4 -1
View File
@@ -371,7 +371,10 @@ class Slide(models.Model):
if slide.id: # avoid to perform a slug on a not yet saved record in case of an onchange.
# link_tracker is not in dependencies, so use it to shorten url only if installed.
if self.env.registry.get('link.tracker'):
url = self.env['link.tracker'].sudo().create({'url': '%s/slides/slide/%s' % (base_url, slug(slide))}).short_url
url = self.env['link.tracker'].sudo().create({
'url': '%s/slides/slide/%s' % (base_url, slug(slide)),
'title': slide.name,
}).short_url
else:
url = '%s/slides/slide/%s' % (base_url, slug(slide))
slide.website_url = url
+11
View File
@@ -21,6 +21,8 @@ import threading
import traceback
import time
from psycopg2 import ProgrammingError, errorcodes
import odoo
from . import Command
@@ -136,6 +138,15 @@ def main(args):
for db_name in preload:
try:
odoo.service.db._create_empty_database(db_name)
except ProgrammingError as err:
if err.pgcode == errorcodes.INSUFFICIENT_PRIVILEGE:
# We use an INFO loglevel on purpose in order to avoid
# reporting unnecessary warnings on build environment
# using restricted database access.
_logger.info("Could not determine if database %s exists, "
"skipping auto-creation: %s", db_name, err)
else:
raise err
except odoo.service.db.DatabaseExists:
pass