[trunk/7.0] Editable tree view triggers error

Bug #1253899 reported by Mehul Mehta(OpenERP)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
Unassigned

Bug Description

Steps to reproduce bug :

1. Go on runbot db_all
2. Click on Accounting > Journal Entries > Journal Items
3. create a account move line of data
5. Press tab tab tab....
6. Error will generate .. like below :

chrome Version 31.0.1650.57
---------------------------
Uncaught TypeError: Cannot read property 'created' of undefined

http://trunk-25034-all.runbot.openerp.com/web/webclient/js?db=trunk-25034-all:3847

Firefox Version 25.0.1
-----------------------
TypeError: saveInfo is undefined

http://7-0-25040-all.runbot.openerp.com/web/webclient/js?db=7-0-25040-all:3804

Related branches

affects: openobject-addons → openerp-web
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello ,

Its also happen with "Logged Calls" , "Categories" and with other editable tree views . So, I am confirming this issue .

Thank you.

Changed in openerp-web:
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
importance: Undecided → Medium
status: New → Confirmed
summary: - [trunk/7.0] Journal Items create triggers error
+ [trunk/7.0] Editable tree view triggers error
Changed in openerp-web:
assignee: OpenERP R&D Web Team (openerp-dev-web) → Xavier (Open ERP) (xmo)
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Right, so problem is the handler for the tab event blows up entirely at the end of the line if a second [Tab] event arrives when it's handling the current one (which may take a long time as it's saving the current line and starting the edition of the next one): it calls this._next which calls save_edition. The first call goes through, is_editing() passes, it starts saving and sets is_editing to falsy.

At this point the second call arrives[0], is_editing is false so it immediately returns with $.when() and _next(), which expected save information, blows up.

I see 2 ways:
* save_edition could fail (return $.Deferred.reject()) if not currently editing, the ensure_saved() wrapper (which originally contained the lock) would transform the failure into a success for its own callers (as they only care that any pending edition has been saved, if there was no pending edition they're ok), and thus the second _next call would just die (probably a good idea since the first one should have done all the stuff to do)
* or the TAB handler itself could avoid calling _next if we're already transitioning, that would probably require an additional flag on the object though...

[0] there's a wait lock around save_edition so it was made to wait until the first call finished, which is why it finds the record saved.

Changed in openerp-web:
status: Confirmed → In Progress
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Should be fixed as of revision <email address hidden>

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.