Invalid behavior of hierarchic tree view (toggle show/hide children)

Bug #1183156 reported by Denis Karataev
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Web Team

Bug Description

Hello!

When we click to show/hide children of hierarchic tree view item, we get the bug, because toggling depends on item id from database, so we can have more than one item with same id. It must be rewrited to have unique id for every item in tree view, it will fix the problem.

It's error with wrong item selection in addons/web/static/src/js/view_tree.js:

this.$el.find('#treerow_' + record_id)

where '#treerow_' + record_id is not unique DOM id!

Please, see attached video.

Related branches

Revision history for this message
Denis Karataev (dskarataev) wrote :
description: updated
description: updated
Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Denis,

I have checked your scenario, But I did not faced any problem at my side. It's work fine as expected. Suppose create bom for product "Mega Pc" and using sub product "PC Assemble + 512MB RAM" which have another bom. So when open tree for "Mega Pc" and click show, It's show only sub product. doesn't show the sub product of "PC Assemble + 512MB RAM". at other end show the child product of "PC Assemble + 512MB RAM" which is expect.

So I have attached screen capture for your reference. would you please check It again and notify us where you have faced the problem.

Thanks and waiting for your reply!

Changed in openerp-web:
status: New → Incomplete
Revision history for this message
Denis Karataev (dskarataev) wrote :

Hello Amit, please see my second video with more explanation of the bug. I downloaded last version of Openerp.

Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Denis,

I have double check this Issue with latest revision on runbot 7.0. but In latest revision, behaviour of bom structure is change now. That's why I am attached the another video for you reference. would you please check It and revert me.

If you customise the code at your side than tell me. so Its help to us for reproduce.

Thanks and waiting for your reply!

Revision history for this message
Denis Karataev (dskarataev) wrote :

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="mrp.action2" model="ir.actions.act_window">
            <field name="name">Bill of Materials Structure</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">mrp.bom</field>
            <field name="domain">[('bom_id', '=',active_ids)]</field>
            <field name="view_id" ref="mrp.mrp_bom_tree_view"/>
            <field name="view_type">tree</field>
            <field name="view_mode">tree</field>
        </record>
    </data>
</openerp>

Amit, we used the code to get tree hierarchic view instead list view in mrp.bom. Please check with it. The code override action to change view_type and view_mode.

Revision history for this message
Denis Karataev (dskarataev) wrote :

Hey guys! It's a bug of tree view widget. Why are you silent?

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I confirm this can be reproduced on 7.0. It happens in any tree view when the descendants are not unique, e.g. with multi-level BOMs that have the same components.

Changed in openerp-web:
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
importance: Undecided → Low
milestone: none → 7.0
status: Incomplete → Confirmed
Changed in openerp-web:
status: Confirmed → In Progress
Changed in openerp-web:
status: In Progress → Fix Committed
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

We have merged the fix to this bug in 7.0 (revision 4018). Thanks for the report.

Changed in openerp-web:
status: Fix Committed → Fix Released
Revision history for this message
Parthiv Patel (parthiv-patel-deactivatedaccount) wrote :

This one has now broken the functionality of toggling of a tree view. Have any one checked before merging ?

Cheers,
Parthiv

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [Bug 1183156] Re: Invalid behavior of hierarchic tree view (toggle show/hide children)

On 08/28/2013 08:40 AM, Parthiv Patel wrote:
> This one has now broken the functionality of toggling of a tree view.

Could you be more specific, for example by providing steps to reproduce the
problem you mention, on the latest 7.0 version (and on runbot preferably)?
Thanks!

Revision history for this message
Parthiv Patel (parthiv-patel-deactivatedaccount) wrote :

check the chart of accounts, unhide children of any node and then try to hide it again. it's not working.

Cheers,
Parthiv

Revision history for this message
Parthiv Patel (parthiv-patel-deactivatedaccount) wrote :

attached is the video demonstrating bug.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

@Parthiv: thanks for the explanation, that's pretty clear indeed!
@Martin: I'm re-opening the bug, this regression needs to be fixed.

Changed in openerp-web:
status: Fix Released → In Progress
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

The regression was due to a name clashing between a field an a local variable. This was working fine on warehouse but not on the account.

This was changed at revision 4021 and hopefully fixing all problems.
<email address hidden>

Sorry for the inconvenience.

Changed in openerp-web:
status: In Progress → Fix Released
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.