* website_sale
Images which were related to a model's field were able to be edited
by a simple click on them. This prevented the use of the "Customize"
menu and was inconsistent with the edition of "normal" pictures which
occured on double click.
task-1859807
- JS Modals were not correctly built anymore, their .modal-body element
was duplicated and many without-effect JS lines were introduced (as a
side effect, the form view design was broken when inside modals)
- Tests were changed to make bugs go unnoticed. For example, the media
dialog functionnality was entirely broken because the .modal-dialog
element was not receiving the correct class anymore.
- The JS translation function is _t, not _
- Do not use the <title/> tag as a regular DOM element, it is meant to
be unique, in the <head/> section
- CSS rules were added to the utils.scss file, which is meant to contain
functions and mixins, otherwise, the rule is duplicated in every asset
- Some icons were still broken, as missed by https://github.com/odoo/odoo/commit/f90cf060a3cfeb37a67bec83264c0aaab8892b56
- Tests were changed to use [role="dialog"]/footer/header in their
selectors without any reason, this commit restores some of that to
avoid rebase conflicts with the BS4 work.
- ...
Note: other elements should still be discussed, like the direct use of
the 'o_form_label' class in views definition... but those do not cause
direct problems.
Description of the issue/feature this PR addresses:
Accessibility improvements forbids the use of the syntax
`<i class="fa fa-check"/> Some text`
to create a labelled icon. But, by this, some fonts are changed.
Desired behavior after PR is merged:
The old syntax can be used.
Application of a fix more specific to the problem of the contact widget
which can not serialize the dictionary because it contains the values of
the context of which browse record. (because contact try to
json.dumps options for multi-edition feature in web_editor)
opw-1859848
https://github.com/odoo/odoo/commit/ab85e9594651fd33ffd2747f4d3c5b360e7c7922
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable.
This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader.
* [IMP] Labels must have a for attribute. Improve accessibility.
* [IMP] Better error message when trying to read a missing cached value
* [FIX] Add some aria-label and title attributes for screen readers.
* [FIX] Template name is not included in the error message in case of SyntaxError in QWeb
* [FIX] Improve the Tour failed at step error message to be more explicit.
* [IMP] Add aria-labels
* [FIX] Add missing aria-label on failing test
* [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all.
* [IMP] Color names on kanban views and many2many tags
* [IMP] Add some checks on views for accessibility.
* [IMP] Add `alt` attribute on `img` tags.
* [IMP] Add aria-label and title on non-described icons
* [IMP] Add button role to widgets with btn class
* [IMP] Translate aria and formatted attributes.
* [IMP] Remove wrong aria-labelledby
* [IMP] Add menu role on dropdowns
* [IMP] Buttons must be focusable
* [IMP] Add aria attributes on progress bars
* [IMP] Improve accessibility of basic widgets
* [IMP] Change main layout to more semantic tags
* [IMP] Add menuitem role when missing
* [IMP] Remove wrong role='presentation'
* [IMP] Improve accessibility of tab panels
* [IMP] Add aria-invalid on invalid fields
* [IMP] Add aria-sort on ordered columns
* [IMP] Add role on alerts
* [IMP] Use dialog role, header, main and footer tags for modals
* [IMP] Add labels on o_status
* [IMP] Improve accessibility of kanban view with feeds and articles
* [IMP] Add alerts in case of new messages
* [IMP] Add widget, navigation or img role to aria-labelled items
Since https://github.com/odoo/odoo/commit/a473453b3166a381130d9bd6ec4851b9e1ecab26,
a newly cropped image gets a base64 src until the user choose to save
the page (where we create an attachment for the cropped picture). The
problem is that when reentering the crop edition at once... it was not
able to be performed because we did not handle base64 images there.
This commit solves this and accidentally adds a feature: allow cropping
base64 images.
This reverts commit bf64efb5a0.
Indeed, it was in fact necessary as more complex bugs of the library
can appear if we do not reset before. They even do that themself in
their library demo: https://fengyuanchen.github.io/cropperjs/
Since e94702d8 when transcoding an element for the purpose of sending it
by mail, if the element had:
border-bottom-style: solid;
in the CSS resulting from classes, it would be simplified to:
border-style: 0 0 solid 0;
which is wrong since 0 is invalid for border-style, the default being:
none
opw-1852839
closes#25423
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.
* website, website_mail_channel
Before this commit, when using the 'number of columns' option from a
column's snippet editor, the snippet overlay remained floating in the
void if the current column was removed by the option. This was because
the option did a simple "destroy" on the column without caring about
the snippet editors.
This commit introduces a new event which can be trigger_up'ed to ask
the editor to properly remove a DOM portion (destroy related editors,
call the 'onRemove' callbacks, ...).
As indicated in a code comment, destroying and rebuilding all snippet
editors when a snippet is moved is more accurate as the snippet options
may depend on the new locations in a way the 'onMove' callback cannot
handle. That operation seemed however too costly for no visual benefit
at the time. Now, not implementing it is a source of bugs and redundant
code (as with the new "number of columns" option which is not properly
updated once a column is moved in another row), so this commit
implements the feature.
This also allows for some improvement: the 'cleanForSave' part of
snippet editors is always performed when they are destroyed.
If this proves to be ok and safe, we might want to backport this in
previous versions.
Before this commit, if the user opened the LESS editor and emptied a
file, he may get a compilation error (as intended if the file contained
necessary variables and stuff) but this error also prevented to open
the editor again because some code tried to decode an empty content.
Now, when a file is emptied it is set to an unique line feed.
In LESS, 'fadeOut' function is used to make a color more transparent.
In SCSS, that function is called 'fade-out'.
Closes https://github.com/odoo/odoo/pull/25233
If we applied a link eg. on:
```
<span>hello <b>world</b></span>
```
The system actually gets the "label": hello worldworld because there is
3 nodes:
text node: hello
element node: `<b>world</b>`
text node: world
Also since "hello worldworld" is different than "hello world",
instead of just keeping existing nodes and adding the link, the system
would replace the selected range by:
`<span><a>hello worldworld</a></span>'
instead of:
`<span><a>hello </a><b><a>world</a></b></span>`
This commit ignores element nodes when creating a new link, since when
getting the label of the link from the selection, only the text nodes
insides the element nodes have any interest.
There was a second issue because if we had:
```
<i><a href="hello">world</a></i>!
```
and tried to put a link over "world!", the code would decide: "world" is
inside a link so we will just update that link.
Thus we would get:
```
<i><a href="hello">world!</a></i>!
```
instead of:
```
<i><a href="hello">world</a></i><a href="hello">!</a>
```
opw-1848351
closes#25187
Before this commit: links like `tel:+1-555-555-5555` were being replaced
both in javascript (prefixing `http`, when using the summernote editor)
and python (prefixing the base url, when they were added directly to the template).
After this commit: the replacement is avoided on links with `tel` scheme.
This is related to commit: 8b97a39