problem with setValue in m2o
Bug #953850 reported by
Nicolas Vanhoren (OpenERP)
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...
Changed in openerp-web: | |
assignee: | nobody → OpenERP R&D Web Team (openerp-dev-web) |
Changed in openerp-web: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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) set_value( some_id)
which launches a $.async_when(set internal value to false for real)
2. onchange triggers m2ofield.
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.