Commit Graph
2834 Commits
Author SHA1 Message Date
qsm-odoo 20fd2e38c9 [FIX] website: restore simple drop zones
Commit https://github.com/odoo/odoo/commit/bb0cdec4594fab8c22265ed8af0c2d431a263b72#diff-e4ca107fe5c84ec39ba346fb90d1bdf6R76
added strange code affecting the whole editor when website_blog was
installed. To stay consistent, commit https://github.com/odoo/odoo/commit/80f54f563a3917828c5f67dfe9c44d0f6b0c5324
moved it in standard website and marked it as to review.

It is in fact the cause of a bug: *all* drop areas appeared with a big
editor text "Drag and drop a building block here" because of this code.

As a fix in stable, the problem was solved so that the code works as
intended: adding an editor message on a normal .oe_structure makes it
an .oe_structure.oe_empty automatically. Here in master, this code will
simply be removed and it will be up to the devs to not make errors in
their xml so that the editor messages appear. This commit in fact
keeps the "removing spaces" feature and enables it for all oe_structure.

Related to task-2210733

closes odoo/odoo#48463

X-original-commit: 5381e9d900b344e7d48a6b347c5fc551d433b15e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-27 09:59:28 +00:00
Romain Derie a3fa70fd5f [FIX] website_event: restore edit menu choice
Website has a behavior that will ask you which menu you want to edit if you
click on 'Edit Menu' in the topbar and there is more than one menu in the DOM.

This is typically the case for the event pages where the event has its own menu
on top of the website one.

This event menu was not triggering that behavior since 5b563549fa where is
was accidentally broken.

closes odoo/odoo#48459

X-original-commit: 5c3c91e4a8da7b7b9f5e05f9c0ec5a6dea782d87
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-03-26 16:44:32 +00:00
Benjamin Vray 34227348f0 [FIX] website: fix height and position of carousel indicators controls
In gallery snippet in carousel mode, fix the fact that the height of
the controls are bigger that the others squares and fix also the wrong
position of the indicators.

task-2162952

closes odoo/odoo#48380

X-original-commit: 9752596abfcae6b0bbf79ac675fe9e304a068a21
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-25 17:03:36 +00:00
Benjamin Vray e0dda5172e [FIX] website: fix an issue when changing width option in the gallery
As the container class now changes with the width option. We cannot use
this class in the js or css files anymore.

task-2162952

closes odoo/odoo#48377

X-original-commit: 1cf2ee35c2d85d87b27d5bd72c414e12fcbaf123
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-25 16:27:40 +00:00
Benjamin Vray 95f30739a8 [FIX] website: keep images order in gallery snippet with masonry mode
Keep the same images order as the other modes in the gallery snippet
with masonry mode. Before this commit, the images order was reversed
with masonry mode.

task-2162952

closes odoo/odoo#44486

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-25 15:12:29 +00:00
Benjamin Vray 7da747c627 [IMP] website: add position top in cookie bar and fix a bug
Add position top in popup snippet and cookie bar.
Properly center content when full size and position center because
before this commit the content was at the top and not centered.

Part of https://github.com/odoo/odoo/pull/46503
task-2194309

closes odoo/odoo#46503

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-24 16:07:26 +00:00
Benjamin Vray 079dac124a [IMP] website: move options in table of content snippet
Move position options in navbar.

Part of https://github.com/odoo/odoo/pull/46503
task-2194309
2020-03-24 16:07:22 +00:00
Benjamin Vray 9ebc9a1a44 [IMP] website: review snippet Share
Reduces margin on icons when layout is none. Add icon size options.

Part of https://github.com/odoo/odoo/pull/46503
task-2194309
2020-03-24 16:07:19 +00:00
Benjamin Vray efe8ea2676 [IMP] website: review progress bar snippet
Add an input field to define the value of the progress bar instead of
the previous system by mousedown. Disable animated by default.

