Skip to content
Snippets Groups Projects
Commit ca263767 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[IMP] core: models `__repr__` should show when ids is wrong


As a developer,
when you craft your records set manually,
and wrongly use the API and set something weird in `ids`,
something else than a tuple of integers,
`repr` should help you to understand you did something wrong.

e.g.

before
```py
In [1]: env['res.partner']._browse(self.env, '(1,)', 'bar')
Out[1]: res.partner(1,)
```

after
```py
In [1]: env['res.partner']._browse(self.env, '(1,)', 'bar')
Out[1]: res.partner'(1,)'
```

We could put an assert in `_browse` to make sure `ids`
is a tuple of integers, but this is considered a non-stable
change, as it will suddenly crashes when you will update
Odoo while it wasn't the case before.

closes odoo/odoo#118076

Signed-off-by: default avatarDenis Ledoux (dle) <dle@odoo.com>
parent 3496c25b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment