diff options
| author | Raphael Collet <rco@odoo.com> | 2021-01-19 17:14:08 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2021-01-20 09:03:18 +0000 |
| commit | a4d7e01e2a27e90060ffd19dffbad3cead5d608b (patch) | |
| tree | 62c23e8a73db2251d9739b95c6f660c12801dc5d /odoo/models.py | |
| parent | 3655efc990d4792453304938d555122f4f5d3c88 (diff) | |
[FIX] core: exists() with string ids
The call model.browse('xxx').exists() should not return the record.
Instead, it should fail as the string 'xxx' is not a valid ID.
closes odoo/odoo#64779
X-original-commit: 824a6515a528cd2b682c3d3504c0d27ed9427cdb
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/models.py')
| -rw-r--r-- | odoo/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/models.py b/odoo/models.py index 44ab1498350..1f4c5ba0e2b 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -4673,7 +4673,7 @@ Fields: """ ids, new_ids = [], [] for i in self._ids: - (ids if isinstance(i, int) else new_ids).append(i) + (new_ids if isinstance(i, NewId) else ids).append(i) if not ids: return self query = """SELECT id FROM "%s" WHERE id IN %%s""" % self._table |