Part of https://github.com/odoo/odoo/pull/46503
task-2194309
2020-03-24 16:07:14 +00:00
Benjamin Vray c87f61d26b [IMP] web_editor, website: copy absolute path for anchor links
Copy the absolute path in the clipboard instead of the relative for
anchor links. So the link still works if it is pasted on another page.

Part of https://github.com/odoo/odoo/pull/46503
task-2194309
2020-03-24 16:07:10 +00:00
Benjamin Vray a522e08273 [IMP] website: review timeline snippet
Removes option to move card to the right/left from the left panel
and add this option on the element overlay.
Makes the snippet responsive and other improvements.

Part of https://github.com/odoo/odoo/pull/46503
task-2194309
2020-03-24 16:07:06 +00:00
Benjamin Vray 85a604635c [IMP] web_editor, website: preview container width on hover
Preview the boundaries of container elements when hovering over the 3
width options.

Part of https://github.com/odoo/odoo/pull/46503
task-2194309
2020-03-24 16:06:59 +00:00
Cocographique 5dc2af38c3 [IMP] website: reduce space between icons in Rating snippet
Part of https://github.com/odoo/odoo/pull/46809
task-2182909
2020-03-24 13:14:14 +00:00
Thanh Dodeur 900dad016d [IMP] website, web_editor: add options to fully control shadows
task-2182909

closes odoo/odoo#46816

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-24 10:47:05 +00:00
Jeremy Kersten 94f8f15036 [FIX] website: make handle_visibility private
This commit:
   - make handle_visibility a private function (even if not
     exploitable in rpc easily since it uses request.website)
   - encrypt the password in db (even if not critic, since this
     password could be shared on twitter, ... it doesn't cost anything
     to secure it a bit more)
   - remove useless sudo, since handle_visibility does a sudo itself.

In the future, this notion of visibility should be handled on controller layer,
and no more on the View layer (during rendering)

closes odoo/odoo#48145

X-original-commit: 06e0e48217f25f17dff23331111f5dcb98e8cecd
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-03-21 10:23:32 +00:00
qsm-odoo 98c8438f52 [FIX] website: restore top menu transparent color option behavior
The option was not adapted correctly to the new left panel option
system, especially: not adapted to the use of a dedicated colorpicker
widget.

Part of https://github.com/odoo/odoo/pull/45093
task-2151408

X-original-commit: 39ed330ba635af7c81f03df2fdfe4309c95e05d9
2020-03-18 19:52:33 +00:00
qsm-odoo c66e0557df [FIX] website: use automatic color for transparent navbars
When enabling a transparent navbar on a specific page, the user can then
choose a bg color (class) to apply on the transparent navbar. That class
comes with an automatic text color... which was not correctly working
because BS4 overrides colors for nav-links.

Part of https://github.com/odoo/odoo/pull/45351
task-2151408

closes odoo/odoo#47896

X-original-commit: 2937358b63c23bd7e34da713ab4236fa340be0a9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-18 11:16:00 +00:00
Julien MougenotandMathieu Duckerts-Antoine e68d3bb09d [REF] *: Adapt all modules to new control panel
Adaptation of the code throughout all modules to properly instantiate the newly
refactored control panel and update it accordingly.

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 14:08:33 +00:00
Benjamin Vray 1a323596cf [FIX] website: restore hidden indicators in gallery snippet
Indicators were hidden in editor when switching to slideshow mode
from any other mode. Because the class of the selected mode was defined
after rendering and we need this class before the rendering. This also
fixes other small issues when switching between different modes.

Part of https://github.com/odoo/odoo/pull/44180
task-2162952

closes odoo/odoo#47519

X-original-commit: a99150b11a463901121bbe9751370231e3564ca2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-12 15:00:38 +00:00
Benjamin Vray 490723b406 [FIX] website: keep same spaces between carousel indicators links
Before that the space between the first two links was more spaced than
the others.

Part of https://github.com/odoo/odoo/pull/44180
task-2162952

X-original-commit: baeb08da7a32b5c185c358ec6820f8a66c6edb4f
2020-03-12 15:00:38 +00:00
Benjamin Vray b339310d31 [FIX] website: update links ids in duplicated carousel snippets
(+ gallery snippet in carousel mode)

