[7.0] _check_recursion gives false positive if ids include a parent/child pair

Bug #1131653 reported by Stefan Rijnhart (Opener)
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned
6.0
New
Undecided
OpenERP Publisher's Warranty Team
OpenUpgrade Server
Status tracked in 7.0
7.0
Triaged
High
Stefan Rijnhart (Opener)

Bug Description

Here is my company parent structure:

    (Pdb) self.read(cr, uid, [3, 4], ['parent_id'])
    [{'id': 3, 'parent_id': False},
     {'id': 4, 'parent_id': (3, u'Acme 3')}]

That is to say, record 3 is the parent of record 4. Record 3 does not have a parent itself.

When I write the same value to all records, the constraint on _check_recursion signals a recursive structure incorrectly:

    (Pdb) self.check_recursion(cr, uid, [3, 4], context=None, parent=None)
    False

Having each record checked individually, the method gives the right results.

    (Pdb) self._check_recursion(cr, uid, [3], context=None, parent=None)
    True
    (Pdb) self.check_recursion(cr, uid, [4], context=None, parent=None)
    True

These results are inconsistent and as a result I cannot write the same field on these records simultaneously.

Tags: maintenance

Related branches

affects: openobject-addons → openobject-server
summary: - [7.0] _check_recursion signals non-existing recursion
+ [7.0] _check_recursion signals non-existing recursion when ids include a
+ parent/child pair
summary: - [7.0] _check_recursion signals non-existing recursion when ids include a
+ [7.0] _check_recursion gives false positive if ids include a
parent/child pair
Changed in openupgrade-server:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Xavier Fernandez http://www.smile.fr (xav-fernandez) wrote :

Same problem concerns Server 6.0 revno 3662

tags: added: maintenance
Changed in openobject-server:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
assignee: OpenERP Publisher's Warranty Team (openerp-opw) → nobody
Revision history for this message
Mohammad Alhashash (alhashash) wrote :

This bug prevents installing demo data as the module email_template yml script triggers this bug when setting opt-out on all partners.

I submitted a fix proposal using CTE directly in the database: https://code.launchpad.net/~alhashash/openobject-server/v7_fix_check_recursion_bug_1131653

Mohammad Alhashash

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.