summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-05-02 14:11:40 +0200
committerChristophe Simonis <chs@odoo.com>2016-05-02 14:11:40 +0200
commitdb935df398bdd896dce0dcc9e9aa05068cc452d4 (patch)
tree038e8759e2f1c14569cc46fd1b92cecce9f8277d
parentc89dc632fb3a07285160644841ffcdb13c2bbe69 (diff)
parente2faeab4b8edb28853fa436a77e8c1f335ccf137 (diff)
[MERGE] forward port of branch saas-6 up to e2faeab
-rw-r--r--doc/cla/corporate/initos.md8
-rw-r--r--openerp/fields.py12
-rw-r--r--openerp/osv/expression.py2
3 files changed, 15 insertions, 7 deletions
diff --git a/doc/cla/corporate/initos.md b/doc/cla/corporate/initos.md
index 0bede7135e2..3c95fe2d07f 100644
--- a/doc/cla/corporate/initos.md
+++ b/doc/cla/corporate/initos.md
@@ -1,6 +1,6 @@
-Germany, 2015-02-26
+Germany, 2016-04-20
-initOS GmbH & Co. KG agrees to the terms of the Odoo Corporate
+initOS GmbH agrees to the terms of the Odoo Corporate
Contributor License Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this
@@ -8,7 +8,7 @@ declaration.
Signed,
-Markus Schneider markus.schneider@initos.com https://github.com/OSguard
+Frederik Kramer frederik.kramer@initos.com https://github.com/OSevangelist
List of contributors:
@@ -19,3 +19,5 @@ Frederik Kramer frederik.kramer@initos.com https://github.com/OSevangelist
Nikolina Todorova nikolina.todorova@initos.com https://github.com/ntodorova
Peter Hahn peter.hahn@initos.com https://github.com/codingforfun
Claudia Haida claudia.haida@initos.com
+Andreas Zöllner andreas.zoellner@initos.com https://github.com/azoellner
+Rami Alwafaie rami.alwafaie@initos.com https://github.com/rami-wafaie
diff --git a/openerp/fields.py b/openerp/fields.py
index 7056c732479..e9d7fed2e59 100644
--- a/openerp/fields.py
+++ b/openerp/fields.py
@@ -1818,9 +1818,15 @@ class _RelationalMulti(_Relational):
def _compute_related(self, records):
""" Compute the related field ``self`` on ``records``. """
- for record in records:
- other, field = self.traverse_related(record)
- record[self.name] = other[field.name]
+ super(_RelationalMulti, self)._compute_related(records)
+ if self.related_sudo:
+ # determine which records in the relation are actually accessible
+ target = records.mapped(self.name)
+ target_ids = set(target.search([('id', 'in', target.ids)]).ids)
+ accessible = lambda target: target.id in target_ids
+ # filter values to keep the accessible records only
+ for record in records:
+ record[self.name] = record[self.name].filtered(accessible)
class One2many(_RelationalMulti):
diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py
index 196253232e3..6e3d775bc54 100644
--- a/openerp/osv/expression.py
+++ b/openerp/osv/expression.py
@@ -1012,7 +1012,7 @@ class expression(object):
if right is not False:
if isinstance(right, basestring):
op = {'!=': '=', 'not like': 'like', 'not ilike': 'ilike'}.get(operator, operator)
- res_ids = [x[0] for x in comodel.name_search(cr, uid, right, [], op, context=context)]
+ res_ids = [x[0] for x in comodel.name_search(cr, uid, right, [], op, context=context, limit=None)]
if res_ids:
operator = 'not in' if operator in NEGATIVE_TERM_OPERATORS else 'in'
else: