summaryrefslogtreecommitdiff
path: root/addons/product
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-04-24 12:53:34 +0200
committerChristophe Simonis <chs@odoo.com>2017-04-24 12:53:34 +0200
commit64b7d4e8a8df180bc598e2df56992d373e23b44b (patch)
treee5683925601ffc151d185b374cd8b4a713d23def /addons/product
parent7350a50a2eb41f8df595b4791edfe5ee3f06de63 (diff)
parent3f6e573c67a2ef6cbaf9bbeda1d0a2f286809266 (diff)
[MERGE] forward port branch 10.0 up to 3f6e573c67a
Diffstat (limited to 'addons/product')
-rw-r--r--addons/product/models/product_attribute.py2
-rw-r--r--addons/product/models/product_pricelist.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/product/models/product_attribute.py b/addons/product/models/product_attribute.py
index 9c9a8c09388..bdedd9d7f9d 100644
--- a/addons/product/models/product_attribute.py
+++ b/addons/product/models/product_attribute.py
@@ -76,7 +76,7 @@ class ProductAttributevalue(models.Model):
@api.multi
def _variant_name(self, variable_attributes):
- return ", ".join([v.name for v in self if v.attribute_id in variable_attributes])
+ return ", ".join([v.name for v in self.sorted(key=lambda r: r.name) if v.attribute_id in variable_attributes])
class ProductAttributePrice(models.Model):
diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py
index 45cc87d17ae..c4dc828b540 100644
--- a/addons/product/models/product_pricelist.py
+++ b/addons/product/models/product_pricelist.py
@@ -44,7 +44,7 @@ class Pricelist(models.Model):
if name and operator == '=' and not args:
# search on the name of the pricelist and its currency, opposite of name_get(),
# Used by the magic context filter in the product search view.
- query_args = {'name': name, 'limit': limit, 'lang': self._context.get('lang', 'en_US')}
+ query_args = {'name': name, 'limit': limit, 'lang': self._context.get('lang') or 'en_US'}
query = """SELECT p.id
FROM ((
SELECT pr.id, pr.name