[FIX] web: transfer context to underlying many2one in reference field

Fixes #11955 (loss of context in many2one subwidget)
Closes #11957
This commit is contained in:
Jordan Vrtanoski 2016-05-07 15:54:32 +04:00 committed by Martin Trigaux
parent 13ed92c6d8
commit 450f7df00d
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 1 additions and 0 deletions

View File

@ -5570,6 +5570,7 @@ instance.web.form.FieldReference = instance.web.form.AbstractField.extend(instan
this.m2o = new instance.web.form.FieldMany2One(fm, { attrs: {
name: 'Referenced Document',
modifiers: JSON.stringify({readonly: this.get('effective_readonly')}),
context: this.build_context().eval(),
}});
this.m2o.on("change:value", this, this.data_changed);
this.m2o.appendTo(this.$(".oe_form_view_reference_m2o"));