Commit Graph
4822 Commits
Author SHA1 Message Date
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
Odoo Translation Bot c487d2c26c [I18N] Update translation terms from Transifex 2018-11-21 09:40:22 +01: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 551eb34f92 [FIX] website: improve COW feature readability
This commit only re-indents the COW feature code and adds comments to
help understand its tricky parts. Also evaluate the 'no_cow' flag only
once per write.

closes odoo/odoo#28753
2018-11-19 09:39:37 +00:00
Odoo Translation Bot b60f9bb739 [I18N] Update translation terms from Transifex 2018-11-18 01:28:38 +01:00
Christophe Simonis 4b8bd36219 [MERGE] forward port branch saas-11.3 up to bab2a191d2 2018-11-16 15:39:02 +01:00
qsm-odoo ec7aa3c1f1 [FIX] website: properly enable a website view from its generic view
Before this commit, when enabling a generic view from a specific website
context and that view already had a specific view for this website, the
view was duplicated again instead of writing on the already existing
specific one.

This is because we did not consider inactive views when checking if a
view that is being written already has a website-specific view.

closes odoo/odoo#28743
2018-11-16 10:03:13 +00:00
Christophe Simonis 15f686eef6 [MERGE] forward port branch 11.0 up to 468dab6748 2018-11-15 20:39:10 +01:00
Romain Derie 410c07283b [FIX] website: set inherit_id on child COW for view validation
Before this commit:
1. If a view A is being inherited by a view B and C and the view C is doing an
   xpath on B (but inherit A), then copying the tree to make it specific would
   crash.
   Indeed, when copying C, the view inheritance check (while doing the xml
   check) would break since C would be tested against the generic tree and not
   the new specific tree.
2. If a generic view being written with a website_id in the context had already
   a specific child, we would copy both its specific child and generic child
   for the same key instead of simply copying the specific one.
   This happens if we triggered previously a COW on a child view, then only
   that view had been made specific (and is still in the generic tree).
   Then, when cloning the parent, we need to copy and make specific all the
   hierarchy but ignore the generic elements if they already have a specific
   one.

Now:
1. Fixed with adding the inherit_id on the copy vals
2. Fixed with filtering children_ids with filter_duplicate() before cloning the
   children tree

opw-1908308
Closes #27914

closes odoo/odoo#28405
2018-11-15 14:17:28 +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
Sanjay Jamod 8f99013d01 [FIX] website: method should be called with action not with self
to avoid 'Expected singleton error'

OPW: 1909205

closes odoo/odoo#28648
2018-11-14 06:32:40 +00:00
Odoo Translation Bot 8d77288a8c [I18N] Update translation terms from Transifex 2018-11-11 03:16:11 +01:00
Christophe Simonis 21eb31d804 [MERGE] forward port branch 11.0 up to a587325ca7 2018-10-31 19:22:21 +01:00
Christophe Simonis cc8e8237bf [MERGE] forward port branch 11.0 up to 84500c27b1 2018-10-25 13:59:45 +02: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 517d184107 [FIX] website: no text-primary in accordion snippet
For some unknown reasons, the text-primary class was added on each
card-header of that snippet... while the default link color is already
primary by default.

This was however breaking some themes whose primary color would not fit
in card-header while the link color (different from the primary one)
would.

closes odoo/odoo#28627
2018-11-13 13:06:42 +00:00
qsm-odoo f16bd3edca [FIX] website: restore theme contact us page
The page appeared broken in some themes as the "contact us" button was
against the bottom of the #wrap element.

closes odoo/odoo#28623
2018-11-13 12:29:12 +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
Odoo Translation Bot dcc077afc5 [I18N] Update translation terms from Transifex 2018-11-11 01:26:46 +01:00
Romain Derie 7aa2136938 [FIX] website: avoid using self if not an existing view
web_editor dirty elements are saved by calling the ir.ui.view `save()` method.
As this method is called through call_kw _rpc on the ir.ui.view model, self
is binded to the view which has the `id` sent in the request.

