This test is ran in the backend and, if we do not mark it as post
install, the dependencies of the web module are not installed.
The webclient will then errors like "View type 'kanban' is not present
in the view registry".
The code for page creation from menu edition dialog was there but
invisible to the user because of a wrong qweb template inheritance.
Indeed, the edit menu dialog relies on an extension of the link dialog
template. But this one is extended in-place in another location and
that extension is not considered when the second extension is made
because a t-extend always use the base template. The only solution to
achieve the same result is to copy the edit menu dialog qweb extension
in Javascript.
Note: the feature was still available from the link dialog in page
edition though because this was not concerned by the wrong qweb
extension.
However, adding a page by this way would create multiple pages because
one was created each time a page name was entered (and not only on
save !). So typing "test", then changing its mind and typing "hello",
then rechanging to "test", then hitting the save button created the
"test, "test-1", "test-2" and "hello" pages.
This fix takes advantage of an already present parameter which can
determine if a new page should be created or not. However, a code
refactoring should be done in master for these classes.
This reverts commit f38f8930f0.
Revert for internal choice. Odoo want to use qweb in template and remove jinja support on next version.
If users want to use jinja they can change the view to use text widget instead of html widget.
The preview change the content because the browser try to fix the dom.
If a user use jinja and activate the preview, the jinja code is (re)moved by the browser and broke the template.
The html_translate fields (e.g. website_descripton on product.product) were not
serialised and the raw value from the web_editor was saved as a translation.
This was an issue in case of special characters that may be present in the
translation. A translation containing non-breaking space was sent in html
(`foo bar`) while lxml converts such characters to unicode (`foo\xa0bar`).
When writing a translation, the value is checked against incorrect format using
```
value0 = field.translate(lambda term: None, record[fname])
value1 = field.translate({trans.src: trans.value}.get, value0)
value2 = field.translate({trans.value: trans.src}.get, value1)
if value2 != value0:
raise ValidationError(_("Translation is not valid:\n%s") % trans.value)
```
As value1 is the unicode version of the translation and `trans.value` is the
html version of the translation, the last substitution in the callback method
was never made and the ValidationError was raised.
This commit forces the serialisation through lxml to be sure the compared
strings are using the same parser instead of comparing value from summernote and
lxml that may be both valid but still different.
opw-675767
There are not cat... but you cannot know all the existing website in the world...
So, have faith in the user !
To do: allow to customize size or get it from iframe provided
The class modal-open on body tag allow to scroll on the modal content
which is useful if the content is taller than the window viewport.
When closing the modal, this class is removed but there may be another
modal open on which we will not be able to scroll to view
buttons/content if too big.
This commit check if a modal is still opened after closing an editor
modal and in the affirmative add back the modal-open class.
opw-674475
note : was already present in 8.0 with ec47493, it is also present for
web.Dialog (but the modal of the editor do not inherit from web.Dialog)
This issue happen for example on a full runbot when clicking with
shift + key pressed on a sale order not in an editable.
We can see that initial_data.rect is only defined in mousedown when the
click target is inside an editable block, hence it could lead to an
issue otherwise.
closes#11527
Before 9.0 web_editor separation in 8c55904, some style would make
inline button be visible over topbar.
This commit reintroduce that and also make the margin over the inline
editor content a little bigger (so the inline buttons on the top of a
content will cover a little less the topbar).
closes#11526
opw-671649
Some image functionalities of the inline summernote would only take the
first of multiple editor into account when selecting the targeted image
of an image button action (image size, image padding, ...).
This commit select the appropriate editor given the current editable.
closes#11474
opw-668861
- Issue: Edit sale.order form view, add new line, change product who have
taxes and click quickly on save (with slow network) => error message.
Because some deferreds are lost.
- reduce number of reads and onchange for x2m widgets
- remove before_save method and use commit_value (the issue was that if the
before_save and the change trigger an onchange, the onchange deferred is not
checked before saving the content.
Before 3959afc the `node` tested would be the selection containing node,
but since then it may have been a `<br/>` which has some damaging
effects: now entering double enter at the end of a list, quote or code
block doesn't end this block.
Testing the use case corrected by 3959afc, the said change seems to have
no effect so this commit reverts it.
opw-667618
In IE11 the values can be not string (for example a number and so not
have .indexOf method), but then there will no be !important bits and we
can just ignore this feature (which check if an overriding rule has an
!important flag).
There was another edge case when getting a "" set style, we get undefined.
opw-667917