[FIX] web: correctly saves last change in wizards with many2omany

With this change, form_relational_widgets will wait for the 'web.ListEditor'
module to be loaded before patching the list view.  This is particularly
important for wizards containing and editable list view.

Note that to achieve this, I had to fix a horrible hack in session.
This commit is contained in:
Christophe Matthieu
2016-11-07 13:39:08 +01:00
committed by Géry Debongnie
parent 7cfbdd57b4
commit 3378f9c771
2 changed files with 7 additions and 3 deletions
@@ -141,9 +141,12 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
}
var def = this._groups_def[group];
if (!def) {
var Model = window.openerp.web.Model;
var Users = new Model('res.users');
def = this._groups_def[group] = Users.call('has_group', [group]);
def = this._groups_def[group] = this.rpc('/web/dataset/call_kw/res.users/has_group', {
"model": "res.users",
"method": "has_group",
"args": [group],
"kwargs": {}
});
}
return def;
},
@@ -7,6 +7,7 @@ var data = require('web.data');
var Dialog = require('web.Dialog');
var common = require('web.form_common');
var ListView = require('web.ListView');
require('web.ListEditor'); // one must be sure that the include of ListView are done (for eg: add start_edition methods)
var Model = require('web.DataModel');
var session = require('web.session');
var utils = require('web.utils');