Part of https://github.com/odoo/odoo/pull/44180
task-2162952

X-original-commit: 6237c59d607389cb0ed57694bb23b253f49805c8
2020-03-12 15:00:38 +00:00
Romeo Fragomeli ab2e3fdb7d [REF] *: add tour steps utils
This commit moves some step utils in a dedicated file and add new ones.
These steps will be very useful for the Main Flow Tour to avoid
duplicated code.

To do this, we also had to transform it into functions to allow
utils to call each other. Existing one are converted for
standardization purpose.

Note that 'WEBSITE_NEW_PAGE' wasn't considered as an util.
This is a very simple step only used twice.
2020-03-11 10:10:16 +00:00
fja-odoo 7e9482978a [IMP] website: add countdown urlpicker placeholder
No default url on countdown's urlpicker anymore. Only a placeholder.
Also redirect to homepage if no url.

Part of: https://github.com/odoo/odoo/pull/46640

task-2210358

closes odoo/odoo#47235

X-original-commit: a0d983e94e3681a3f3e55cc445defc1ec862c606
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-09 18:20:29 +00:00
fja-odoo 52ac740a09 [IMP] website: improve we-urlpicker behaviour
The urlpicker was not closing properly when a value was selected.

Part of: https://github.com/odoo/odoo/pull/46640

task-2210358

X-original-commit: 6f722d919cd650d5c0b1b9c4a878fd519267c348
2020-03-09 18:20:28 +00:00
Jeremy Kersten 614c9baae4 [REF] website: refactor reset_password tour
Previous implementation crashes randomly in chrome headless due to timeout.
Avoid to do web action, while we just want to check reset_password feature.

+ add one test that reset password on partner from website 2 to check that
link match the domauin from website 2.

closes odoo/odoo#47136

X-original-commit: d8019f25a5cd6ed611295e9b93111402f4cad04a
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-03-06 21:39:14 +00:00
Romain Derie 8066001ee4 [FIX] website: add test for 5ac269d722f
5ac269d722f fixed 7e2b0ebe799 that prevented the website menu to actually be
visible, since the JS in charge of displaying the menu was 'crashing'.

A test was missing to avoid that issue to appear ever again, since it is quite
a critical problem.

Note that it might look strange that breaking such a mechanism does not make
the runbot red, but since the menus are actually considered visible, the tests
are able to 'see' it in DOM and click on it.
They are actually hidden through an opacity 0 & height 0 while the JS process
them.

task-2093679

closes odoo/odoo#47138

X-original-commit: 0dc00a252dfe7fee658579a60dc7b1b1ca71a661
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-07 12:16:12 +00:00
qsm-odoo 05d17089c4 [FIX] web_editor, website: review default palette system
Before this commit, this was done:

1) Primary variables (app order):

(a) web_editor: define palettes (color + theme + gray), only 1 empty
                one. Mark the first ones as the selected ones.

(b) website: fill all defined palettes with the website-related
             color key and values (body, menu, logo-height, etc).
             + define "website values" palette.

2) Secondary variables (reverse app order):

(c) website: merge the user palettes on top of the selected palettes
             (so user values overriding values added in (a) and (b)),
             the resulting palettes are added in palettes lists and the
             selected palette numbers are set to select those ones.
             + final selection of "website values" palette.

(d) web_editor: final selection of the selected color palette amongst
                the color palettes.

--

The problem with all of this is that the definition of palettes
in themes (occuring between step (b) and (c)) never received the
website-related color key and values of step (b) and were thus forced
to redefine all of those by themself even if they wanted to use the
default website one.

This commit changes the system so that step (a) and (b) now define
"base" palettes (color, theme, gray, website values) and step (c) and
(d) now merge the final selected palettes with those "base" palettes.
This is in fact theoratically more efficient and allows to not force
themes to define every possible palette value we might introduce.

closes odoo/odoo#47097

