problem with setValue in m2o

Bug #953850 reported by Nicolas Vanhoren (OpenERP)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Web Team

Bug Description

...as xmo said...

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Issue happens when creating a new object where:

1. the default_get has no value for the m2o field
2. but triggers an onchange which does set a value on the m2o field
3. and the m2o's name_get is fast

Problem is the following:

1. default_get triggers m2ofield.set_value(false)
   which launches a $.async_when(set internal value to false for real)
2. onchange triggers m2ofield.set_value(some_id)
  which launches a name_get([some_id])
3. if the name_get request returns before $.async_when triggers (~10ms in most browsers I think), then it will set `false` over the correct value of `some_id`

See qdp for model/view which exposes this behavior, reproduction is random (since depends on async name_get call/speed), but if a breakpoint is added inside m2o's set_value then we got it to trigger every time in Chrome on his machine.

Amit Parik (amit-parik)
Changed in openerp-web:
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

Was corrected during a refactoring in this branch: bzr+ssh://bazaar.launchpad.net/~openerp-dev/openerp-web/trunk-form-v2-fme/

Will be merged as soon as that branch is merged into the trunk.

Changed in openerp-web:
status: Confirmed → Fix Committed
Changed in openerp-web:
status: Fix Committed → 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.