[FIX] website_slides: use image_1920 instead of invalid 'image' field

Since the renaming of image fields to image_resolution (image_1920 in our case)
slide upload widget is using invalid field.
This commit adapt the field name to use the new naming (image_1920) instead.

Task id: 2179219
PR #43663

closes odoo/odoo#43816

X-original-commit: 5991eb5b3ba9c6fb9426db235da7c8eb3821f0e1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Florent Lejoly
2020-01-23 08:40:39 +00:00
committed by David Beguin
parent 95fe5f8baa
commit 9b1145001a
@@ -145,7 +145,7 @@ var SlideUploadDialog = Dialog.extend({
if (this.file.type === 'application/pdf') {
_.extend(values, {
'image': canvas.toDataURL().split(',')[1],
'image_1920': canvas.toDataURL().split(',')[1],
'slide_type': canvas.height > canvas.width ? 'document' : 'presentation',
'mime_type': this.file.type,
'datas': this.file.data
@@ -153,7 +153,7 @@ var SlideUploadDialog = Dialog.extend({
} else if (values['slide_type'] === 'webpage') {
_.extend(values, {
'mime_type': 'text/html',
'image': this.file.type === 'image/svg+xml' ? this._svgToPng() : this.file.data,
'image_1920': this.file.type === 'image/svg+xml' ? this._svgToPng() : this.file.data,
});
} else if (/^image\/.*/.test(this.file.type)) {
if (values['slide_type'] === 'presentation') {
@@ -164,7 +164,7 @@ var SlideUploadDialog = Dialog.extend({
});
} else {
_.extend(values, {
'image': this.file.type === 'image/svg+xml' ? this._svgToPng() : this.file.data,
'image_1920': this.file.type === 'image/svg+xml' ? this._svgToPng() : this.file.data,
});
}
}