diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py
index c5c664dcae3..67643c8754a 100644
--- a/addons/stock/models/stock_picking.py
+++ b/addons/stock/models/stock_picking.py
@@ -108,6 +108,15 @@ class PickingType(models.Model):
res.append((picking_type.id, name))
return res
+ @api.model
+ def name_search(self, name, args=None, operator='ilike', limit=100):
+ args = args or []
+ domain = []
+ if name:
+ domain = ['|', ('name', operator, name), ('warehouse_id.name', operator, name)]
+ picks = self.search(domain + args, limit=limit)
+ return picks.name_get()
+
@api.onchange('code')
def onchange_picking_code(self):
if self.code == 'incoming':
diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py
index a7774db59b1..0a4c9f47a9a 100644
--- a/addons/website/models/ir_http.py
+++ b/addons/website/models/ir_http.py
@@ -132,14 +132,13 @@ class ir_http(orm.AbstractModel):
langs = [lg[0] for lg in request.website.get_languages()]
path = request.httprequest.path.split('/')
if first_pass:
+ is_a_bot = self.is_a_bot()
nearest_lang = not func and self.get_nearest_lang(path[1])
url_lang = nearest_lang and path[1]
preferred_lang = ((cook_lang if cook_lang in langs else False)
- or self.get_nearest_lang(request.lang)
+ or (not is_a_bot and self.get_nearest_lang(request.lang))
or request.website.default_lang_code)
- is_a_bot = self.is_a_bot()
-
request.lang = request.context['lang'] = nearest_lang or preferred_lang
# if lang in url but not the displayed or default language --> change or remove
# or no lang in url, and lang to dispay not the default language --> add lang
diff --git a/addons/website_event/views/website_event_templates.xml b/addons/website_event/views/website_event_templates.xml
index 43427b3be22..fb38962b3f4 100644
--- a/addons/website_event/views/website_event_templates.xml
+++ b/addons/website_event/views/website_event_templates.xml
@@ -243,7 +243,7 @@
@@ -345,7 +345,7 @@
@@ -512,7 +512,7 @@
to
diff --git a/openerp/tests/common.py b/openerp/tests/common.py
index c4d17264d69..1ca787ad380 100644
--- a/openerp/tests/common.py
+++ b/openerp/tests/common.py
@@ -82,11 +82,13 @@ def post_install(flag):
class BaseCase(unittest.TestCase):
"""
Subclass of TestCase for common OpenERP-specific code.
-
+
This class is abstract and expects self.registry, self.cr and self.uid to be
initialized by subclasses.
"""
+ longMessage = True # more verbose error message by default: https://www.odoo.com/r/Vmh
+
def cursor(self):
return self.registry.cursor()