Related: odoo/design-themes#216
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-07 11:09:36 +00:00
fja-odoo acdf3cf7f5 [IMP] website: add redirect icon to we-urlpicker
Add an icon to open the url the we-urlpicker currently holds in a new
tab.

part of: https://github.com/odoo/odoo/pull/45397

task-2197008

closes odoo/odoo#45397

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-06 16:25:34 +00:00
Jeremy Kersten 67868583ac [FIX] web_editor: avoid traceback on error
Revert of old editor (35b6182) has reintroduce code invalid.
Now the data is wrapped in message (f8fe314e7)

Remove guarded that raise a warning, it is the default behavior now.

closes odoo/odoo#46870

X-original-commit: 9d3a2903fd7bf946c033ec78e959e3ed86754845
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-04 12:34:31 +00:00
Cocographique 9800c89913 [IMP] website: improve images and layout of References snippet
Part of https://github.com/odoo/odoo/pull/46773
task-2191381
2020-03-03 16:12:23 +00:00
qsm-odooandCocographique 219b29c4e2 [IMP] website: improve edition of Showcase snippet
Also no more scss required for the snippet.

Part of https://github.com/odoo/odoo/pull/46773
task-2191381

Co-authored-by: Cocographique <nmi@odoo.com>
2020-03-03 16:12:23 +00:00
Cocographique 0730d4793a [IMP] website: adapt layout and styles of Text Highlight snippet
Part of https://github.com/odoo/odoo/pull/46773
task-2191381
2020-03-03 16:00:04 +00:00
Cocographique 266446284e [FIX] website: fix default indicators carousel style
Part of https://github.com/odoo/odoo/pull/46773
task-2191381
2020-03-03 16:00:04 +00:00
Thanh Dodeur 560e3af48a [IMP] web_editor, website: adds custom code to head and footer
This commit adds two buttons on the Theme side menu that allow users to
add custom XML to the head and to the footer of the website.

Part of #44633
task-2168391

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-28 13:48:39 +00:00
Romain Derie 4c57e5bb30 [FIX] website: typo in toastr 'Congratulations'
Missing a `s`. Congratulation > Congratulations (fdba9a878f).

task-2144335

closes odoo/odoo#46380

X-original-commit: 7d743029dde14fac18fb3b5331c43fe1d940a772
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-02-26 16:56:14 +00:00
Romain Derie 4206c1f225 [FIX] website: don't load ir.ui.menu in frontend until needed
Before this commit:
When logged in and navigating on a frontend page, the accessible `ir.ui.menu`
would be loaded in qcontext.
Loading those menus performs alot of SQL request, up to ~2.000 requests on big
databases such as Odoo.com for an user with a lot of access rights.
This is not a problem on low traffic website as this is ORM cached, but when
there is a lot of traffic, the cache is clear very often, thus this code only
is adding a lot of requests for no reason most of the time as the user is just
navigating without any intention of opening the application menu.

Note that this qcontext computation in frontend was pointless in enterprise as
the applications menu in frontend redirect to the backend without using it.

This commit removes that computation from the qcontext. The menus will be
computed and loaded only when the user really needs it, when he is about to
open the application menu.

closes odoo/odoo#46127

X-original-commit: 471ddf85ce619961e46fb281bf721968ff298d3b
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-02-24 15:43:32 +00:00
Romain DerieandJeremy Kersten 4eafd78847 [FIX] web_editor, website: handle date edition in all lang and format
Before d00c0e317, `Datetime` fields would be editable in frontend but would
have unexpected results, especially in non-English languages, for when the
english lang format had been changed.
It would also crash when saving non-English strings, such as `Lundi`.
For more details, see https://github.com/odoo/odoo/pull/44484#issuecomment-586850490

Since d00c0e317, only date displayed in lang format would be editable, which
case is Event page in Odoo 12.0. Everywhere else, the format is changed for a
nicer layout, either with `widget=XXX` or `t-options=YYY`, such as:
`<time t-field="record.date" t-options='{"format": "MMM d, yyyy"}'/>`
`<time t-field="record.date" t-options="{'time_only': 'true', 'format': 'short'}"/>`

