Commit Graph
1282 Commits
Author SHA1 Message Date
qsm-odoo 6bd601475f [IMP] web_editor, *: edit all pictures on double click
* 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
2018-07-11 10:37:16 +02:00
qsm-odoo 2c966909e2 [FIX] *: fix some side-effects of https://github.com/odoo/odoo/commit/9de1bc0eef6f5bfaa2a8d745431caa361ae91548
- 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.
2018-07-09 11:59:30 +02:00
kujiu f90cf060a3 [FIX] Syntax of icons (#25577)
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.
2018-07-04 09:55:52 +02:00
Christophe Simonis 49edee1f4b [MERGE] forward port branch saas-11.4 up to d54a3726ec 2018-06-29 12:46:00 +02:00
Christophe Simonis c8bb02141d [MERGE] forward port branch saas-11.3 up to 3cdcbce93c 2018-06-28 19:01:52 +02:00
Christophe Simonis b06af028e6 [MERGE] forward port branch saas-11.2 up to d112a163cd 2018-06-28 10:55:12 +02:00
Christophe Simonis d112a163cd [MERGE] forward port branch 11.0 up to f6d36d81f7 2018-06-28 10:32:03 +02:00
Christophe Matthieu 39f0f5db77 [FIX] ir_qweb: send template options in context to the fields
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
2018-06-27 15:11:37 +02:00
Christophe Simonis 40836194c2 [MERGE] forward port branch saas-11.2 up to 12ddec3a76 2018-06-27 13:41:00 +02:00
qsm-odoo 22c9d60ad3 [FIX] web_editor: properly save media dialog without any image
Commit https://github.com/odoo/odoo/commit/50418c481182cb414792da32f2a0529503e59f9c
was correctly forward-ported up to 11.0. This commit fixes the
forward-port from saas-11.2.
2018-06-27 12:42:44 +02:00
Christophe Simonis 12ddec3a76 [MERGE] forward port branch 11.0 up to 152519cd65 2018-06-27 11:37:52 +02:00
Odoo Translation Bot 33e18a0051 [I18N] Update translation terms from Transifex 2018-06-27 11:22:41 +02:00
Ivan Yelizariev 5cecd0a197 [FIX] web_editor: restore website context for assets editor
The assets editor controller was stripped of the website context with
https://github.com/odoo/odoo/commit/198673bf35f14e3a797d2ff09208a289e12bec4e

It was however needed by some client customizations.
2018-06-26 12:58:00 +02:00
Martin Trigaux cb00803473 [I18N] export saas-11.3 translations
To odoo-master Transifex project
2018-06-25 10:33:05 +02:00
Odoo Translation Bot eef2426c10 [I18N] Update translation terms from Transifex 2018-06-24 07:04:15 +02:00
Odoo Translation Bot f9737d79e7 [I18N] Update translation terms from Transifex 2018-06-24 04:09:30 +02:00
kujiu 9de1bc0eef [IMP] Improve compatibility with screen readers (accessibility) (#24574)
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
2018-06-22 21:22:21 +02:00
qsm-odoo a17cd93864 [FIX] web_editor: allow recropping a newly cropped image
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.
2018-06-22 17:09:54 +02:00
qsm-odoo 6209b12937 [FIX] web_editor: do 'reset' crop feature when changing ratio
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/
2018-06-22 17:09:54 +02:00
Nicolas Lempereur cb047ae69d [FIX] web_editor: keep border when side style differ
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
2018-06-22 14:25:36 +02:00
qsm-odoo a473453b31 [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.
2018-06-21 12:59:16 +02:00
qsm-odoo cd812bd6f4 [FIX] web_editor: fix saving and restoring of crop aspect ratio
When an image was cropped and saved with a specific aspect ratio,
it was not restored properly on further crop editions.
2018-06-21 12:58:33 +02:00
qsm-odoo a9366de8f9 [FIX] web_editor: do not show cropped images in media dialog
Cropped image attachment were not meant to appear in the media dialog,
only original ones.
2018-06-21 12:58:03 +02:00
qsm-odoo bf64efb5a0 [FIX] web_editor: do not 'reset' crop feature when changing ratio
Before this commit, when the user changed the ratio option in the crop
dialog, the image zoom/rotation were reset for no apparent reason.
2018-06-21 12:56:38 +02:00
qsm-odoo a04b79a205 [FIX] web_editor, *: properly remove DOM portions in a snippet
* 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, ...).
2018-06-21 12:54:17 +02:00
qsm-odoo f6bbc40fbe [FIX] web_editor: reset snippet editors on snippet move
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.
2018-06-21 12:54:17 +02:00
Christophe Simonis 68326b15f9 [MERGE] forward port branch 11.0 up to c5ed372970 2018-06-21 12:18:40 +02:00
Christophe Simonis c5ed372970 [MERGE] forward port branch saas-15 up to 152d42041e 2018-06-21 10:57:42 +02:00
qsm-odoo f01a0bc04c [FIX] web_editor: allow to empty a style file with the editor
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.
2018-06-20 13:18:16 +02:00
Christophe Matthieu cf15030ed0 [FIX] web_editor: convert link to send by email
Don't convert in table btn-link, and center the button
2018-06-19 16:57:04 +02:00
Kishan Gajjar 47b5c00181 [FIX] web_editor: properly compute scss files
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
2018-06-18 12:09:49 +02:00
Odoo Translation Bot 94e49c251a [I18N] Update translation terms from Transifex 2018-06-17 04:40:39 +02:00
Christophe Simonis 9f84707653 [MERGE] forward port branch saas-11.4 up to a935d5bc83 2018-06-15 16:03:31 +02:00
Christophe Simonis 73652a0b19 [MERGE] forward port branch saas-11.3 up to 50860317cc
Note: 1aacc96262 has been ignored and will
be forward-ported later
2018-06-15 13:27:27 +02:00
Christophe Simonis 50860317cc [MERGE] forward port branch saas-11.2 up to b170a753e1 2018-06-15 11:30:27 +02:00
Christophe Simonis b170a753e1 [MERGE] forward port branch 11.0 up to b05e4d5f95 2018-06-15 10:15:27 +02:00
Christophe Simonis b05e4d5f95 [MERGE] forward port branch saas-15 up to a53bea49fe 2018-06-14 21:28:39 +02:00
Christophe Simonis 803df909b1 [MERGE] forward port branch saas-14 up to 804d68efe5 2018-06-14 18:05:38 +02:00
Christophe Simonis 804d68efe5 [MERGE] forward port branch 10.0 up to 23a1bce2a9 2018-06-14 18:03:26 +02:00
Christophe Simonis 23a1bce2a9 [MERGE] forward port branch 9.0 up to 90165e2d96 2018-06-14 17:29:56 +02:00
qsm-odoo 50418c4811 [FIX] web_editor: properly save media dialog without any image
When saving the media dialog without any selected image, a crash
occurred. Now, it properly closes the dialog.

opw-1858614
2018-06-14 10:47:38 +02:00
Nicolas Lempereur c4ddf55880 [FIX] web_editor: link don't duplicate child text
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
2018-06-13 16:20:40 +02:00
Xavier Brochard b10e34ed1a [FIX] web_editor: add <em> as inline tag and remove duplicate strong
This commit closes #24818
2018-06-13 14:56:16 +02:00
Jeremy Kersten 4fe0981c33 [FIX] web_editor: remove website dependence introduced by 4f9d9d169f
Now we use the get_view_id method that already do the job to filter the views
based on the current website.

Related to #24429
2018-06-13 11:14:02 +02:00
Ivan Yelizariev 4f9d9d169f [IMP] website: multi-website snippets with the same key
Allow duplicate snippets to have different versions for different websites

This commit closes #24429
2018-06-11 12:45:09 +02:00
Odoo Translation Bot 11515e14f7 [I18N] Update translation terms from Transifex 2018-06-10 00:27:35 +02:00
Christophe Simonis 2ab7ad8361 [MERGE] forward port branch saas-11.3 up to c00df14654 2018-06-07 11:43:07 +02:00
Christophe Simonis 969eb3fa2f [MERGE] forward port branch saas-11.2 up to c834c0f587 2018-06-06 15:46:36 +02:00
Christophe Simonis 116826e02d [MERGE] forward port branch 11.0 up to e7aff3775f 2018-06-06 10:47:53 +02:00
Tomas Alvarez 1db6c8d0ad [FIX] mail, web_editor: allow tel links in email templates (#24926)
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
2018-06-06 09:57:53 +02:00