summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-11-15 11:58:09 +0100
committerXavier Morel <xmo@openerp.com>2011-11-15 11:58:09 +0100
commitf6b048213067ff60e9c5cf0a009595a8ea9904bc (patch)
tree7accfc1279716f996bbae95387d4c6c22db458ef /addons/web/static/src/js
parent1e38e139075ca631152796da68b9cd177c8ef0cf (diff)
[FIX] add active_id, active_ids and active_model to context send when fetching m2o widget values in forms
lp bug: https://launchpad.net/bugs/878189 fixed bzr revid: xmo@openerp.com-20111115105809-phttoirkmq4rzd1w
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/view_form.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 84041ef8b60..861d45dcb19 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -798,8 +798,13 @@ openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form.
_build_view_fields_values: function() {
var a_dataset = this.view.dataset;
var fields_values = this.view.get_fields_values();
- var parent_values = a_dataset.parent_view ? a_dataset.parent_view.get_fields_values() : {};
- fields_values.parent = parent_values;
+ var active_id = a_dataset.ids[a_dataset.index];
+ _.extend(fields_values, {
+ active_id: active_id || false,
+ active_ids: active_id ? [active_id] : [],
+ active_model: a_dataset.model,
+ parent: a_dataset.parent_view ? a_dataset.parent_view.get_fields_values() : {}
+ });
return fields_values;
},
_build_eval_context: function() {