[FIX] web_editor,mass_mailing: adapt d7939282 to new views

Also adds body_html to the blacklisted fields. Because that tends to
be quite long as well.
This commit is contained in:
Joren Van Onder
2017-06-15 21:29:26 -07:00
parent b41a987767
commit 83f1e28cc9
2 changed files with 7 additions and 8 deletions
@@ -32,17 +32,13 @@ KanbanColumn.include({
});
FieldTextHtml.include({
get_datarecord: function () {
getDatarecord: function () {
/* Avoid extremely long URIs by whitelisting fields in the datarecord
that get set as a get parameter */
var datarecord = this._super();
if (this.view.model === 'mail.mass_mailing') {
if (this.model === 'mail.mass_mailing') {
// these fields can potentially get very long, let's remove them
var blacklist = ['mailing_domain', 'contact_list_ids'];
for (var k in blacklist) {
delete datarecord[blacklist[k]];
}
delete datarecord[this.name];
datarecord = _.omit(datarecord, ['mailing_domain', 'contact_list_ids', 'body_html']);
}
return datarecord;
},
+4 -1
View File
@@ -236,10 +236,13 @@ var FieldTextHtml = AbstractField.extend({
// this.$translate = $();
return def;
},
getDatarecord: function () {
return this.recordData;
},
get_url: function (_attr) {
var src = this.nodeOptions.editor_url || "/mass_mailing/field/email_template";
var k;
var datarecord = this.recordData;
var datarecord = this.getDatarecord();
var attr = {
'model': this.model,
'field': this.name,