[FIX] core: not all falsy objects have an origin attribute

It avoid `X.browse([0]).exists()` to blow up.
This commit is contained in:
Christophe Simonis
2019-06-17 14:44:25 +02:00
parent 93b0f9ad2a
commit 0da246ef55
+1 -1
View File
@@ -206,7 +206,7 @@ def origin_ids(ids):
""" Return an iterator over the origin ids corresponding to ``ids``.
Actual ids are returned as is, and ids without origin are not returned.
"""
return ((id_ or id_.origin) for id_ in ids if (id_ or id_.origin))
return ((id_ or id_.origin) for id_ in ids if (id_ or getattr(id_, "origin", None)))
IdType = (int, str, NewId)