From cd812bd6f46988959535288d657353d273fb6d61 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 20 Jun 2018 16:59:48 +0200 Subject: [FIX] web_editor: fix saving and restoring of crop aspect ratio When an image was cropped and saved with a specific aspect ratio, it was not restored properly on further crop editions. --- addons/web_editor/static/src/xml/editor.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/xml/editor.xml') diff --git a/addons/web_editor/static/src/xml/editor.xml b/addons/web_editor/static/src/xml/editor.xml index 9821ceb38bd..7240397ff56 100644 --- a/addons/web_editor/static/src/xml/editor.xml +++ b/addons/web_editor/static/src/xml/editor.xml @@ -318,7 +318,7 @@
- + -- cgit v1.2.3 From a473453b3166a381130d9bd6ec4851b9e1ecab26 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 20 Jun 2018 18:08:28 +0200 Subject: [FIX] web_editor: review crop attachment creation/discard Previous implementation was wrong as it did not care about the ability to discard a crop edition. Indeed, whenever a crop dialog was saved, a crop attachment was created or updated at once. Discarding the editor would then either: - Seem to discard a first-time cropped image but would have created an attachment for nothing (just the image src was reset) OR - Fail to discard a second-time cropped image as the cropped attachment would have been directly updated and the image src would not have changed This commit changes the way it works: - On crop dialog save, the image is marked with required data for a potential future save of the cropped image (as a DB attachment) and the src is set to the base64 cropped image directly. Note that the code ends up being clearer and efficient that way too. --- addons/web_editor/static/src/xml/editor.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/xml/editor.xml') diff --git a/addons/web_editor/static/src/xml/editor.xml b/addons/web_editor/static/src/xml/editor.xml index 7240397ff56..b74919e3691 100644 --- a/addons/web_editor/static/src/xml/editor.xml +++ b/addons/web_editor/static/src/xml/editor.xml @@ -312,7 +312,7 @@
- +
-- cgit v1.2.3