summaryrefslogtreecommitdiff
path: root/addons/website_mass_mailing/static
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-03-20 15:23:19 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit2106e3dd2ecd61096d7c7531c2f18b00fb30aeea (patch)
tree1e41a2e698ba993d9d74b6fddd699adb15642001 /addons/website_mass_mailing/static
parent749d10e8b55dce94828290d7e4d6b2b6f741e9bd (diff)
[REF] web, *: simplify our RPC system (in JS)
The RPC system was not completely satisfactory, we decided to prepare the future and do it properly. This commit introduces the new rpc system, which replace the previous new one. We now simply have a method, this._rpc, which takes a dictionary of parameters. The idea is that depending on the parameters, it is able to add correct default value when necessary. For situations where we don't have the this._rpc method, we can use the rpc.query method, which takes the same arguments, but directly calls ajax.rpc instead of triggering up some events.
Diffstat (limited to 'addons/website_mass_mailing/static')
-rw-r--r--addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js b/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js
index 2189a59c746..c9848361d42 100644
--- a/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js
+++ b/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js
@@ -21,10 +21,12 @@ var mass_mailing_common = options.Class.extend({
'window_title': this.popup_title,
'select': _t("Newsletter"),
'init': function (field) {
- return rpc.query({model: 'mail.mass_mailing.list', method: 'name_search'})
- .args(['', []])
- .withContext(base.get_context())
- .exec({type: "ajax"});
+ return rpc.query({
+ model: 'mail.mass_mailing.list',
+ method: 'name_search',
+ args: ['', []],
+ context: base.get_context(),
+ });
},
});
def.then(function (mailing_list_id) {