← Back to team overview

openerp-community-reviewer team mailing list archive

[Bug 1048643] Re: Closing dialog opened from list view: 'record is undefined'

 

** Also affects: ocb-web
   Importance: Undecided
       Status: New

** Also affects: ocb-web/6.1
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of OpenERP
Community Backports Team, which is subscribed to OpenERP Community
Backports (Web).
https://bugs.launchpad.net/bugs/1048643

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

Status in OpenERP Community Backports (Web):
  New
Status in OpenERP Community Backports (Web) 6.1 series:
  New
Status in OpenERP Web:
  Invalid
Status in OpenERP Web 6.1 series:
  Confirmed
Status in OpenERP Web trunk series:
  Invalid
Status in Therp Backports (Deprecated):
  Fix Committed
Status in Therp Backports (Deprecated) web-6.1 series:
  Fix Committed

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ocb-web/+bug/1048643/+subscriptions