[FIX] account: handling of text domains in _query_get

1df72cb01b added a stringification of
the domain parameter to handle situations where an actual
domain (list/tuple) is being provided rather than a string, however
this causes issues when the string input is text (unicode) containing
non-ascii data as in Python 2 `str()` will then raise a
UnicodeEncodeError.

Rather than stringify the input, bypass safe_eval when the input is
already a proper domain.

Closes #19367
This commit is contained in:
Wolfgang Taferner
2017-09-12 11:20:09 +02:00
committed by Xavier Morel
parent 80ad2a370c
commit 236a24de96
+3 -1
View File
@@ -1292,7 +1292,9 @@ class AccountMoveLine(models.Model):
@api.model
def _query_get(self, domain=None):
context = dict(self._context or {})
domain = domain and safe_eval(str(domain)) or []
domain = domain or []
if not isinstance(domain, (list, tuple)):
domain = safe_eval(domain)
date_field = 'date'
if context.get('aged_balance'):