From 78709e6b14bf977162ac3c324dbb26596495f7d8 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 20 Apr 2017 13:56:53 +0200 Subject: [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. --- addons/web/static/src/js/views/basic/basic_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') 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 -- cgit v1.2.3