diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-06-20 18:08:28 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-06-21 12:59:16 +0200 |
| commit | a473453b3166a381130d9bd6ec4851b9e1ecab26 (patch) | |
| tree | cd8e9fe6ebd2a0a0b254e0501861e2f861aae67c /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | cd812bd6f46988959535288d657353d273fb6d61 (diff) | |
[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.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
0 files changed, 0 insertions, 0 deletions
