summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_model.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-04-20 13:56:53 +0200
committerAaron Bohy <aab@odoo.com>2017-04-20 13:56:53 +0200
commit78709e6b14bf977162ac3c324dbb26596495f7d8 (patch)
tree5f3d529644fd76d639b98c1962e89af57ccdd74e /addons/web/static/src/js/views/basic/basic_model.js
parent51beb6a0adbdfbf7da44e94cb1e2b5045d09d84f (diff)
[FIX] web: BasicModel: context when creating a record
Before this rev., the context sent when creating (or saving) a record was incomplete. Thus, the created record might be incorrect. For example, go to Sales, open a team's pipeline, click on 'Create'. The created record should belong to the selected team, thanks to some keys specified in the context. This wasn't the case before this rev.
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.js2
1 files changed, 1 insertions, 1 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 c7e24f1da64..b3777a05efb 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -677,7 +677,7 @@ var BasicModel = AbstractModel.extend({
model: record.model,
method: method,
args: args,
- context: session.user_context // todo: combine with view context
+ context: record.getContext(),
}).then(function (id) {
if (method === 'create') {
record.res_id = id; // create returns an id, write returns a boolean