When a date parsing crashes during editor save, the problem is not only that
the date can be saved, but the whole changes of the page are lost, as they
won't be saved either.

This commit attempts to fix every languages cases, regardless of the website
lang or user lang.
To do so, we store the date in the user lang format in a data attribute of
every date field in the DOM. Once the field is clicked (to edit probably),
that value will replace the one displayed according to the widget/options.
That way, dates will always be sent to the server in the user lang format,
avoiding any possible mismatch.

This whole fix apply to `Datetime` and `Date` fields.

opw-2183055
Closes #44484
Closes #45555
Fixes #44047

closes odoo/odoo#45725

closes odoo/odoo#45997

X-original-commit: c0db9bb8027ff926c619aebe6e0a5cdd05808232
Original-signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-02-21 18:57:59 +00:00
Ravi Singh f47b142a7a [FIX] website: debounce link dialog inputs to avoid useless page loading
When we edit a link on the website, the target page is loaded to find
the anchors. This occured at every typed character which was obviously
not efficient.

task-2187754

closes odoo/odoo#45831

X-original-commit: 06ae0b7b00c837733a9c67772007aee6712b246e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-20 14:51:13 +00:00
Samuel Degueldre b293ccc7c3 [IMP] website, web_editor: option to add columns on snippet without any
In the previous snippet cleanup, a lot of superfluous row > col were
removed in favour of having the bare content directly in the section,
this streamlines the interface and prevents having many useless UI
elements.

At the same time however, there are some snippets on which you might
want columns so that you can pull the content off-center and give the
block a background color independently of its containing section
(namely: the cover, title and text-block snippets)

