The jSignature lib is only used by the NameAndSignature component,
which is not accessible on a many screens. This commit thus
removes the lib and its extension from the bundles, and makes the
NameAndSignature component load it on demand.
Part of task~3439226
closesodoo/odoo#138054
Related: odoo/enterprise#48633
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit converts the SignatureForm widget into a Component.
This allows to remove the last usage of the legacy NameAndSignature
widget, which we thus remove.
Part of task~3439226
Part-of: odoo/odoo#138054
Maintain the playful tone whilst avoiding nonsensical phrasing.
I will not take comment at this time, thank you.
Task-🤔🙃😬💅😐🤓closesodoo/odoo#138302
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Before this commit error messages in odoo are boring and
not much attractive to user. Those were like odoo is preventing
them from doing something user want to do.
In this commit, we have modified the message to be a more friendly
and humorous tone, making it less tedious and more enjoyable. It
aims to enhance the user experience and ensure that interactions
with any application are both pleasant and informative. As a result,
the messages have been clear, short, easy to understand and informative.
task-3356114
Part-of: odoo/odoo#124820
Co-authored-by: Kamlesh Pathekar <kpt@odoo.com>
Before this commit:
On applying background or on remove background color, strange padding
is added on the text.
After this commit:
Now, padding is not added when background is colored is applied or background
color is removed.
task-3237693
closesodoo/odoo#138143
X-original-commit: 29a40a30f3bf7a4a3a205e54fb84e569691d961f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit removes the module sortable from jQueryUI and adds instead a
sortable service to use the sortable code already used by the backend.
The service can be called using `this.call("sortable", ...)` and the
sortable listeners are added when the `enable` function is called.
This function (`enable()`) returns an object that contains the `cleanup`
function (`cleanup()`).
```javascript
// start / setup
const sortable = this.call(
"sortable",
"create",
{
ref: { el: document.querySelector(".list") },
elements: ".items",
handle: ".drag-icon",
},
);
// on attach callback / on mounted
const sortableInstance = sortable.enable();
// on destroy / on willUnmount
sortableInstance.cleanup();
```
Also, it adds some new property to the useSortable:
* clone: the placeholder is a clone of the drag element
* placeholderClasses: classes added to the placeholder element
* applyChangeOnDrop: on drop the change is applied to the DOM
* followingElementClasses: classes added to the element following mouse
task-3439226
closesodoo/odoo#137527
Related: odoo/enterprise#48371
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit:
-Banner on drag and drop only drops content.
-Content inside banner were draggable.
After this commit:
-Now we can drop banner as well.
-Prevented content inside banner to be draggable.
task-3512199
closesodoo/odoo#136003
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit:
In mass mailing, Selecting image and click on replace media you get picture
middle of the screen.
After this commit:
Now, clicking on replace would open media dialog and replace picture.
task-3506590
closesodoo/odoo#137920
X-original-commit: 7e0b8af005e818c9283b332fb140aeaeaf028275
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Increases the function's maximum lightness amount from 15% to 20%.
The new value is still arbitrary but provides better results with the
default color palette.
task-3097005
Part-of: odoo/odoo#120302
This commit replaces the default cc2's headings color. The aim is to
avoid misunderstandings between clickable and not-clickable titles.
task-3097005
Part-of: odoo/odoo#120302
*: web_editor
This commit applies the light color on inputs to keep consistency with
the default theme redesign. That color is now customizable as it is
linked to o-color-3.
task-3097005
Part-of: odoo/odoo#120302
Co-authored-by: Brieuc-brd <brd@odoo.com>
Prior to this commit, some snippets used colors that were not changed or
were not visible (white text on white background) depending on the color
preset, which created color issues.
This commit adapts colors to make elements readable and maintain
consistency with the theme design.
Note: this could be partially backported (with stable adaptation) later.
task-3097005
Part-of: odoo/odoo#120302
Co-authored-by: qsm-odoo <qsm@odoo.com>
*: web, web_editor, portal, theme_default, website_sale
The goal of this commit is to improve the overall style of the default
website theme mostly by overriding Bootstrap variables with a bit of
customization for more advanced changes.
task-3097005
Part-of: odoo/odoo#120302
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Antoine (anso) <anso@odoo.com>
Steps:
- on website or mass_mailing, insert an image via the "/image" command,
- a text node containing "[object HTMLImageElement]" is pasted instead
of the expected content.
Since [1], when inserting a node, the instanceof operator is used to
compare that node to the Editor's document global `Node` object. While
it fixed cases where there was as mismatch of `Node` objects (nodes
created by the top document x nodes created via the iframe's document),
it revealed errors elsewhere. Notably, the MediaDialog inserts an image
node created by the top document, regardless if the editor is mounted in
an iframe.
This commit makes the `insert` command more permissive when resolving if
'content' is a Node or a string.
task-3543003
[1]: https://github.com/odoo/odoo/commit/bfe0c5fedf172f4c77002a4f54803b376ada43ceclosesodoo/odoo#137872
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The motivation of this commit was to remove the override of owl
that disables the validateTarget check, which we believed was
necessary for the renderToString function.
Fun fact: renderToString doesn't seem to need the override, as
validateTarget is only called when mounting an app and when
completing a fiber, which renderToString doesn't do. It was instead
probably necessary for the legacy compatibily layers that have now
been removed.
So this commit removes the validateTarget override.
This commit also simplifies the setup of the renderToString fn by
lazy creating the app itself, instead of requiring the application
setup to set the main app as renderToString app (e.g. main.js in
web).
Part of task~3508223
closesodoo/odoo#137807
Related: odoo/enterprise#48514
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Replace all the calls to get_resource_path to the better file_path or
directly use file_open when not needed
Doing both a get_resource_path and file_open means checking twice that
the file exists.
Doing a simple path concatenation before a file_open is safe.
If given to another method (e.g. etree.parse), calling file_path is
the prefered method.
Note that get_resource_path used to return False when the file does
not exists while file_path/file_open raises a FileNotFoundException
closesodoo/odoo#135607
Related: odoo/upgrade#5187
Related: odoo/enterprise#47475
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Prior to this commit, read-only handles were hidden, which created a
layout issue (eg. the header was no longer highlighted when we clicked
on it).
This commit adapts read-only handles to make them visible by using a
border around the selected element.
It also adapts the common borders of all handles to place it
inside the element to avoid being partially hidden when the element is
on the edge of the container (eg. the header or the footer).
task-3537616
closesodoo/odoo#137569
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, owl was in the linter's accepted global variables.
This allowed direct access to owl global object.
For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`
Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:
`import { xml } from "@odoo/owl";`
task-id 3498859
closesodoo/odoo#137517
Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This issue occurs when a customer imports or uploads a file, and that file
contains an image that is attached to the URL as text or HTML. then,
The error would be generated.
Step to Produce:-
- import CSV file (Ex.'product.product' model)
> that CSV file must have one URL Image(In that URL has content of text or
Html form)
- Click On the 'Test' Button.
Applying these changes will resolve this issue.
sentry:-4046190590
closesodoo/odoo#137611
X-original-commit: acbb5af7ee96cdc579850427bc2bca6d7bf184e4
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
This commit fixes two bugs with the colorpicker that occur since [1].
Steps to reproduce the 3rd bug:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Change the color of the header by picking a color in the "Background"
sub option (below the "Header Position" selector).
- Save and Edit.
- Go with your mouse over the different colors of the colorpicker (at
least 2).
- Bug: an infinite loader appears on the iframe and prevents from
editing the background color.
Steps to reproduce the color combinations bug:
- Go to Website edit mode.
- Drop a Call to action snippet.
- Change the background color and try to select another preset.
- Bug: the color of the text and buttons is updated, but not the
background color.
Both of these 2 bugs happen after commit [1] because the colorpicker
widget is started before the ColorPalette component is attached to the
DOM (which only happens once the user opens the picker). However, the
colorNames are only set after the setup() of the ColorPalette.
Initializing the colorNames with possible default values is thus
necessary to avoid bugs on `_computeWidgetState()`.
[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997
task-3440939
closesodoo/odoo#137306
X-original-commit: https://github.com/odoo/odoo/commit/2ccc01175080ddb549660713d6101dd936e0d304
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Open the colorpicker (below the "Header Position" selector).
- Bug: we shouldn't be able to choose anything other than a gray.
This bug occurs since [1] because, before the conversion to owl, the
colorpicker widget was added conditionally in JavaScript (so the widget
was not included if the option "custom" color was excluded). However, in
the current version, the color picker is inside the
'web_editor.ColorPalette' XML without any condition to display it or
not.
[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997
task-3440939
X-original-commit: https://github.com/odoo/odoo/commit/7919e243427899ca7c09666fbdf8453bc2defa1d
Part-of: odoo/odoo#137306
*: tools
Steps to reproduce the bug:
- Add an image on the website.
- Replace it by a "jpeg". Note that the mimetype of the image is
"image/webp" at the upload since [1].
- Add a shape on the image.
- Save and Edit.
-> If you check on the available "Format", the mimetype of the
"original" is "webp" but it should be "jpeg".
Before this commit, there were two types of mimetype data attribute:
- `mimetype`: the current mimetype of the image.
- `originalMimetype`: the mimetype of the image without a shape.
Before [1], it was also the mimetype of the original image. However,
since [1], the user has the possibility to change the mimetype of the
image so the "originalMimetype" attribute does not always refer to the
mimetype of the original image anymore.
To resolve the problem, another data attribute has to be introduced.
Here is a summary of the mimetype related attribute:
- `mimetype`: the current mimetype of an image.
- `originalMimetype`: the mimetype of the image before a shape has
been applied. It is needed when removing a shape to recover the correct
mimetype.
- `mimetypeBeforeConversion`: the mimetype of the original image. It is
needed in order to be able to change the format of an image and come
back to the original one.
In the case of an uploaded "jpeg" image on which a shape has been
applied, `mimetypeBeforeConversion` is "image/jpeg", `originalMimetype`
is "image/webp" (since [1]) and `mimetype` is "image/svg+xml".
The `loadImageInfo()` has been adapted to also handle the case of an
image that has already been loaded but that does not have the
`mimetypeBeforeConversion` attribute (for example all the images that
were uploaded on the website before this commit). In this case, the
mimetype attribute is kept and not set to the original one as the user
could have changed it.
[1]: https://github.com/odoo/odoo/commit/0449fe85cb0e1d639a4e1aeba26e90906f79254d
task-3449866
closesodoo/odoo#137424
X-original-commit: 730588b802506844e6ca54df312333bfd8df1d52
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit:
When pasting text from outside odoo, it often includes additional tags
such as <b> and <P>, along with unwanted styles.
After this commit:
When pasting text from outside odoo, those extra tags and styles are now
removed.
task-3378093
closesodoo/odoo#137236
X-original-commit: 5485824654179981cc7562e643123a6decbb02a2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Reproduction:
1. Go to any record with a chatter
2. Open full composer
3. Enter a special case for the text using shortcuts (CTRL+I for italic,
CTRL+B for bold, etc)
4. exit the special case with the same shortcut
5. JS error
Reason:
A selection is not null check is missing in the condition
Related PR: https://github.com/odoo/odoo/pull/136777closesodoo/odoo#137499
X-original-commit: db0325503576d06521ab65a64d3c9cce837e66bc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Jinjiu Liu (jili) <jili@odoo.com>
Before this commit:
When we inserted a new row or column into a table, a <p> tag was not
inserted within it, resulting in the placeholder not being displayed.
After this commit:
When a new row or column is inserted into the table, a <p> tag is inserted
within the <td>.
task-3344668
closesodoo/odoo#137429
X-original-commit: a3e09ed84451f8a7c5cbc82648a02565ef63072f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Purpose of this commit:
Added a button to the sidebar and the column dropdown menu
for resizing the table's height and width, so that if we
want to reset the modified size of the table, we will be
able to do so
Taskid: 3344668
X-original-commit: 8740310ec845b020db0d31d3be5dfc2969665994
Part-of: odoo/odoo#137429
The cookie service was replaced by a utils file in core. This was done
to be able to use the cookies without the need of environment.
"Om Nom Nom Nom" - Cookie Monster
part-of task-id 3439226
closesodoo/odoo#136782
Related: odoo/enterprise#48005
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit there were two regexes for matching http(s) URLs,
being the only difference between them the presence of a capturing group
for the protocol/scheme. The need for a nearly duplicated version of the
same regex was its use in `_onPaste` as delimiter for String.split(), in
which capturing groups are returned in the resulting array, and the
protocol/scheme was not desired.
This commmit removes the need for two different regexes to match http(s)
URLs, adapting `_onPaste`'s code to work with the presence of the
referred capturing group.
task-3520513
closesodoo/odoo#136497
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
PURPOSE
Slightly modify various apps to improve the user experience. Changes include
notably labels and views fine tuning, roundings, and small css fixes.
SPECIFICATIONS
- Remove the decorator from the event list view as it's a bit confusing
- Ensure mailing KPIs are now shown with 2 decimal places
- Re-order the mailing stat buttons
- Improve the background / font colors of the cover block
- Improve the labels of:
- Title and confirm button of the /button and /link modals
- Confirm button when archiving a record
Task-3204554
closesodoo/odoo#128108
Related: odoo/enterprise#43937
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Prior to this commit, the area of top and bottom handles overlapped the
content according to the size of the overlay border.
This commit changes the way height is calculated to remove this overlap.
task-3368793
Part-of: odoo/odoo#132653
This commit adapts the draggable icon in the overlay button to improve
the readability.
This commit also adapts the "danger" background color of
`oe_snippet_remove` button to maintain consistency with the web editor.
task-3368793
Part-of: odoo/odoo#132653
Steps to reproduce the bug:
- Add a "Text-Image" snippet on the website page.
- Take an "Inner content" snippet from the right panel and drag it from
a dropzone to another. It has to be fast so that the order of the "over"
and "out" dropzone events is "over" > "over" > "out" and not "over" >
"out" > "over" as usual.
-> The exited dropzone is not correctly displayed.
The problem is that since [1], the website is inside of an iframe. Due
to that, the snippets menu does not have a direct access to the
dropzones. To solve the problem, the already defined `$dropZones`
variable is used instead of searching the dropzones inside the DOM. For
the snippet editor, the problematic line has been deleted at it is
already handled by `_outPreviousDropzone()`. This is acceptable since
the commit that introduced `_outPreviousDropzone()` ([2]) and the commit
that introduced the removed line ([3]) were both introduced to handle
the case of an "over" after an "over". In other words, as
`self.droppped` will always be `true` when
`self.dragState.currentDropzoneEl` is set and it will always be `false`
when `self.dragState.currentDropzoneEl` is not set, the problematic line
can be removed as it is already handled in `outPreviousDropzone()`.
[1]: https://github.com/odoo/odoo/commit/31cc10b
[2]: https://github.com/odoo/odoo/commit/c6886410603a16b6a3c5fe459d273dd883c110c7
[3]: https://github.com/odoo/odoo/commit/fed5854e32bcddf8b14b8311b2fe542eed990f77
task-3522552
closesodoo/odoo#137255
X-original-commit: 06fde42d3ba0e8be2128cda8e695c5def917f391
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Reproduction:
1. Install website
2. Change to edit mode and click a link on the main page, for example,
“contact us” at the bottom
3. click "Edit link" in the popover
Fix: use the variable `shouldFocusUrl` for link tool props update
task-3514360
closesodoo/odoo#137246
X-original-commit: af035687c57f8b34261beff121669ee044d9b7df
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Rodolpho Lima <rcdl@odoo.com>
This commit changes the public `parseHTML` utility function's signature,
in order to allow the use of the editor's document to create a document
fragment.
This aims to avoid mismatches in the prototype chain of HTML elements
created by such util and the ones present in the editable when the
editor is mounted in an iframe. This is of particular relevance for the
'insert' command, in which the node to be inserted is tested for
`instanceof` the editor's document global `Node` object.
task-3526134
closesodoo/odoo#136984
Related: odoo/enterprise#48108
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Since [1] when webp support was introduced, pre-converted images
(resizes and jpgs) are automatically created so that the images can be
used in PDF reports.
This only needed to be done for image fields - which can be referenced
in reports.
This commit limits the pre-conversion of images to images that are set
in image fields.
[1]: https://github.com/odoo/odoo/commit/0449fe85cb0e1d639a4e1aeba26e90906f79254d
task-3510621
closesodoo/odoo#137109
X-original-commit: cd0164339e5179177aaaf21b69615a71a8982da8
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Steps to reproduce:
- In website, paste a URL like "odoo.com" as plain text.
The expected result is a transformed link, just like it happens when
pasting is done in an html field (ex: project.task description), but
a simple text node is inserted instead.
The reason for this is that an element created by the iframe document's
`createElement` method has in its prototype chain the iframe context's
global `Node` constructor, which is a distinct constructor object from the
main window's `Node` constructor.
task-3521152
closesodoo/odoo#136597
X-original-commit: 392d78dab632f67721ec2ba8810d5c8053640b86
Related: odoo/enterprise#48136
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, when the Wysiwyg was used in a html form (like
website_forum), its `savePendingImages` method was not called. This
resulted in keeping pasted or dropped images as base-64 encoded sources
instead of converting them to attachments.
This commit ensures such conversion takes place.
task-3499058
closesodoo/odoo#137073
X-original-commit: 00aad6aa92c8ad476f9f78779b7a24cb5f7af2ff
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
Before this commit:
-Font size does not get applied to selected cells.
-Font style buttons were active when cells are selected.
After this commit:
-Font size can be applied.
-The font styles should not all be toggle by default.
task-3477490
closesodoo/odoo#137080
X-original-commit: 1d20abfbfd9f337f356c5a237edc713fb973b636
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Sanjay Sharma (shsa) <shsa@odoo.com>
By returning the `setSelection` value in the callback returned by the
`preserveCursor`, we allow better control for the caller over the fact that the
selection was effectively restored or if it failed.
task-3383561
closesodoo/odoo#126340
Related: odoo/enterprise#43087
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit replaces the `.jpg`, `.jpeg` or `.png` extension of uploaded
images to `.webp` when the image is converted to webp.
task-3460171
closesodoo/odoo#137022
X-original-commit: 77624c9eafc7f21a2ec5edcd3d56ee76e646fc38
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit makes the rpc call in the `loadImageInfo` method robust to
the case where an image src would be an absolute URL, by only
considering the relative part of the URL.
The images src are generally always relative but commit [1] wrongly put
absolute URLs to images in grid mode with the `_reloadLazyImages`
method. While this behavior was fixed by commit [2], the images that
were saved before this fix was available still have an absolute URL.
Hence the need to make `loadImageInfo` robust.
[1]: https://github.com/odoo/odoo/commit/cc406afcea7bf5846233a9f97a4a8ac5f618f3ec
[2]: https://github.com/odoo/odoo/commit/3528f2c3f9d3b30266f3421672986d202c724a76
task-3514519
closesodoo/odoo#136951
X-original-commit: af5ddabb0285daa9e57bc01cf21628f2f94bc18f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
LinkTools creates http links by default, while OdooEditor creates https
links by default on paste and auto link transformation with SPACE.
This commit standardizes the result of both mechanisms, adopting "http"
as the default protocol.
task-3516854
closesodoo/odoo#136487
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, when an existing link was edited with the LinkTools
or LinkDialog, the URL input field omitted the "mailto:" part of the URL
for email links, but displayed the protocol/scheme for http(s) links and
phone numbers (tel: or tel://).
This commit standardizes the behaviour of the referred input field such
that the protocol/scheme for http(s), mailto and tel URLs are omitted,
in order to have a cleaner UI.
task-3516854
Part-of: odoo/odoo#136487
When creating or editing a link via the LinkTools or LinkDialog, http
and email URLs can be deduced from incomplete user inputted URL (that
is, URLs not containing the http(s):// or mailto: protocol).
This commit extends such URL deduction to telephone numbers, allowing
the user to create a tel:// link without the need to explicitly write
"tel:" or "tel://".
Obs: "tel//:" protocol is preferred over "tel:" for the reasons stated
in [this] commit.
[this]: https://github.com/odoo/odoo/commit/56ce29e71f75a657d4b518d86c1d7084891e898e
task-3516854
Part-of: odoo/odoo#136487