Commit Graph
2354 Commits
Author SHA1 Message Date
qsm-odoo 930839c76b [FIX] website: remove data-editor-message attributes on save
When the edit mode is entered, some elements receive
data-editor-message attributes. These were not removed on save which
could in some cases make the attributes be saved in the database. For
this to happen it would require an `.oe_structure.oe_empty` element to
be put *inside* an editable element (instead of being the one which is
editable). In that case the `.oe_structure` content would be saved in an
inheriting view but the parent view would also be COW'd for no reason
because of that attribute.

Difficult to say if such a case exist in the current views but as it
technically possible and that some of our tests use that configuration,
it is worth fixing.
Note: this fix was in fact done in the new editor in master and allowed
to detect that one of our test was not testing a feature correctly
because of that. This will be adapted in a different commit of this PR.

closes odoo/odoo#30834
2019-02-06 09:49:11 +00:00
Romain Derie aef6a5aaed [FIX] website: specific view ID might also change on save
Commit https://github.com/odoo/odoo/commit/29075a8e2c734624cec4f6009185616634f70dea
was written while there was an incorrect behavior related to
multi-website, oe_structure_ID and edit mode in a rare specific case
(see the second commit from this PR for detailed explanation
https://github.com/odoo/odoo/pull/30834).

That rare case was detected in 12.0 since the tour did not work on
master with the new editor (that fixed the incorrect behavior).
Basically, it was COWing the edited view even if only an oe_structure_ID
was touched.

Indeed, when saving a specific view in the HTML editor, we should also
search for its possible new ID as it could change if we also edited its
generic parent. In that case, the view will be copied and then unlinked
to preserve inherit order on the new specific tree.
2019-02-06 09:49:11 +00:00
Romain Derie 326a44c3f7 [FIX] web_editor, website: consider COW view when loading view
Before this commit:
1. If we were editing a template with no xml_id, typically the case when
   editing a specific view (COW'd), the 'Template ID' label would be left empty
   as the view does not have an xml_id but only a key.
2. If we were editing a generic view, the template would be COW'd and replaced
   by the specific one created during the save.
   After the save, the page would be reload and will try to reopen the edited
   template (stored in url `res=123`). But as this template would be replaced
   by the COW'd view, the JS would crash trying to access an inexisting view.
   The HTML editor would then open in a very thin modal, barely editable.

Now:
1. Display the template's key instead of its xml_id. The key is basically a
   duplicate of the xml_id, mainly used in website.
2. If we are saving a generic view, we search for its newly created specific
   view to upload the URL hash before reloading.

task-1934279
Fix #30447
2019-01-29 16:06:23 +00:00
Romain Derie 751ea9634a [IMP] website: add tests for scss edition on html editor
As this behavior was recently broken (fixed in #30403), this commit
adds a test tour for that flow.

task-1934279
Fix #30447
2019-01-29 16:06:23 +00:00
Romain Derie 6bd579bd6b [FIX] web_editor: send the html editor writes one after another
With the following view hierarchy:
   A
   |
   B' (oe_structure_ID view)

Before this fix, when saving multiple templates at once from the same hierarchy
the COW views (website) would not be saved correctly as the first call to
`write` would COW the parent view, then the second concurent call to `write`
would create the child specific view under the generic parent view.
Instead, the generic parent should have been cloned to a specific parent view
and then the child view should be COW under the specific parent.

  A    A'
  |    |
  B'   B*' (This one is the old B', without B' changes in the html editor)

Instead of

  A   A'
      |
      B'

Calling the `write` one after another will do the trick. Indeed, when the
second call is fired, the first call has already triggered the COW behavior.
Thus, the second call correctly retrieves the COW view.

Another issue might still appear, if the parent view write is sent first.
Indeed, the parent view will be COW, thus the specific child view (second write
waiting to be fired) will be deleted to be added on the new specific hierarchy.
Thus, that write will then raise an error since the view does not exist anymore.

task-1934279
Fix #30447
2019-01-29 16:06:23 +00:00
Nicolas Lempereur c7a281d880 [FIX] website: affix menu no close frontend mobile menu
On mobile the frontend menu navbar is an hamburger menu that open on
click.

If the option "Customize > Main layout | Affix Top Menu" is
enabled, there is two menu:

- one at the full top of the page
- one affixed to the top of the viewport (only shown if we are at least
  scrolling 300px away from the top of the page)

But there is a side effect: when scrolling if the menu at the top of the
page is opened, it will be automatically closed => this makes sense to
avoid having two menu shown on the same page but is an odd behavior.

With this commit, the behavior is changed and when the menu is opened in
the top, the affixed menu is not shown (it only works if the top page
menu has no opened dropdown).

opw-1920310
closes #30564
2019-01-25 15:56:15 +00:00
Anshuman Sharma cd1d9824ab [FIX] website: solve alignment bugs in onboarding
- Fix the position of 'Add to menu' toggle button in new page dialog
- Properly align tip icon in the welcome message

task-1895287

closes odoo/odoo#29403
2019-01-16 10:16:44 +00:00
qsm-odoo 07e1a24368 [FIX] website: allow to remove jumbotron bg color
In the 'banner' snippet, there is a column using a white jumbotron
component. Those comes with a default background color so when using the
website builder to remove the white background, it did not go away;
it was replaced with the default background color (some gray).

This commit sets the default background color of jumbotron components to
'transparent'.

task-1889341

closes odoo/odoo#30099
2019-01-10 12:37:49 +00:00
Romain Derie d3a7edaec4 [FIX] web, website: set correct order on modal footer button
Since 12.0, some modal footer button order were changed. The primary button
would not be the one in the modal footer corner.

This is against bootstrap but more annoyingly, users are intuitively clicking
on the secondary button, ending up closing the modal and losing form
information they entered.

This commit simply fix the regression from 12.0 as before 12.0 these buttons
were positionned correctly.

Note that a commit in master (saas-12.2) will fix all the other ones that were
wrongly positionned before 12.0.

Step to reproduce:
  - Go to an event having the possibility to register.
  - Click on 'Register Now', a modal is shown to write details (name, email..)
  - You intuitively click on 'Cancel' as it is the bottom right button
    |________________________________ CONFIRM _ CANCEL _|
  - The modal is closed, if you try to open it again your infos are lost

Closes #29884
task-1922120
2019-01-08 12:50:24 +00:00
Jorge Pinna Puissant 149e04b10d [IMP] website: Explain scope of language in keywords in seo
When there is a website with traduction (for exemple, Spanish and
French). In the Spanish website, at the SEO menu, you can add keywords
using any of the languages (Spanish or French), but these keywords are
only added to the Spanish website.

To avoid misunderstanding between the website language and the keyword
language a tooltip is added.

closes odoo/odoo#29683
2018-12-20 14:05:01 +00:00
Jeremy Kersten 7afaf2c277 [FIX] website: seo - fix translation for seo modal
Lang / Context is implicitely added in the query using this._rpc

Before this commit if you set the title 'Title 1' for your website in the main
langage and after edit the title as "Title 2" in another language, it was the
main title that was replaced instead of the translation.

Now we use this._rpc that bind automatically the context and so the current lang
that we are editing.

closes odoo/odoo#29596
2018-12-18 09:22:49 +00:00
Christophe Simonis caf1837216 [MERGE] forward port branch saas-11.3 up to d4c65a7ede 2018-12-05 12:27:57 +01:00
Christophe Simonis d4c65a7ede [MERGE] forward port branch 11.0 up to 2156af480f 2018-12-04 17:11:57 +01:00
Xavier Morel bedd4be0ed [FIX] doc: line blocks to literal
closes odoo/odoo#29219
2018-12-03 10:59:34 +00:00
qsm-odoo 4f3635b2b1 [IMP] website, *: add event handler possibilities
* web

This commit introduces helpers for async handlers, especially for button
clicks. Those helpers are now used automatically for website widgets
(animations) if the 'async' word is placed in front of a handler name
in the `events` key definition.
2018-11-28 15:00:42 +00:00
qsm-odoo a153ed42a0 [FIX] website, *: properly clean website widgets
* web_editor

When an user saves its website, all the animations are destroyed so that
a clean DOM is saved. This is particularly important for snippets like
the latest post one that would crash the page if not cleaned before
saving.

Two cases were found where animations were not cleaned before saving and
this is what this commit fixes:
- When an user used the undo/redo system, all animations were lost as
  the DOM is recreated.
- When an user duplicated a snippet, animations were not restarted on
  the cloned element.

closes odoo/odoo#29159
2018-11-29 16:41:33 +00:00
Christophe Simonis cc8e8237bf [MERGE] forward port branch 11.0 up to 84500c27b1 2018-10-25 13:59:45 +02:00
qsm-odoo dea1372215 [FIX] website: restore options active system for carousel 2018-10-19 09:05:58 +00:00
qsm-odoo 9049892152 [FIX] website: add some more BS3 compatibility
Completes https://github.com/odoo/odoo/pull/27981

- Correct `col-*-offset-*` support.

- Compatibility for BS3-deprecated `visible-*` classes (only not taking
  care of table/table-row/table-cell cases as difficult with sass and
  those classes were already BS3 deprecated anyway).

- Correct order for BS3 `visible-*-*` and `hidden-*` classes (otherwise
  their combination are not correctly working). Also, the 'inline'
  version was forgotten by previous PR.

- Compatibility for BS3 `btn-xs` class.

closes odoo/odoo#28842
2018-11-22 14:09:22 +00:00
qsm-odoo 180de24df0 [FIX] website: allow publishers to save their website edition
On save, the editor will ask to parent widgets if something needs to be
done first. The website navbar will receive that demand and asks to its
action-capable components to do something. For example, the content menu
handles page-related options saving. However, some users with limited
access rights do not have the content menu... but the website navbar
expects that the save action is performed. So, this empty action is
defined here so that all users have an 'on_save' related action.

This was only happening since 12.0 as 'on_save' actions were introduced
there to save page-related options.

closes odoo/odoo#28810
2018-11-20 10:05:54 +00:00
qsm-odoo 931fb8f80c [FIX] website: recompute auto more menu on window full load
The previous code made sure we wait for images to be fully loaded before
initializing the auto more menu. But in some cases, it is not enough, we
also have to wait for fonts or even extra scripts. Those will have no
impact on the feature in most cases though, so we will only update the
auto more menu at that time, not wait for it to initialize the feature.

closes odoo/odoo#28684
2018-11-14 14:00:59 +00:00
qsm-odoo 6b9625e098 [FIX] website, *: enforce correct UI text-muted color
* web_editor

- Restore the preservation of Odoo text-muted color (the rule became
  !important with BS4 and had thus to become !important in the
  preservation mixin).
- Preserve base design in the "new content" menu (which now uses
  text-muted). Indeed, in some themes, the "new content" links were not
  even visible anymore.

closes odoo/odoo#28666
2018-11-14 10:59:34 +00:00
Goffin Simon 51982f9199 [FIX] website: Impossible to link an analytic account
Steps to reproduce the bug:

- Go to Website > Dashboard > Analytics and click on "Link my analytics account"
- Enter some data and save

Bug:

A traceback was raised: TypeError: website_set_ga_data() missing 1 required
positional argument: 'website_id'

opw:1905874

closes odoo/odoo#28636
2018-11-13 16:12:47 +00:00
qsm-odoo 4f9a0cb4fc [FIX] website: add some compatibility for old BS3
This commit adds a compatibility file which can be added on demand by
enabling its associated view. This will basically map old BS3 classes
and structures to the related style with BS4.

closes odoo/odoo#27981
2018-10-23 08:53:19 +00:00
qsm-odoo 0170639262 [FIX] website: restore customize menu loading
When opening the customize menu as soon as the page became visible, an
RPC crashed and the toggable options did not appear anymore. This
happened:

1) DOM is ready.
2) The user click on the menu.
3) At the same time, the customize menu is initialized (`attachTo`),
   its event handlers are bound and the async `willStart` method is
   called.
