Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] mass_mailing: fix send email issue. #30533

Closed
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+65 −4
Diff settings

Always

Just for now

@@ -45,6 +45,9 @@ var MassMailingFieldHtml = FieldHtml.extend({
var self = this;
var fieldName = this.nodeOptions['inline-field'];

if (this.mode == "readonly") {

This comment has been minimized.

Copy link
@Gorash

Gorash Feb 19, 2019

Contributor

the condition does not cover all cases. If you click on 'edit' then directly on 'save':

Uncaught TypeError: Cannot read property 'find' of undefined
http://451917-30533-f519b2.runbot15.odoo.com/mass_mailing/static/src/js/mass_mailing_widget.js:48

This comment has been minimized.

Copy link
@sga-odoo

sga-odoo Feb 20, 2019

Author Member

Hello @Gorash ,
This PR is related to this bug https://www.odoo.com/web#id=1932061&action=333&active_id=1278&model=project.task&view_type=form&menu_id=4720

The case you are talking about will be taken care in another task with ref link https://www.odoo.com/web#id=1932687&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720

Reference PR #30833

SO if you want to merge both into one let me know so we will merge both issue with the one pr and will cancel another one.

Thanks

This comment has been minimized.

Copy link
@Gorash

Gorash Feb 25, 2019

Contributor

👍

return this._super();
}
if (this.$content.find('.o_basic_theme').length) {
this.$content.find('*').css('font-family', '');
}
@@ -3,6 +3,8 @@ odoo.define('mass_mailing.field_html_tests', function (require) {

var ajax = require('web.ajax');
var FormView = require('web.FormView');
var FieldHtml = require('web_editor.field.html');
var MassMailingFieldHtml = require('mass_mailing.FieldHtml');
var testUtils = require('web.test_utils');
var weTestUtils = require('web_editor.test_utils');
var Wysiwyg = require('web_editor.wysiwyg');
@@ -133,6 +135,65 @@ QUnit.test('save arch and html', function (assert) {
});
});

QUnit.test('save and edit arch wysiwyg', function (assert) {
var done = assert.async();
assert.expect(4);

testUtils.mock.patch(FieldHtml, {
commitChanges: function () {
assert.step("FieldHtml");
return this._super.apply(this, arguments);
},
});

testUtils.mock.patch(MassMailingFieldHtml, {
commitChanges: function () {
assert.step("MassMailingFieldHtml");
return this._super.apply(this, arguments);
},
});

testUtils.createAsyncView({
View: FormView,
model: 'mail.mass_mailing',
data: this.data,
arch: '<form>' +
' <header style="min-height:31px;">'+
' <button name="put_in_queue" type="object" class="oe_highlight" string="Send Now"/>'+
' </header>'+
' <field name="body_arch" class="oe_edit_only" widget="mass_mailing_html"'+
' options="{'+
' \'snippets\': \'template.assets\','+
' \'cssEdit\': \'template.assets\','+
' \'inline-field\': \'body_html\''+
' }"'+
' />'+
'</form>',
res_id: 1,
intercepts: {
execute_action: function (event) {
event.data.on_success();
}
},
}).then(function (form) {
testUtils.dom.click($('[name=put_in_queue]'))
testUtils.form.clickEdit(form)
var $fieldEdit = form.$('.oe_form_field[name="body_arch"]');
var $iframe = $fieldEdit.find('iframe');

$iframe.data('load-def').then(function () {
testUtils.dom.click($('[name=put_in_queue]'))
assert.verifySteps(["MassMailingFieldHtml", "FieldHtml", "MassMailingFieldHtml"]);
testUtils.mock.unpatch(FieldHtml);
testUtils.mock.unpatch(MassMailingFieldHtml);

form.destroy();
done();
});

});
});

});
});
});
@@ -396,9 +396,6 @@ FieldHtml.include({
* @override
*/
commitChanges: function () {
if (!this.wysiwyg) {
return this._super();
}
if (this.nodeOptions['style-inline']) {
this._toInline();
}
@@ -91,7 +91,7 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, {
*/
commitChanges: function () {
var self = this;
if (!this.wysiwyg) {
if (this.mode == "readonly") {
return this._super();
}
var _super = this._super.bind(this);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.