diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-04-04 11:59:54 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | a3271fa6633b3ff771247fb0df8aa28401c92881 (patch) | |
| tree | cec9996592bddcac12d64d3e0cf0ad58be1c345c /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 8ad523a865089434e17906fb24b45e8cf11302db (diff) | |
[FIX] web: formview button context should be given to actions
When clicking on a stat button in a form view, an action is executed.
The button might also be given a context which have to be used when
running the action. This context was ignored since the context
refactoring made with commit 26a7fe7de1b6258989bc63335321f8f8e83435af.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 5f934ea4e65..dc0beb96942 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1714,6 +1714,8 @@ var BasicModel = AbstractModel.extend({ * * @param {Object} element an element from the localData * @param {Object} [options] + * @param {string|Object} [options.additionalContext] + * another context to evaluate and merge to the returned context * @param {string} [options.fieldName] * the name of the field whose context needs to be added to the * result (and evaluated) @@ -1723,6 +1725,9 @@ var BasicModel = AbstractModel.extend({ var context = new Context(session.user_context, element.context); context.set_eval_context(this._getEvalContext(element)); + if (options && options.additionalContext) { + context.add(options.additionalContext); + } if (options && options.fieldName) { var viewType = options.viewType || element.viewType; var fieldInfo = element.fieldsInfo[viewType][options.fieldName]; |
