From 0da246ef55762b90f95b370a1a08366987312dac Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 17 Jun 2019 14:37:33 +0200 Subject: [PATCH] [FIX] core: not all falsy objects have an `origin` attribute It avoid `X.browse([0]).exists()` to blow up. --- odoo/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/models.py b/odoo/models.py index 5cc5454c5e2..6fbc7520603 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -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)