odoo/openerp/osv
Raphael Collet 085875619f [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.
2015-09-09 09:36:40 +02:00
..
__init__.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
expression.py [FIX] expression: table alias reaching 64 characters limits 2015-09-08 11:53:18 +02:00
fields.py [FIX] fields: in `one2many.set`, replace incorrect query by ORM access 2015-09-09 09:36:40 +02:00
orm.py [FIX] account, mail, etc.: uniformize evaluated expressions 2015-05-21 15:26:35 +02:00
osv.py [MERGE] new v8 api by rco 2014-07-06 17:05:41 +02:00
query.py [REM] Deleted .apidoc lines. 2013-02-12 15:24:10 +01:00