diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-02-26 09:24:45 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | ecceee639ed7bfdaf0e2e152fd147ee02e3281e2 (patch) | |
| tree | a7ecc19f02eb4016625b844bbf1b1c3b4ae192ec /addons/web/static/src/js/views/view_dialogs.js | |
| parent | ed830f739491d01da92f2517bd4cee453d994923 (diff) | |
[FIX] web: formview dialog can now properly evaluate context
For this change, I had to pass the handle to the parent datapoint all
the way from the controller to the new form view.
Diffstat (limited to 'addons/web/static/src/js/views/view_dialogs.js')
| -rw-r--r-- | addons/web/static/src/js/views/view_dialogs.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/view_dialogs.js b/addons/web/static/src/js/views/view_dialogs.js index 4274d37291e..f5982e2ef65 100644 --- a/addons/web/static/src/js/views/view_dialogs.js +++ b/addons/web/static/src/js/views/view_dialogs.js @@ -67,6 +67,10 @@ var FormViewDialog = ViewDialog.extend({ /** * @param {Widget} parent * @param {Object} [options] + * @param {string} [options.parentID] the id of the parent record. It is + * useful for situations such as a one2many opened in a form view dialog. + * In that case, we want to be able to properly evaluate domains with the + * 'parent' key. * @param {integer} [options.res_id] the id of the record to open * @param {Object} [options.form_view_options] dict of options to pass to * the Form View @todo: make it work @@ -86,6 +90,7 @@ var FormViewDialog = ViewDialog.extend({ this.on_saved = options.on_saved || (function () {}); this.context = options.context; this.model = options.model; + this.parentID = options.parentID; var multi_select = !_.isNumber(options.res_id) && !options.disable_multiple_selection; var readonly = _.isNumber(options.res_id) && options.readonly; @@ -158,6 +163,7 @@ var FormViewDialog = ViewDialog.extend({ footer_to_buttons: true, default_buttons: false, model: self.model, + parentID: self.parentID, }); return formview.createController(self); }).then(function (formView) { |