In some cases, when editing a field for example, the id sent is the id of the
field's record (eg: product.template for price field).

In that case, the view binded on self will be the view with the id of the
field's record being edited.

If there is no ir.ui.view with the same ID as the field's record, self won't
exists.
This misbehavior resulted in no error luckily since we only use self to call
ir.ui.view methods without ever using self properties.

Since multi-website 47b00c5d53 overrided the `save()` method and used self.key
it was crashing when the self record did not exists.

This commit will fix that by doing the multi-website check only when it is a
view and not a field that is being edited. (We know that if xpath is set)

opw-1904637

Step to reproduce:
  - Go to a product on ecommerce, eg product.template 13013
  - Edit the product price field, the oe-id attribut is 13013
  - Delete the ir.ui.view that has the same ID than the product (13013)
  - Save -> It will crash since self is binded to "ir.ui.view(13013,)" but it
    does not exists and we try to access key

closes odoo/odoo#28469
2018-11-08 10:52:44 +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
Akim Juillerat b4ca8d0bc6 [FIX] website: Add onchange language_ids on website model
On res.config.settings for website, when removing a language from language_ids, if this language is defined as default_lang_id, the default language will be updated by an onchange to prevent any inconsistency.
The same should happen when doing this directly on the form view of a website record.

closes odoo/odoo#27727
2018-10-19 13:58:42 +00:00
Odoo Translation Bot 19d8adbce1 [I18N] Update translation terms from Transifex 2018-10-28 03:21:03 +01:00
Odoo Translation Bot c2c88f359d [I18N] Update translation terms from Transifex 2018-10-25 10:21:44 +02:00
Odoo Translation Bot 98ee84e976 [I18N] Update translation terms from Transifex 2018-10-21 03:22:16 +02:00
qsm-odoo dea1372215 [FIX] website: restore options active system for carousel 2018-10-19 09:05:58 +00:00
Odoo Translation Bot 790bd62f14 [I18N] Update translation terms from Transifex 2018-11-04 01:27:12 +01: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 f6ca72b3ce [MERGE] forward port branch saas-11.3 up to 21eb31d804 2018-10-31 20:43:03 +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 78e3330d02 [FIX] website: fix parallax snippets' structure
Some of our new snippets for 12.0 uses parallax. Those were not using
the exact structure required by parallax which *may* lead to unexpected
results when playing with the related options.

closes odoo/odoo#28299
2018-10-30 17:10:56 +00:00
Swapnesh Shah 297edf8d49 [IMP] website: make website name required
The website_name field is a related towards a required field.
Saving a res.config without a value raise an error.

closes odoo/odoo#27907
2018-10-30 15:58:19 +00: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
Odoo Translation Bot 29dc21ae4b [I18N] Update translation terms from Transifex 2018-10-28 01:25:21 +02: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
Odoo Translation Bot de265ce63e [I18N] Update translation terms from Transifex 2018-10-21 01:25:56 +02:00
Xavier Morel 238e561ad9 [FIX] website: current website caching
Not taking fallback in account means incorrect values can get cached/retrieved
on fallback v not fallback cases

closes odoo/odoo#27989
2018-10-19 15:28:43 +00:00
qsm-odoo b154709645 [FIX] website: remove useless select-class class 2018-10-19 09:27:29 +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 aa2f86b14c [FIX] website: border/rounded/shadow options were not working together 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 2d4c3bf662 [FIX] website: increase compatibility with previous column system
Before 12.0, snippet columns were using col-md instead of col-lg.
Also, this improves efficiency and readability.
2018-10-19 08:37:01 +00:00
Romain Derie 3c11cf926c [FIX] website: only one website on dashboard if no multi-website
If multi-website is disabled, we still show all the websites on the website
analytics dashboard.

This commit will only show one website if multi-website is disabled

closes odoo/odoo#27737
2018-10-17 09:12:20 +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