Tuesday, July 14, 2020
3 changes · master
Resolved issues and error corrections
This update prevents the page editor from crashing when users drag and drop content on pages without a header. It makes the editing experience more reliable across websites and other editor contexts where a standard page header is not present.
Original PR description
Commit [1] introduced the bug by relying on the fact an element with id=top is in the edited DOM. As the website header can be disabled, this induced a crash as soon as the header was indeed disabled. Also, the editor is not meant to edit the website only so we cannot rely at all on the presence of a #top element. [1]: https://github.com/odoo/odoo/commit/6df67a28c2f113572acd4a3db19ab6b1bd37e7da
This fix ensures that template customizations build on earlier customizations instead of accidentally ignoring them. It improves consistency for screens and components that rely on layered template changes, reducing unexpected display differences.
Original PR description
[FIX] web: qweb inheritance Before this commit, defining a extension of a template by using the combination of directives 't-name' and 't-extend' ignored potential extensions that could have been…
[FIX] web: qweb inheritance
Before this commit, defining a extension of a template by using the
combination of directives 't-name' and 't-extend' ignored potential
extensions that could have been defined beforehand.
For instance, let's assume the following templates.
```xml
<t t-name="a">
<div><span>1</span></div>
</t>
<t t-extend="a">
<t t-jquery="span" t-operation="replace">
<span>2</span>
</t>
</t>
<t t-name="b" t-extend="a">
<t t-jquery="div" t-operation="append">
<span>b</span>
</t>
</t>
```
Rendering template "b" displayed "1b" whereas we would expect "2b".
Moreover, when the extended template is itself an extension of
another template:
```xml
<t t-name="a">
<div><span>a</span></div>
</t>
<t t-name="b" t-extend="a">
<t t-jquery="div" t-operation="append">
<span>b</span>
</t>
</t>
<t t-name="c" t-extend="b">
<t t-jquery="div" t-operation="append">
<span>c</span>
</t>
</t>
```
Rendering template "a" displayed "a", template "b" displayed "ab",
but template "c" displayed "ac", whereas we would expect "abc".
With this commit, other extensions done to a template are kept when
a new extension is defined. It relies on the templates order, and
takes into account all extensions that have *already* been defined.Contact cards now handle fields added below the city or country area more reliably. This prevents custom fields created with Studio from disappearing when both city and country are filled in, improving consistency for users customizing contact views.
Original PR description
Issue - Install "Studio" and "Contact" apps - Edit with Studio the Contact Kanban View - Add field under city/country Field appears only if no city is set. Cause The new field has as anchor the 5th <li> with the field country who will appear only if not city is set. However, in case there a city AND a country, the 6th <li> will appear instead of 5th (the target one). Solution Let only one <li>, one country and one city field but with the right conditions. opw-2288545