-
- Downloads
[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#118088 X-original-commit: ca263767 Signed-off-by:Denis Ledoux (dle) <dle@odoo.com>
Loading
Please register or sign in to comment