summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
AgeCommit message (Collapse)Author
2020-04-15[FIX] web_editor: fix video widget allow fullscreenjvm-odoo
Issue - Install Website - Go on your website - Add Media & Text - Replace media by video - Add youtube URL - Save - Play the video The fullscreen button is disabled Cause We do not allow fullscreen on the iframe Solution Allow fullscreen, it is already done for the preview OPW-2224696 closes odoo/odoo#49616 X-original-commit: e608a3feed35801c51c8ce7e251ccffa2ca9dc46 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-10[FIX] web, web_editor: allow editor instantiation from public userqsm-odoo
If for some reason someone wanted to develop a textarea using the editor which is supposed to work as a public user (like we are trying to do on Odoo.com), it was not possible. The code was "designed" to allow it but there was one problem: the lazy loading of the editor assets required a `render_template` call to the server... which cannot be done from a public user. This commit solves the issues by allowing the lazy loading of assets to use a custom route if required. That route is then used by the editor "root". That route performs the render_template as a superuser provided that the view's xmlid is whitelisted. Note: there was another unauthorized call for public user: the colorpicker. This was solved by disabling the colorpicker template rpc for public user, they will still get the default summernote one. Part of https://github.com/odoo/odoo/pull/48981 closes odoo/odoo#48981 closes odoo/odoo#49398 X-original-commit: e84a0bfdc99c21406861b88c02b11c925d92f927 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-08[REF] base: Remove deprecated exceptions and osvJulien Castiaux
TL;DR: remember `osv` and `except_orm` ? You can forget about them. * Deprecated `except_orm` dropped. * `UserError` elevated as super type of all user-related errors. * Unused `DeferredException` dropped. * Unused `QWebException` dropped (real one is in `qweb.py`). * `MailDeliveryException` made a python exception. * `name` legacy exception attribute made an alias of the python standard `args[0]` attribute and deprecated. * `value` legacy exception attribute dropped. * `exception_type` RPC error response key dropped. * Deprecated `osv` module dropped. * `--osv-memory-age-limit` cli option made an alias of `--transient-age-limit` and deprecated. The `odoo.exceptions.Warning` have long been a deprecated alias to `UserError`. It is going to be removed in a future version but first we explicitly deprecate it with a warning. The `odoo.exceptions.DeferredException` was a very old internal exception, it has been removed without deprecation notice as it is never raised. The `odoo.exceptions.except_orm` has been a deprecated exception type with deprecation warning for 5 years, it has been removed in favor of UserError which becomes the super class of all user-related errors. The `odoo.base.models.ir_mail_server.MailDeliveryException` was inheriting `except_orm`. As it is not related to a user error but is more of a problem an admin much take care of, the exception has been made a Python error. The `exception_type` JSON key in RPC error responses was holding an hardcoded value derived from the exception type. Its usage has been dropped in favor of the `name` JSON key that holds the precise exception name. Again as it was hardly used in the source code (beside the crash manager) it has been dropped without deprecation warning. Since we are here trying to clean odoo custom exceptions, we are also deprecating the `name` exception attribute in favor of the more standard `args[0]` attribute. The `name` (along with `value`) were two attributes used to raise `except_orm` exceptions before the introduction of `UserError`, `AccessError` and related exceptions. The `name` attribute, at the time, was holding the exception type/title. Nowadays it contains the error message. The `value` attribute, at the time, was holding the error message. Nowadays it is no more used. The `osv` module contains very old deprecated aliases. There is no simple way to log a deprecation warning for osv, osv_memory and osv_abstract but as they have not been in use for ages, they have been removed too. To be consistent, the `--osv-memory-age-limit` cli option has been made a deprecated alias to the `--transient-age-limit`. closes odoo/odoo#45723 Task: 2187728 Related: odoo/enterprise#9162 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-03[FIX] web_editor: fix dialogs (link, media, alt, crop) not openingSamuel Degueldre
In 3f4092d837d50d25d6c9630d84f67545cf586c7a, the SummernoteManager that was previously owned by RTE was removed, this was because the wysiwyg already has one. One problem with this however is that when an editor is created in an iframe, the wysiwyg is instanciated outside, while the editor is instanciated inside. This means that they don't have the same core.bus to listen for and trigger events, such as those used to open the various editor dialogs. This commit fixes that by always using the top-level core.bus when opening dialogs. This also has the advantage that the dialogs are no longer confined to the iframe and can take up the whole screen, making them more comfortable to use. closes odoo/odoo#48932 X-original-commit: 68ac735aa7e17e66910f51706829035697dfcc1e Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-02[FIX] web_editor: fix updateui methodBenjamin Vray
replace the "return" with "continue". What should have been done when the loop that was originally a "foreach" became a "for" loop. closes odoo/odoo#48919 X-original-commit: 8af8e6ddb2be9a0c57356d075e092b8da42662f0 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-31[IMP] website, *: split the customize method into 3 different methodsBenjamin Vray
* theme_bootswatch, web_editor Split the customizeWebsite method into 3 different methods so we can use customizeWebsite for variable, views or color on the same widget. Part of https://github.com/odoo/odoo/pull/38950 task-2087641
2020-03-31[IMP] various: Replace incorrect use of "edition"Tiffany Chang (tic)
"Edition" is a French-English false friend word. "Edition" in English means "version" whereas "edition" in French means "editing". This commit updates user facing strings/documents that incorrectly use "edition" instead of "edit" or "editing". Attempts were made to clean up English around "edition" usage so please excuse any errors from lack of context knowledge. Code comments and names incorrectly using "edition" were NOT updated.
2020-03-31[FIX] web_editor: use media-container width to determine optimized widthSamuel Degueldre
In 644572819ab9a1525af6077dd20c63957eb9271c the mediaWidth which was previously useless has been changed to default to the media's own width. This causes problems when there is a small image in a large container, because when replacing it, it would still suggest a very small size. This commit makes the mediaWidth default to the container's width instead to fix those issues. closes odoo/odoo#48631 X-original-commit: 3d8b56b2c9c7486430f2e947fecfe07d7163a732 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-30[IMP] web_editor, *: set image alt automatically, remove useless altsSamuel Degueldre
*: website, web_unplash The html alt attribute is supposed to contain a description of an image's content (an alternative to the visual representation), a lot of snippets contained alt attributes that were not descriptive of their content, and would as such be counter-productive in terms of accessibility. This commit removes those. Previously, the alt attribute on img tags had to be set manually by the user through the editor. This commit makes use of the description field on ir.attachment to store image description, and sets the alt attribute on images to that description when choosing an image from the media dialog. task-2091417 closes odoo/odoo#45174 Related: odoo/enterprise#9520 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-30[IMP] web_editor: add unique to image URLs to leverage browser cachingSamuel Degueldre
Previously, image urls did not contain the unique parameter, this resulted in all browser caching for images being dependent on etag headers. This commit changes the url format used by images in the web_editor to use the /id-checksum/ format instead of only the id, this in turn makes it so that the 'Max-age' header is set to 1 year. This also solves some browser caching issues when changing the optimization level of an image in place in the media-dialog. For binary attachments with an url (eg, unsplash images) the unique is added as a search parameter (?unique=checksum) as a cachebuster mechanism, but currently doesn't set the max-age header, which may or may not be done at a later date. task-2091417
2020-03-30[IMP] web_editor: improve image optimization workflow in media dialogSamuel Degueldre
Previously, when selecting an image, the user could optimize their images by clicking a little cog icon in the media dialog. They would also be prompted to optimize their images when uploading them. In most cases, it makes a lot more sense to always save the original in the database, and optimize the original whenever it's dropped in the page automatically. A second problem is that when using the optimization feature, optimized images would be displayed along the originals by default, resulting in a lot of duplicates while browsing the media dialog. This commit changes both of these things: - By default, when uploading an image, the original uploaded image is used. The user can still optimize their image manually through the media-dialog by using the cog icon. When choosing an image in the media-dialog, if it's not already an optimized image, an optimized copy is automatically created and used instead. - Optimized images are now hidden by default, in the media dialog, and can be shown by clicking a checkbox at the top of the modal when in debug mode task-2091417 closes odoo/odoo#45174
2020-03-30[IMP] web_editor: remove summernoteManager from rteSamuel Degueldre
The wysiwyg which is the parent of the EditorMenuBar already has an instance that can be used instead.
2020-03-30[IMP] web_editor, web_unsplash: improve media-dialog UXSamuel Degueldre
Previously, searching for images in the database and on unsplash was mutually exclusive, and controlled by a dropdown menu next to the search bar. Additionally, the display of db images and unsplash images was very different, making using the search function inconsistent and awkward. This commit merges the unsplash search into the db search. When searching, the first few matches from the database are displayed, then results from unsplash. Additionally, the layout of images has been greatly improved, eliminating almost all padding, using some flex-box magic to allow the images to take up all the available space without being cropped or deformed. The input to add an attachment by URL is now collapsed by default, and clicking on it will expand it to reduce visual clutter. Finally, when not in multi-images mode, the clicked image is immediately used, rather than the user having to click it and then click the add button, or having to double click, which was not obvious. task-2091417 closes odoo/odoo#45174
2020-03-27[FIX] web_editor: fix snippets shown in codeviewjvm-odoo
Issue - Install Mass Mailing - Activate debug mode - Create a mass mailing - Select any template - Go in codeview The snippets hide a part of the code Cause When toggling the codeview, we apply a position absolute (all to 0) which shift the #wrapwrap Solution Add an intermediary parent and apply position relative to #wrapwrap like in 12.0 OPW-2220639 closes odoo/odoo#48496 X-original-commit: e415cffa2ffb3fe4b5f0e32bd96b3433387a95e3 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-26[FIX] web_editor: fix bg position opt status for parallax snippetsqsm-odoo
This happened: - The user clicks on a parallax snippet - For each option, call onFocus then updateUI: - The BG position is first, so update its UI - The parallax option is last, onFocus changes the BG position target ... this is broken since the BG position option was updated before the parallax one was able to change its target. So the BG position was updated by checking the background type of the snippet instead of its internal parallax <span/> element. This was working in 13.0 as changing the target automatically re-updated the related option UI, now this is left to the dev to update the UI afterwards or not. In this case the fix is simple: the onFocus of all options should be called, before calling the updateUI of all options. This actually allows to make the code cleaner. closes odoo/odoo#48428 X-original-commit: 912e849207709b31aa11b7a2bec9ed8dd8b43203 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-26[FIX] web_editor: fix buttons position for bg-position when parallaxBenjamin Vray
Correction of the position of the buttons when editing bg-image position with a parallax effect other than "fixed". task-46147 closes odoo/odoo#48419 X-original-commit: 0919b11c9a78a97345b42bf0fe0f1f9939c2b214 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-24[IMP] web_editor, website: copy absolute path for anchor linksBenjamin Vray
Copy the absolute path in the clipboard instead of the relative for anchor links. So the link still works if it is pasted on another page. Part of https://github.com/odoo/odoo/pull/46503 task-2194309
2020-03-24[REF] web_editor: add a wrap div around overlay optionsBenjamin Vray
Add a wrap div around overlay options so we are able too add more specific options that are separate from the move options. Part of https://github.com/odoo/odoo/pull/46503 task-2194309
2020-03-24[IMP] web_editor, website: preview container width on hoverBenjamin Vray
Preview the boundaries of container elements when hovering over the 3 width options. Part of https://github.com/odoo/odoo/pull/46503 task-2194309
2020-03-24[IMP] website, web_editor: add options to fully control shadowsThanh Dodeur
task-2182909 closes odoo/odoo#46816 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-23[FIX] web_editor: get size of resizable elements on mouse downBenjamin Vray
Get the elements size also on mousedown. Because before that, the size was only obtained on the start method when some elements did not yet have its actual size. Example: elements in inactive slides in the carousel snippet. task-2162952 closes odoo/odoo#48193 X-original-commit: 2a36c684bb33704e46a6f30b5c501043683da67d Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-20[FIX] web_editor: revert datepicker font awesome 5fja-odoo
datetimepicker today button used a font awesome 5 icon. Font Awesome 5 was reverted to 4.7 but not this line. introduced by: 699890d3f0b9d5e4421ffb9b423a8dfa67ad469e task-2211899 closes odoo/odoo#48135 X-original-commit: 083f7bb3e1b8aef9e2ebd86bc8c059d39473fe6b Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-18[FIX] web_editor: properly hide custom opt from colorpalette if requiredRavi Singh
Part of https://github.com/odoo/odoo/pull/45093 task-2151408 closes odoo/odoo#45093 closes odoo/odoo#47961 X-original-commit: b5ee7905cd08c9a4d18dbe55f52b9f8ea84d23d3 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-18[FIX] web_editor: relative URL in background snippetNicolas Lempereur
When the backround is set with the media modal, directly get the URL of the IMG element (equivalent to `.getAttribute('src')`) instead of doing `.src` which returns absolute URI. This fix uses jQuery wrapper so it still works if called with object: $({src: 'test.jpg'}).attr('src') === 'test.jpg' note: before 17237ff31 we already used `.attr('src')`. opw-2215103 closes #47797 closes odoo/odoo#47872 X-original-commit: f04133d24b2271c0bc465f1628281b19d3656271 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-17[FIX] web_editor: stop base 64 being saved in the DOM when recroppingSamuel Degueldre
When saving after cropping an attachment, a new cropped attachment is created, and the temporary base64 URL is replaced by the url of the new attachment. However, when cropping an image for a second time, the original image is recropped, and the cropped image attachment that was created previously is overriden with the new data. Previously, the step that overrides the temporary base64 url with the url of the croppped attachment was not present when overriding a previously cropped attachment, meaning it would be saved as is in the DOM, and the overriden attachment would no longer have any links pointing to it. This commit fixes that by overriding the temporary base64 url both when cropping for the first time, but also for subsequent re-crops of the same image. closes odoo/odoo#47836 X-original-commit: 3b23f137a2b519b88087452fa4c33a9f97ccdf61 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-17[FIX] web_editor: use media client width as default mediaWidthSamuel Degueldre
Previously, when trying to compute the optimized width for an image, if the mediaWidth option was unspecified, _computeOptimizedWidth would return NaN, and in all the places where it was specified, it was specified as 1920 meaning it was essentially useless. This commit makes the media's clientWidth the default value for mediaWidth, meaning that if options.mediaWidth is unspecified, the size of the element in the page (if one exists) is used. This allows the suggested width to be actually useful, instead of always suggesting 1920. Specifying a mediaWidth in the options overrides this value. task-2215913 closes odoo/odoo#47767 X-original-commit: 644572819ab9a1525af6077dd20c63957eb9271c Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-12[FIX] web_editor: fixes the rgb/rgba color selectionThanh Dodeur
Before this commit, `selectStyle` could incorrectly split the widgetValue (as described below) which resulted in invalid CSS. widgetValue: `"rgba(55, 12, 99, 0.7) 55px"` result: `["rgba(55,", "12,", "99,", "0.7)", "55px"]` expected: `["rgba(55, 12, 99, 0.7)", "55px"]` fixed: `["rgba(55,12,99,0.7)", "55px"]` This commit fixes the issue. closes odoo/odoo#47515 X-original-commit: 37e6b87341e58769ec2c1d080986e84286d84978 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-11[FIX] web_editor: close widgets by clicking outside of themKrupa Patel
task-2196789 closes odoo/odoo#46298 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-11[REF] web_editor: remove useless code in palettefja-odoo
Previously the widget was not refreshed everytime it was opened. Now that it is the case and since the color picker rerenders every time we select a color: It is no longer required to select/unselect the colors. It is no longer required to add custom colors to existing colors. Part of: https://github.com/odoo/odoo/pull/45872 task-2212288 closes odoo/odoo#47355 X-original-commit: 481fe703e9400fb64e96291914f76d4dca883e29 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-11[FIX] web_editor: fix select theme color if matchfja-odoo
When a default color matches a theme color it will now select the theme color class instead of a css attribute when clicked. Part of: https://github.com/odoo/odoo/pull/45872 task-2212288 X-original-commit: d7b3538a814f0e53cd3c5816f8296ad5e4c5f41a
2020-03-10[FIX] website: avoid error if click on edit when nothing is editableBenjamin Vray
Avoid traceback when click on edit and nothing is editable on the page. task-2199214 closes odoo/odoo#47328 X-original-commit: fd92a78bd18a0fd765d9c3a857adc10e29c025dd Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-10[FIX] web_editor: allow non-alphabetic unit in data-unitBenjamin Vray
Allow non-alphabetic unit (like percentage) as data-unit value. task-2194309 closes odoo/odoo#47325 X-original-commit: 1f3dd221134b7b5e5b0eac0ab2ffe447771998b9 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-10[FIX] web_editor: fix laggy option sectionsfja-odoo
Some option sections are feeling really laggy (especialy the theme ones we now have in master/13.2). This was due to the "preview" activation of the snippet being triggered on mouseover and not on mouseenter. Introduced by: https://github.com/odoo/odoo/pull/36068 task-2198177 closes odoo/odoo#47303 X-original-commit: d85d912de513de5c81c85a8ff814e0af1e13cefd Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-04[FIX] web_editor: fix pictograms in rteDavid Monjoie
The content of the "wysiwyg.fonts" module is duplicated in "web_editor.base". This is a mistake that was introduced with the revert of the saas-12.2 editor. This duplication is the cause of github issue https://github.com/odoo/odoo/issues/44689. This commit fixes the issue by requiring the correct module in rte. closes odoo/odoo#46865 X-original-commit: 8bc3fd2c41c1d0fc1fa22e0849a7204b6712d7b2 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-07[FIX] web_editor, website: review default palette systemqsm-odoo
Before this commit, this was done: 1) Primary variables (app order): (a) web_editor: define palettes (color + theme + gray), only 1 empty one. Mark the first ones as the selected ones. (b) website: fill all defined palettes with the website-related color key and values (body, menu, logo-height, etc). + define "website values" palette. 2) Secondary variables (reverse app order): (c) website: merge the user palettes on top of the selected palettes (so user values overriding values added in (a) and (b)), the resulting palettes are added in palettes lists and the selected palette numbers are set to select those ones. + final selection of "website values" palette. (d) web_editor: final selection of the selected color palette amongst the color palettes. -- The problem with all of this is that the definition of palettes in themes (occuring between step (b) and (c)) never received the website-related color key and values of step (b) and were thus forced to redefine all of those by themself even if they wanted to use the default website one. This commit changes the system so that step (a) and (b) now define "base" palettes (color, theme, gray, website values) and step (c) and (d) now merge the final selected palettes with those "base" palettes. This is in fact theoratically more efficient and allows to not force themes to define every possible palette value we might introduce. closes odoo/odoo#47097 Related: odoo/design-themes#216 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-06[IMP] web_editor: add default opt selectAttributefja-odoo
Add default option selectAttribute Most of the logic is shared with selectDataAttribute part of: https://github.com/odoo/odoo/pull/45397 task-2197008
2020-03-06[FIX] web_editor: correct parsing of dailymotion URLjpr-odoo
The parsing of dailymotion URL was not done correctly. This made the media dialog duplicate the URL params if such an URL was re-edited. task-2159152 closes odoo/odoo#47102 X-original-commit: 8d8f442f62919b1cee595ed1fae2c6e4f05eb8fa Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-06[FIX] web_editor: add focus in url input of link dialogKrupa Patel
Before this commit, when clicking on the link button after focusing a link, the first input of the link dialog was hidden (label), and the second input (URL) was not focused. In this commit, we focus the first *visible* input so users are able to directly copy-paste URL. task-2083209 closes odoo/odoo#44931 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-05[FIX] website, *: fix placeholder translatefja-odoo
* = web_editor InputUserValueWidget's data-placeholder where not translatable. task-2210358 closes odoo/odoo#47029 X-original-commit: dfaf497de5eb95f1ba65e927631cc48d97ca6127 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-04[IMP] web_editor, website: improve border and border radius optionsSamuel Degueldre
Previously, the border radius option was only available when there was a border width, but in some cases you want no border, a background color, and still have rounded corners. This commit makes the option available when there is either a border OR a background color. This commit also adds an option to choose the border style between solid, dashed, dotted and double. The other styles have been left out as they look very different browser to browser and are not very useful. task-2195429 closes odoo/odoo#46625 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-04[FIX] web_editor: stop media-dialog from loading all db attachmentsSamuel Degueldre
Before this commit, the media-dialog was reading all attachments that matched certain criteria for each tab. On large databases, this results in the search_read call timing out, preventing the media-dialog from opening and making all images and documents un-editable. One unfortunate consequence of this is that we can no longer use the firstFilter and lastFilter features, as those rely on fetching all records and sorting them client-side, as such, this feature has been removed entirely. task-2198527 closes https://github.com/odoo/odoo/issues/43113 closes odoo/odoo#46895 X-original-commit: 1e91a89b78ff6019c6120c73ea1eab09b3d58d2f Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-04[FIX] web_editor: avoid traceback on errorJeremy Kersten
Revert of old editor (35b6182) has reintroduce code invalid. Now the data is wrapped in message (f8fe314e7) Remove guarded that raise a warning, it is the default behavior now. closes odoo/odoo#46870 X-original-commit: 9d3a2903fd7bf946c033ec78e959e3ed86754845 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-03[FIX] web_editor: stop snippet editors from finding widget in parentSamuel Degueldre
Because of the event propagating to an option's parent, a snippet option requesting a uservalue widget would also get back the corresponding widgets on the parent snippetEditor, this has the potential to cause unforeseen problems. This commit fixes that by stopping the event's propagation. closes odoo/odoo#46724 X-original-commit: 1441b3c2f4f935771b3210be82f7b471aa028b64 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-28[IMP] web_editor, website: adds custom code to head and footerThanh Dodeur
This commit adds two buttons on the Theme side menu that allow users to add custom XML to the head and to the footer of the website. Part of #44633 task-2168391 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-27[IMP] web_editor: increase height of iframeJérémy Hennecart
The heigth of the iframe for editing a mail template was to small, which makes it quite uncovenient. The height has been raised to improve the usability of the editing feature. task-2198656
2020-02-27[FIX] web_editor: do not store base64 of cropped image to html fieldKishan Gajjar
On crop dialog save, the image src is set to the base64. We are creating an attachment for the cropped image if the user save the changes and after that, we set the newly created image as the src of that image. Meanwhile, when the user save the 'html' field, it is not creating any attachment for the cropped image and also it leaves base64 as it is. Due to that field store large data into the database. this commit makes sure that attachment is created for cropped images and update src before storing field value to the database. closes odoo/odoo#46455 X-original-commit: 2bcaa25e67260e3013d4400d1b3ce380ba5cbd1d Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-21[FIX] web_editor, website: handle date edition in all lang and formatRomain Derie
Before d00c0e317, `Datetime` fields would be editable in frontend but would have unexpected results, especially in non-English languages, for when the english lang format had been changed. It would also crash when saving non-English strings, such as `Lundi`. For more details, see https://github.com/odoo/odoo/pull/44484#issuecomment-586850490 Since d00c0e317, only date displayed in lang format would be editable, which case is Event page in Odoo 12.0. Everywhere else, the format is changed for a nicer layout, either with `widget=XXX` or `t-options=YYY`, such as: `<time t-field="record.date" t-options='{"format": "MMM d, yyyy"}'/>` `<time t-field="record.date" t-options="{'time_only': 'true', 'format': 'short'}"/>` When a date parsing crashes during editor save, the problem is not only that the date can be saved, but the whole changes of the page are lost, as they won't be saved either. This commit attempts to fix every languages cases, regardless of the website lang or user lang. To do so, we store the date in the user lang format in a data attribute of every date field in the DOM. Once the field is clicked (to edit probably), that value will replace the one displayed according to the widget/options. That way, dates will always be sent to the server in the user lang format, avoiding any possible mismatch. This whole fix apply to `Datetime` and `Date` fields. opw-2183055 Closes #44484 Closes #45555 Fixes #44047 closes odoo/odoo#45725 closes odoo/odoo#45997 X-original-commit: c0db9bb8027ff926c619aebe6e0a5cdd05808232 Original-signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com> Co-authored-by: Romain Derie <rde@odoo.com> Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-02-21[IMP] web_editor: check resource is custom or not to display warning on editorHarpritsinh Sisodiya
adds _isCustomResource method which will check whether resource is custom or not, this method checks for JS and SCSS resource, if resource is custom then do not show "No Update" warning inside ace editor. task-2167570 closes odoo/odoo#44536 Related: odoo/enterprise#8368 Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-02-19[FIX] web_editor: add scope to apply z-index web-editor dialog on mobileRomain Estievenart
this bug was introduce by the inline z-index define inside the template 'web_editor.FieldTextHtml.fullscreen' (https://github.com/odoo/odoo/commit/912996fe902c41cafa12dcfe09713ce9857f95ab#diff-76a385e3a3e67f1b88b34afd8181f732R13) This was breaking the z-index web-editor dialog (using inside mass-mailing), so a first fix using a new z-index was made for the web-editor dialog (https://github.com/odoo/odoo/commit/65c8d33c2922bd90e2755cff0a6751c8b3b130d8) But we a missing a scope to identifiable a web-editor dialog was missing. So this commit add a class to allow target only the web_editor dialog. Task ID: 2198649 closes odoo/odoo#45702 X-original-commit: 441a5fa5a67f25398744ea18860eebdc4d17dddb Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-02-11[FIX] web_editor: deny videos in mass mailingAndrea Grazioso (agr-odoo)
Create a new mass mailing, add a video via youtube embed link, save. Send email. Embedding a video can't work because it embeds an iframe, which is not supported by most email clients for security reasons. Extending the noVideo flag also to mass_mailing opw-2179665 closes odoo/odoo#45104 X-original-commit: f9f8c9cc4075fdc5fd4556aa49c914054469198a Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>