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
closesodoo/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>
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.
closesodoo/odoo#48428
X-original-commit: 912e849207709b31aa11b7a2bec9ed8dd8b43203
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Correction of the position of the buttons when editing bg-image
position with a parallax effect other than "fixed".
task-46147
closesodoo/odoo#48419
X-original-commit: 0919b11c9a78a97345b42bf0fe0f1f9939c2b214
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
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
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
closesodoo/odoo#48193
X-original-commit: 2a36c684bb33704e46a6f30b5c501043683da67d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
datetimepicker today button used a font awesome 5 icon.
Font Awesome 5 was reverted to 4.7 but not this line.
introduced by: 699890d3f0
task-2211899
closesodoo/odoo#48135
X-original-commit: 083f7bb3e1b8aef9e2ebd86bc8c059d39473fe6b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, each module override _get_translation_frontend_modules_domain
from ir.http to add its own translation in website if needed and that module
is not starting by website_. Updating the domain from the super() call.
Since we know in most of the case the name, it is useless to do a:
select name from module where name = 'name1' or name = 'name2'...
Now we support a new override of _get_translation_frontend_modules_name that will
allow to add the known module name directly in the list instead to make a search.
In case nobody override _get_translation_frontend_modules_domain, we don't need to
make an extra rpc to find the module.
Related to #47257
task-2211013
X-original-commit: 0dc54814161ab55c34dd2242f65dea23d19fdfca
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#47797closesodoo/odoo#47872
X-original-commit: f04133d24b2271c0bc465f1628281b19d3656271
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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.
closesodoo/odoo#47836
X-original-commit: 3b23f137a2b519b88087452fa4c33a9f97ccdf61
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
closesodoo/odoo#47767
X-original-commit: 644572819ab9a1525af6077dd20c63957eb9271c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
General cleaning of some helpers and generic files. The idea is that they are
less likely to be entirely re-written in the near future so this is a way to
keep the code clean, readable and compliant to the current standards. Changes include:
- Use of async/await when possible
- Use of const/let instead of var
- Removal of underscore.js
- Use of native JS instead of jQuery when possible
The logic of the affected code remains the same.
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
closesodoo/odoo#47355
X-original-commit: 481fe703e9400fb64e96291914f76d4dca883e29
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
Avoid traceback when click on edit and nothing is editable on the
page.
task-2199214
closesodoo/odoo#47328
X-original-commit: fd92a78bd18a0fd765d9c3a857adc10e29c025dd
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
closesodoo/odoo#47303
X-original-commit: d85d912de513de5c81c85a8ff814e0af1e13cefd
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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.
closesodoo/odoo#46865
X-original-commit: 8bc3fd2c41c1d0fc1fa22e0849a7204b6712d7b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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.
closesodoo/odoo#47097
Related: odoo/design-themes#216
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
closesodoo/odoo#47102
X-original-commit: 8d8f442f62919b1cee595ed1fae2c6e4f05eb8fa
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
closesodoo/odoo#44931
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
closesodoo/odoo#46625
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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/43113closesodoo/odoo#46895
X-original-commit: 1e91a89b78ff6019c6120c73ea1eab09b3d58d2f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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.
closesodoo/odoo#46870
X-original-commit: 9d3a2903fd7bf946c033ec78e959e3ed86754845
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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.
closesodoo/odoo#46724
X-original-commit: 1441b3c2f4f935771b3210be82f7b471aa028b64
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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>
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
This issue was introduced with commit 251b880de1caeeef1f27447d4ad69e1abeffde19 : in case current user has no langage,
we should have a fallback case by retrieving the first langage installed in the database.
closesodoo/odoo#46487
X-original-commit: 67cf1150507b8092c32bf745e4c8620409fdc238
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
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.
closesodoo/odoo#46455
X-original-commit: 2bcaa25e67260e3013d4400d1b3ce380ba5cbd1d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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#44484Closes#45555Fixes#44047closesodoo/odoo#45725closesodoo/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>
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
closesodoo/odoo#44536
Related: odoo/enterprise#8368
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
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
closesodoo/odoo#45104
X-original-commit: f9f8c9cc4075fdc5fd4556aa49c914054469198a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
We recently transitioned to async option methods, this allows us to have
better control on the order of execution in the edition workflow, and
among other things, keep the editor's UI in sync with the current state
of the DOM.
However, some snippet options (such as the number of columns option)
need to remove or clone portions of the DOM, and as such, trigger the
onClone or onRemove methods of the snippets contained in that portion if
applicable. Because these methods are defined on other options, we first
need to make sure all the snippetEditors for this portion are created,
which is asynchronous.
This commit adds support for an onSuccess callback to the
'clone_snippet' and 'remove_snippet' event handlers, such that options
can choose to be notified when the work has been done, allowing them to
wait for it before proceeding.
This commit also adapts the layout_column snippet option to make use of
that new feature, and remove code that was used as a workaround before,
ie: precomputing the expected number of columns after the clone/remove,
and using that number to adjust the width of the columns and update the
UI. We can now just wait for the clone/remove, and use the real number
of columns currently in the DOM.
closesodoo/odoo#45343
X-original-commit: c159d58ce9cfca4a44f159b18eb10d1138977e23
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Due to the infamous web_editor revert, summernote assets filesa are once
again created and stored in DB, but because they do not contain
'assets_' in their name, they would show up in the media dialog. This
commit fixes that by prefixing the created summernote assets file with
'assets_'
closesodoo/odoo#45298
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When snippets deeply alter the DOM (e.g. image reordering in gallery),
the related option might be destroyed since they are referencing old
DOM. If such a case occurred, the destroyed option was still waiting for
an option update response by the editor before being considered as
finished... which then never occurred and blocked the editor.
closesodoo/odoo#44998
X-original-commit: 9eeea4c4107dc15984c475582d5ee58a17cd2568
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When the apply-to data attribute was first introduced, a mistake was
made when storing the results of the methods calls, using _.each instead
of _.map to associate each target element with the promise of the method
execution, as a result, Promise.all would resolve immediately instead of
waiting. While there are no currently documented bug caused by this,
they are just waiting to happen.
This commit fixes that.
closesodoo/odoo#44988
X-original-commit: 32271be1f696c11b3e5157426b8f7c9efa93134b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Selecting a css color equals to a theme color via the custom color
was not selecting the theme color.
Opening and closing the custom color without picking a color was
unselecting the selected color.
Now the custom color picker has the selected color as default even if it
does not appear in the palette as selected. This was appearing in the
parallax snippet as no custom color is displayed.
closesodoo/odoo#44986
X-original-commit: 0c8be24ac72c223c12eadbdcf635628f203a6766
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since we use Promise instead of jQuery deferred, the onRemove method
class was no longer triggered before the actual removal of the elements.
Original fix with https://github.com/odoo/odoo/pull/43918
This PR is the same with the async/await form, not breaking the history
of half of the removeSnippet method's lines.
closesodoo/odoo#44963
X-original-commit: 37941159c82d487ff172f0e6b27028f23ab32810
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: fja-odoo <fja@odoo.com>
*: website
Some dialog promises were not resolved on close, blocking the editor.
closesodoo/odoo#44953
X-original-commit: 20f97470cdc59a817526305806e94b222f26a0f2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>