4) The event handler for the user click is called... and crashes as
   requires a variable which would have been set in the `start` method.

The bug did not appear in previous versions as the handler was not using
the standard system and bound the event handler "by hand" in the `start`
method.

Maybe `attachTo` should not bind event handlers before the `willStart`
method is completed; this would be a subject for the master branch. This
commit solves the problem by setting the required variable in the
`willStart` method instead of the `start` method.

closes odoo/odoo#28578
2018-11-12 12:53:44 +00:00
Nicolas Lempereur a403155dec [FIX] website: rtl on frontend when logged out
Before this commit, RTL on frontend was only enabled for connected user.

To have RTL, we add the direction on the element, and the RTL version of
the stylesheet for the applicable languages are generated thanks to rtlcss.

opw-1892757
closes #28434
2018-11-06 12:28:58 +00:00
qsm-odoo 566cece592 [FIX] website, *: review auto light and dark colors
* web, web_editor

The logic which chose if the user text color was supposed to be used as
bootstrap "dark" text color or bootstrap "light" text color
(https://github.com/odoo/odoo/commit/8b2dbd1441d6713d9072db03e8d3cb6c2246410f)
was fine when using the default theme with default bootstrap but was not
working as intended in some themes.

This commit also introduces a more accurate and complex method to
determine the correct contrasted color in most cases.

closes odoo/odoo#28468
2018-11-07 17:41:08 +00:00
qsm-odoo 0662a1948b [FIX] website: recompute carousel item heights on image loading
Some code is in charge of setting the same min-height for all items of
a carousel to the natural height of the tallest item, once the page is
loaded. This code was not working correctly in the case the natural
height of this tallest item depends on the height of one of its inner
image, as we have to wait for the image to be loaded in that case.

closes odoo/odoo#28159
2018-11-07 09:43:22 +00:00
qsm-odoo f906ab9124 [FIX] website: review action start on page loading
This commit fixes a bug introduced with https://github.com/odoo/odoo/pull/28251:
When opening the ace editor on page load thanks to the #ace-view-editor
URL hash, a JS error occurred preventing the editor to open.

This was due to the way actions were executed on page loading:
- Menu elements are initialized and can handle actions
- On initialization, the ace menu tried to launch the editor
- First, it asked that all widgets are closed (see mentioned PR)
- The website handled that action demand by asking everyone to close
  their widget
- The 'new content' menu tried... and failed as referenced a variable
  which would only have been created in the start method.

Conclusion: before handling actions, all action-capable widgets should
be started. This is what this commit does: when receiving an action
demand, we first wait for the action handler to be fully started. This
implied another change: before, many menus were waiting for the result
of an action to notify that their start method is finished... this
would cause a deadlock in the new system so those were removed, this did
not make much sense anyway (if the result of that starting action has to
be known, a dedicated event/method should handle that).

closes odoo/odoo#28364
2018-11-02 16:56:24 +00:00
Christophe Simonis 5e055a2afd [MERGE] forward port branch saas-11.4 up to f6ca72b3ce 2018-11-02 10:52:55 +01:00
Christophe Simonis a299517f83 [MERGE] forward port branch saas-11.3 up to 6136f0c02e 2018-10-29 11:56:32 +01:00
qsm-odoo 2768da5ce4 [FIX] website: fix ace editor interactions with other widgets
- The affix navbar went over the ace editor, preventing to save/close
- The ace editor went always under the new content menu

Now:
- The affix navbar is always under the ace editor
- The ace editor closes when the new content menu opens
- The new content menu closes when the ace editor opens

closes odoo/odoo#28251
2018-10-30 10:30:49 +00:00
len-odoo 25e82a5c68 [FIX] website: fix the date picker widget on the publish page dialog
When updating to BS4, the datetimepicker library was updated to
tempusdominus.js.
It expects the DOM to be slightly different to apply correctly.

opw 1896103

closes odoo/odoo#28073
2018-10-25 09:03:16 +00:00
qsm-odoo 74086da371 [FIX] website: clone correct slide on addition
When adding a new carousel item, the first one was duplicated instead of
the active one.
2018-10-19 09:27:28 +00:00
qsm-odoo 3704e9583b [FIX] web_editor, website: remove traces of CKE 2018-10-19 08:37:01 +00:00
qsm-odoo 720a129544 [FIX] website: make rounded option work with jumbotron 2018-10-19 08:37:01 +00:00
qsm-odoo cc780b5974 [FIX] website: allow to add/remove tabs in the new "Tabs" snippet
closes odoo/odoo#27815
2018-10-15 16:15:01 +00:00
qsm-odoo 574450bad8 [FIX] theme_bootswatch, *: prevent website to interfer with bootswatch
* website

Default web_editor/website colors and other bootstrap related variables
took precedence over some bootswatch overriddes. While we have the
control with Odoo themes, theme bootswatch is a library we do not want
to modify. This commit removes the web_editor and website customizations
when bootswatch is installed.

Closes https://github.com/odoo/odoo/issues/27821

closes odoo/odoo#27855
2018-10-16 14:26:37 +00:00
qsm-odoo 3b4eeee5ca [FIX] website: restore carousel item behavior
The animation that made all the carousel items have the same height
automatically was broken. This commit fixes it and improves its behavior
during edition.

closes odoo/odoo#27801
2018-10-15 13:20:29 +00:00
Dharmraj Jhala 50b506996d [FIX] website: hide 'DateRangeButtons' inside SearchView on small device
In website dashboard, 'DateRangeButtons' are pushed into control panel's
SearchView and breaks the UI in small devices.

This commit fixes the issue by hiding them in small devices.

task-1884038

closes odoo/odoo#27082
2018-10-16 12:08:54 +00:00
qsm-odoo 8b2dbd1441 [FIX] website: handle light colors as body text color
Before this commit, if the user chose a light color for the text (with
a dark color for the body for example), that color was also used for the
automatic "dark" color, leaving the "light" color to the default $white.
That means that when a light snippet background was set, the automatic
color which was used was the light color the user chose. We want to
invert the system in that case: use the user color as the "light" color
to use over dark backgrounds and leave the "dark" color to the default
$gray-900. This is what this commit does.
2018-10-01 21:33:32 +02:00
Christophe Simonis 43b63a0465 [MERGE] forward port branch saas-11.4 up to 57e387b645 2018-10-01 16:01:54 +02:00
qsm-odoo 517e84111a [FIX] website: properly allow multiple s_tabs snippets per page
Before this commit, the nav-tabs IDs/urls/... were the same when that
snippet was added multiple times or duplicated. Now, the IDs are
recomputed everytime a new .nav-tabs appears.
2018-10-01 15:07:50 +02:00
Christophe Simonis 998723b909 [MERGE] forward port branch saas-11.3 up to e980af9df0 2018-10-01 11:27:51 +02:00
qsm-odoo 1f1987d0e3 [FIX] web_editor, website: adapt to transparent color
- Adapt used-in-the-page color behavior
- Add transparent image for theme customize dialog previews

See https://github.com/odoo/odoo/commit/5ba0216b746a16b4609bc9c147fcacad109e969a
2018-10-01 11:01:34 +02:00
Andrea Ulliana 5ba0216b74 [FIX] web, *: support opacity in colorpicker dialog
* web_editor, website

Add an opacity slider and an opacity input to control opacity over
the chosen color.

task-1887571
Closes https://github.com/odoo/odoo/pull/27289
2018-10-01 11:00:54 +02:00
qsm-odoo 55131b8f5b [REF] website, *: add automatic context for call_kw rpc
* web_editor, website_blog, website_crm_partner_assign, website_links,
  website_livechat, website_mail_channel, website_mass_mailing,
  website_slides

Calling a model's method thanks to an RPC will now always send the
web_editor context automatically, making sure the method gets the
website_id all the time, removing the need to guess the current website
(now the get_current_website method uses the context website_id if any).

Note: other routes already have the website_id via request.env.context
if they correctly set website=True (this commit also adds website=True
for scss files customization routes).
2018-09-30 19:55:17 +02:00
Sébastien Theys 79e56bddc9 [IMP] website: add default social share image
Allow to specify another image than the logo as default share image.

This commit closes #27297
2018-09-28 21:28:20 +02:00
Jeremy Kersten 64719b71d5 [FIX] website, website_sale: add bg-{color}-light
And use it in confirmation payment card

FP request
2018-09-27 13:13:38 +02:00
qsm-odoo 86e6345095 [FIX] website: allow choosing a body background in full layout
Previous system was strange: you were able to choose a body color but
not a body background when you were in full layout mode.
As transparent colors will soon be able to be chosen by the user, it
makes even more sense to give that possibility as the user can set a
body background pattern and a transparent footer color to let it
appear. Choosing a transparent background image which will be mixed with
the body color is also a common feature.

Also changes boxed layout option to use a white background for the boxed
content (we should maybe give the opportunity to the user to choose that
color instead of using always white).
2018-09-26 21:08:35 +02:00