this commit adds an option to add columns on those snippets (and remove
those columns completely if they're no longer wanted)

task-2120360

closes odoo/odoo#45712

X-original-commit: a44bfc4f7bba16d700650ecc2369fa1445ecbfb9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-19 14:48:55 +00:00
Samuel Degueldre 416500f6e3 [IMP] web_editor, website: add callback to editor clone and remove
We recently transitioned to async option methods, this allows us to have
better control on the order of execution in the edition workflow, and
among other things, keep the editor's UI in sync with the current state
of the DOM.

However, some snippet options (such as the number of columns option)
need to remove or clone portions of the DOM, and as such, trigger the
onClone or onRemove methods of the snippets contained in that portion if
applicable. Because these methods are defined on other options, we first
need to make sure all the snippetEditors for this portion are created,
which is asynchronous.

This commit adds support for an onSuccess callback to the
'clone_snippet' and 'remove_snippet' event handlers, such that options
can choose to be notified when the work has been done, allowing them to
wait for it before proceeding.

This commit also adapts the layout_column snippet option to make use of
that new feature, and remove code that was used as a workaround before,
ie: precomputing the expected number of columns after the clone/remove,
and using that number to adjust the width of the columns and update the
UI. We can now just wait for the clone/remove, and use the real number
of columns currently in the DOM.

closes odoo/odoo#45343

X-original-commit: c159d58ce9cfca4a44f159b18eb10d1138977e23
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-13 18:02:48 +00:00
Cocographique d0d3679daf [IMP] website: remove uppercase style on buttons in product list snippet
Part of https://github.com/odoo/odoo/pull/44980
task-2182907
2020-02-13 15:10:06 +00:00
Cocographique 2fa0f4bdb2 [IMP] website: review section margins and icon color in showcase snippet
Part of https://github.com/odoo/odoo/pull/44980
task-2182907
2020-02-13 15:10:06 +00:00
Romain Derie 968638aa1a [FIX] website: prevent undefined in publish toastr
d92f76592c introduced a toastr when publishing a record.
It was designed for the topbar publishing toggle button, but some other
templates ended up also using that feature.
As those templates were missing `data-description` which contains the model
business name, it would show `You've published your undefined`.
This is only related to a very few places having a publish button inside the
page.

This commit fixed that by ensuring every publish button template have the
necessary code.
Also, a fallback is added in case tha `data-description` is missing somehow.

task-2191735

closes odoo/odoo#45141

X-original-commit: 4ab6e36b739060eb16e97eac502fd087a072abf3
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-02-12 07:53:51 +00:00
Bhavita Bhattandjpr-odoo 4e340cc5f0 [IMP] website: improve code for duplicate and new page
in this commit, throw the wizard to enter the new page name, while duplicating
page button and new duplicate page button added in the page properties dialog.
updated the test case related to duplicate page along with duplicate menu
consideration.

task-2088546
closes #40085

Co-authored-by: jpr-odoo <jpr@openerp.com>
2020-02-11 15:30:10 +00:00
Bhavita Bhattandjpr-odoo 4e162a4e75 [IMP] website, website_link: improve frontend config screens
Following things are done in this commit:
1. changed some labeling and string for more readable and helpful to the user
2. added extra width to the text box
3. added publish/unpublish option for mobile view.
4. track page option auto-activated for any new page,event,job offer,course,
   blog.

task-2088546
closes #40085

Co-authored-by: jpr-odoo <jpr@openerp.com>
2020-02-11 15:30:00 +00:00
Samuel Degueldre 7cc6fdf365 [FIX] website_blog: fix next post loading animation
Previously, when clicking on the next post at the bottom of a blog post,
a spinning loader circle would always appear in the bottom left of the
screen in an incorrect position. This commit removes that spinner.

This commit also adds support for the half-screen cover size, which
until now would animate as though it was full screen. All in all this
just makes the transition animation much more seamless, which was the
point of having it in the first place.

task-2166790

closes odoo/odoo#44198

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-10 17:03:33 +00:00
fja-odoo 1ebc4661dc [FIX] web_editor, *: unblock editor after any option dialog closing
*: website

Some dialog promises were not resolved on close, blocking the editor.

closes odoo/odoo#44953

X-original-commit: 20f97470cdc59a817526305806e94b222f26a0f2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-10 10:54:02 +00:00
qsm-odoo ef03b02af6 [FIX] web_editor, website, *: editor notify method must be synchronous
* website_form

Some technical explanations:

The method became async because the `setTarget` call which was in there
became `async` since it performed an UI update. As this method being
async is a problem with some snippets, it is best to keep it synchronous
for now. For this, the UI update in `setTarget` is removed and becomes
the responsibility of the caller. Nothing relied on it except one code,
which is solved by calling `onFocus` before the UI update which occurs
on focus, as it is already the case in master.

closes odoo/odoo#44850

X-original-commit: 53bba0660237abbcadc9675fd89ec94a2a31e130
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-07 12:43:25 +00:00
Samuel Degueldre 91fb0d3020 [FIX] website: fix number of column option broken layout
Normally, the number of column option adjusts the width of each column
after changing their number so that they always fit in one row. In
previous versions, the sequence of the code was correct thanks to
jQuery's deferreds executing their then callbacks synchronously if the
promise was already resolved. However, native Promise objects always
put their then callbacks in the microtask queue, and this was resulting
in the column width classes being recalculated before their number had
actually changed.

This commit fixes that by calculating the width of the columns based on
how many columns there will be after addition/removal. It also
introduces a new field on the option that is used to update the UI so
that it displays the correct number.

closes odoo/odoo#44849

X-original-commit: 58804d6ea375629b07748bc442eaccc401c56d1b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-07 12:34:06 +00:00
qsm-odoo 6fb4ed44a0 [IMP] website, *: make theme custo options act as simple snippet options
* web_editor, theme_bootswatch

Instead of having an entirely dedicated system for theme options in a
third tab of the left panel, those theme options are now simple snippet
options. See the customizeWebsite generic method.

This allows to make any option available in the third tab or on any
meaningful element like the header or the footer. This also allows to
take advantage of all the features of the left panel: dependencies,
visibility update, etc.

Note: same as before, those changes do apply the color/size/layout
immediately on the website, even if not saved. Changing that behavior
is complex and might be the job of another task.

Part of https://github.com/odoo/odoo/pull/41166
task-2088298
2020-02-05 23:49:53 +00:00