Closing dialog opened from list view: 'record is undefined'

Bug #1048643 reported by Holger Brunn (Therp)
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Status tracked in Trunk
6.1
Confirmed
Low
OpenERP Publisher's Warranty Team
Trunk
Invalid
Low
Unassigned
OpenERP Community Backports (Web)
New
Undecided
Unassigned
6.1
New
Undecided
Unassigned
Therp Backports (Deprecated)
Fix Committed
Undecided
Unassigned
Web-6.1
Fix Committed
High
Unassigned

Bug Description

If you open a dialog with a button defined on a list view, close it, do a different search and open the dialog again, it will throw the error 'record is undefined' when trying to close this one.

To reproduce:
* Go to Settings->Modules->Modules
* Switch to list view
* Search for crm
* Click the install button for crm
* Close the dialog
* Search for account
* Click the install button for account
* Try to close the dialog
/error/

Analysis:
The dialog created in http://bazaar.launchpad.net/~openerp/openerp-web/6.1/view/head:/addons/web/static/src/js/views.js#L141 is recycled when a button is pressed multiple times, specifically on_close is not updated. But as the on_closed function that is passed uses record_id from the closure where it is created (see http://bazaar.launchpad.net/~openerp/openerp-web/6.1/view/head:/addons/web/static/src/js/view_list.js#L873), it will always search for the record_id of the first record for which the button was clicked.
This then goes wrong if the current search result doesn't contain this record.

Trunk has the same problem, even though http://bazaar.launchpad.net/~openerp/openerp-web/trunk/revision/2863.1.6 fixes the closure, you still end up calling reload_record with the wrong id.

Patch follows in a while.

Related branches

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

Hello Holger Brunn,

I have checked your Issue with latest trunk and 6.1, But It's affected only 6.1. and It's not blocking Issue. That's why I am confirm this Issue with low Importance.

Thanks for contribution!

Changed in openerp-web:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
Changed in therp-backports:
status: New → Fix Committed
Revision history for this message
Yann Papouin (yann-papouin) wrote :

Does this fix has been released in ocb-web via therp-backports ?

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

No, it was pending when we moved to ocb. But if you push the branch to ocb-web you should be able to propose it cleanly.

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.