diff options
| author | Raphael Collet <rco@openerp.com> | 2015-09-08 15:09:35 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2015-09-09 09:36:40 +0200 |
| commit | 085875619fbbebfcb1a4e6bb4ff28d109bd4b07b (patch) | |
| tree | b557b82344b97002d36516d516511c593a0518bf /addons/web/static/src/js | |
| parent | b89b7e0554d05e90965f31f80b22fe98f2f4b239 (diff) | |
[FIX] fields: in `one2many.set`, replace incorrect query by ORM access
When linking a record into a `one2many` relation with command `(4, rid)`, a
query checks whether the record is already linked to the current record id:
SELECT 1 FROM {inv_table} WHERE id={rid} AND {inv_field}={id}
where `inv_field` is the name of the inverse field, and `inv_table` is the
table where this field is stored.
The query is wrong if the inverse field is inherited, because the `rid` does
not belong to the table `inv_table`.
The test has been replaced by a plain ORM access:
rec = obj.browse(cr, SUPERUSER_ID, rid)
if int(rec[inv_field]) != id:
...
This fixes #4685.
Diffstat (limited to 'addons/web/static/src/js')
0 files changed, 0 insertions, 0 deletions
