Merge lp:~camptocamp/geospatial-addons/fix-widget-early-get-value-20121218 into lp:~geospatial-addons-core-editors/geospatial-addons/6.1

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Merged at revision: 86
Proposed branch: lp:~camptocamp/geospatial-addons/fix-widget-early-get-value-20121218
Merge into: lp:~geospatial-addons-core-editors/geospatial-addons/6.1
Diff against target: 15 lines (+4/-1)
1 file modified
base_geoengine/static/src/js/geoengine_view.js (+4/-1)
To merge this branch: bzr merge lp:~camptocamp/geospatial-addons/fix-widget-early-get-value-20121218
Reviewer Review Type Date Requested Status
Nicolas Bessi - Camptocamp (community) Approve
Review via email: mp+140425@code.launchpad.net

Description of the change

Make sure we don't call too early the get_value of a widget inserted after a geoengine widget geo_edit_map

To post a comment you must log in.
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

Well, I'm not sure this is the best way to do it. But effectively I do not see any other way to fix this without patching the web client.

That's odd as start function should be called only when all widget are loaded. At that time it is not problematic because the context it is not really used yet. But that's a workaround that should be reverted when date widget/web client is fixed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'base_geoengine/static/src/js/geoengine_view.js'
--- base_geoengine/static/src/js/geoengine_view.js 2012-12-12 15:44:48 +0000
+++ base_geoengine/static/src/js/geoengine_view.js 2012-12-18 13:08:11 +0000
@@ -600,7 +600,10 @@
600 return;600 return;
601 }601 }
602 var self = this;602 var self = this;
603 var rdataset = new openerp.web.DataSetStatic(self, self.view.model, self.build_context());603 // We blacklist all other fields in order to avoid calling get_value inside the build_context on field widget which aren't started yet
604 var blacklist = this.view.fields_order.slice();
605 delete blacklist[this.name];
606 var rdataset = new openerp.web.DataSetStatic(self, self.view.model, self.build_context(blacklist));
604 rdataset.call("get_edit_info_for_geo_column", [self.name, rdataset.get_context()], false, 0).then(function(result) {607 rdataset.call("get_edit_info_for_geo_column", [self.name, rdataset.get_context()], false, 0).then(function(result) {
605 var layers = self.create_edit_layers(self, result);608 var layers = self.create_edit_layers(self, result);
606 self.geo_type = result.geo_type;609 self.geo_type = result.geo_type;

Subscribers

People subscribed via source and target branches