Commit Graph
6146 Commits
Author SHA1 Message Date
Jeremy Kersten 73b4e9b1b6 [IMP] portal,*: /my counter async
Before this commit, the time to compute all counters was making the rendering
of the portal page slow.

Now the count is done in rpc after the loading of the page.

Now you can decide which part you want to show on the portal, and only compute
for these one.

It is not because you have purchase installed for your internal process, that
it means that your supplier use your portal and it avoid the computation for
all end users.

We parallelize the counters in arbitrary 3 rpcs.

closes odoo/odoo#55999

Related: odoo/enterprise#12456
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-08-17 15:59:03 +00:00
Jeremy Kersten 5da1b96fbf [IMP] website: perf - reduce query for editor on first blank page
Before this commit, the template to generate 'New' panel generates .exists()
queries for each env.ref, now only one by module.
We could still improve it, deferring this rendering on click only.
For now, each time you are editor, we render it, even if you don't plan to
create anything.

+ use some xmlid_to_res_id instead of ref to avoid useless exists query.
Courtesy of @Feyensv for the tips
2020-08-17 15:59:03 +00:00
qsm-odoo 7eee8f5cf5 [FIX] website: remove options linked to inner cols of form snippet
Since [1], a new option targeting cols has been introduced. It should
not have targeted the inner cols of the form snippet (the same as the
resize and color options are disabled on those).

[1]: https://github.com/odoo/odoo/commit/a2ed3bda2ecddd8dcd890240576d0d6908148f63

closes odoo/odoo#55985

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-17 13:06:54 +00:00
qsm-odoo 7ef484377a [IMP] web_editor: add delete button on snippet overlay
This commit adds a trash icon on the snippet overlay to delete the
snippet without using the left panel button.

task-2314805

closes odoo/odoo#55612

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-17 09:31:58 +00:00
Martin Trigaux 6156f98288 [FIX] *: adapt action content retrieval
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.

Add sudo for other operations on ir.actions.*
2020-08-17 09:09:02 +00:00
Martin Trigaux e6e0eafccd [FIX] *: add groups_id where needed
To trigger a run of a server action, one must have a group specified
or a write access on the model.

CRM: only access lead, crm.team is readable by employees
Website: all users can access, action_dashboard_redirect takes care of the group
2020-08-17 09:08:22 +00:00
Xavier MorelandOlivier Dony a9a6509713 [ADD] auth_totp
New module for supporting two-factor authentication via time-base
one-time-password (TOTP).

Users (including portal users) can choose to enable two-factor auth in
their user account settings, by scanning a QR code and adding it to an
authenticator app, such as Google Auth, 1Password, etc.

When two-factor is enabled, password-based non-interactive RPC is only
possible by using API keys.

Co-authored-by: Olivier Dony <odo@odoo.com>
2020-08-14 23:06:24 +00:00
Xavier Morel 9f82605df1 [FIX] portal, website: login redirection
* migrate website to overriding web_login less (still needed to flag it
  as website-enabled) and use _login_redirect for its login redirection
  override needs
* modify portal and website to not replace / shortcut the redirection
  workflow, so it's possible to override those properly if / as
  necessary
2020-08-14 23:03:27 +00:00
Xavier Morel dccbf425a1 [FIX] core: ensure we create a new session for each tour
The browser itself would get mostly cleaned up between tours, but the
session object would not get cleaned, and apparently in some cases
that could lead to an incoherent session: a tour would add data to the
session which the next tour (logging in as a different user) would
not (fully) override, leading to a session inconsistency and a Session
Expired exception during the tour.

Fix by not storing the session on the test object, the session is
created during authentication then set on the opener & browser.
2020-08-14 21:20:47 +00:00
Jeremy Kersten 617c716aea [IMP] website: ir_qweb - add lazyloading by default on img
closes odoo/odoo#55945

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-08-14 13:49:30 +00:00
stefanorigano (SRI) 374ce7759e [IMP] web_editor, website, *: adjust general ui spacing/alignment
*: website_form

Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:48 +00:00
qsm-odooandstefanorigano c8afa7f6bb [IMP] web_editor, *: add caret icon to dropdowns & colorpicker modal
*: website

Part of https://github.com/odoo/odoo/pull/55959
task-2157252

Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
2020-08-14 19:19:48 +00:00
stefanorigano (SRI) aa69ba54e8 [IMP] web_editor, *: make general adaptations of the editor UI
*: website

Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
stefanorigano (SRI) ab3ebfb96d [IMP] web_editor, *: review 'options' tab specific components design
*: website

Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
stefanorigano (SRI) 93176bf3d7 [REF] web_editor, website: allow reusing tabs design
Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
Benjamin Vrayandqsm-odoo e41622e16e [IMP] base, *: add a field image flag on the lang model
*: website

Add a field image flag on the lang model because when a language has
no country (like the arabic) we cannot use the country flag as a lang
flag. By default we use this new field and as fallback we use the
country image. We also add an arabic flag image in the website data.

Part of https://github.com/odoo/odoo/pull/55300
task-2203383

closes odoo/odoo#55300

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 17:40:58 +00:00
Benjamin Vrayandqsm-odoo 745ef9de97 [IMP] website, web, portal: new options language selector in footer
Add an option to display the language selection inline or with a
dropdown. Add an option to choose if language labels are flags, text
or both.

Part of https://github.com/odoo/odoo/pull/55300
task-2203383

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 17:40:58 +00:00
704bcc5527 [IMP] portal, *: move language switcher to portal
*: base, http_routing, website

Make the language switcher available on portal without website
installed.

Part of https://github.com/odoo/odoo/pull/55300
task-2203383

Co-authored-by: Jeremy Kersten <jke@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 17:40:58 +00:00
Barad Mahendra 00a7f3aaad [IMP] various: Reseuence the module and module category
The purpose of this task is to improve the UI of the 'Apps', by
improving the clarity of the kanban, sequencing the apps and
simplifying the app categories in the searchpanel

So in this commit, Added the new sequences for ir.module.module
and ir.module.category records.

TaskID: 2240257
Related Enterprise: https://github.com/odoo/enterprise/pull/12413
Closes: #55907
2020-08-14 07:38:58 +00:00
qsm-odoo c5fee9d009 [FIX] web_editor, *: restore custom snippets thumbnails
*: website

Since [1], the thumbnails of the saved snippets were not right anymore,
all fallbacking to the default image. This is because snippets thumbs
now use svg files instead of png and the snippet saving feature did not
allow it. This commit fixes that and makes the feature more robust.

- Allow to use any original thumbnail, and not only for website app.
- Remove useless defaut image, a fallback for when the feature is broken
  is useless.
- Identify snippets by key instead of by main class (possible since
  the new `data-snippet` attribute on snippets).

[1]: https://github.com/odoo/odoo/commit/b7fe2bdae2f45372c0d538767a226a413b806f3f

closes odoo/odoo#55896

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-13 15:44:48 +00:00
Victor Feyens fdb23e282b [IMP] *: wrong any() usage
Replace wrong usages of any(list|recordset), by any(generator)
to speed up computations, avoiding list creations and/or looping twice on a recordset
for nothing.

any([generator]) => any(generator)
any(filtered) => any(generator)

closes odoo/odoo#55768

Related: odoo/enterprise#12360
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-08-14 09:56:10 +00:00
xO-Txandqsm-odoo 41527531b7 [IMP] web_editor, *: add snippets search filter
*: website

Add a search bar at the top of the "Blocks" tab to filter snippets.

Part of https://github.com/odoo/odoo/pull/55272
task-2309832

closes odoo/odoo#55272

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-13 14:29:20 +00:00
Thibault Delavallée f8e0c92bf4 [FIX] website: add missing digest dependency
Related to digest update in 13.4 (a595ebfca5ab7041224c661f404138612257bdda).

QUERY COUNT IN BLOG

Local installation of blog still makes those tests use 27 or 28 queries. On
runbot it grows until 32.

Due to dependency change, installation order changes. It may have an effect on
query count in website loading some pages in blog. This is worth checking why
queries are added.
Digest module itself has nothing to do with website. It could either be a side
effect of some computed field, either an installation order change adding more
modules before installing blog, with side-effect of adding queries due to
another module.

As without this fix installing website is not possible, let us merge this one
and investigate further soon.

closes odoo/odoo#55835

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-08-13 08:26:08 +00:00
Anousone Phaysomphot 73b5dfd64a [IMP] website: add new digest tips
PURPOSE

Review the tips and digest layout design to make sure they have a WOW effect
and increase trial conversion/retention.

SPECIFICATIONS

“Engage with visitors to convert them into leads”
“Use royalty-free photos”
“Search Engine Optimization (SEO)”

See code for specifications.

LINKS

Task ID-2274264
COM PR: odoo/odoo#53580
ENT PR: odoo/enterprise#1139

X-original-commit: b78921d41ca1af3e56a4d874381c30d766c986fc
2020-08-12 12:23:02 +00:00
Barad Mahendra 63f239163a [IMP] *: set sample="1" on various graph archs
The purpose of this commit is to enable sample data in various
graph views.

TaskID: 2311486
2020-08-12 09:57:09 +00:00
Jeremy Kersten 84362314cb [FIX] website: handle 404 publisher only for notFound exception
Before this commit we cehck first if user was publisher before to check if the
exception was a 404 NotFound.

What's means that we make this check (1 query sql) most of the time for no
reason, and worst case, when the exception crashes the cursor, this check will
reraise a new exception because isPublisher check is done with a closed cursor.

closes odoo/odoo#55789

X-original-commit: 8afa25a9ca3b165033ab664ce3185c453fb2dd85
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-08-12 09:43:15 +00:00
qsm-odoo 2f0bf44c7a [IMP] website: review parallax option UI
Instead of two select:

Parallax: none/fixed/very slow/slow/...
Direction: Bottom to top/top to bottom

We now have:

Parallax: none/fixed/bottom to top/top to bottom
Intensity: slider

Part of https://github.com/odoo/odoo/pull/47313
task-46147

closes odoo/odoo#47313

Related: odoo/design-themes#335
Related: odoo/upgrade#1553
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-10 14:27:00 +00:00
Benjamin Vray 5523e5aa14 [IMP] website: add a direction option for the parallax
Add a setting direction for the parallax. "Top to Bottom" or "Bottom to
top". The new one was actually a specific theme option that we lost
somewhere between Odoo 8.0 and Odoo 13.0. This is now standard.

Part of https://github.com/odoo/odoo/pull/47313
task-46147
2020-08-10 14:27:00 +00:00
qsm-odoo 42e1d4ca60 [IMP] website, *: enable the parallax option for all snippets
*: web_editor, website_blog

Unfortunately, this feature revealed a new batch of flaws in the
editor widgets system so some hacks were made to make it work. We will
always have the time to improve the pure technical side later.

This commit also separates the notion of color filter from the notion
of parallax. A color filter can now be applied independantly, when
there is either a background image or a background video. Applying a
color filter on top of a background video is actually a new feature.
Applying a color filter on top of a background image is actually now
achievable by two different ways: this new color filter layer or by
applying the color transformation on the image itself via the related
option. Depending on the user case, both could make sense at the same
time, but more importantly: having a CSS color filter is useful for
using those for default Odoo content (e.g. like the current contact us
page where we use a cover banner with an image with a black filter on
top of it: doing that without CSS color filter would mean to alter the
image directly which would not be ok when the user changes the image).
Also, sometimes you want the unfiltered image on a page and the exact
same one but filtered on another (for example: forum images).

Note: this commit also "fixes" an issue: the optimization feature for
images when parallax was enabled was not available before.

Part of https://github.com/odoo/odoo/pull/47313
task-46147
2020-08-10 14:27:00 +00:00
Francois (fge) 6286f8aab7 [FIX] website: replacement linkedin share link by the 2020 version
closes odoo/odoo#55044

Related: odoo/enterprise#12064
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-10 07:51:57 +00:00
Benjamin Vray 798fa36471 [IMP] website, *: add missing options previews
*: web_editor, website_blog, website_form

task-2280397

closes odoo/odoo#53516

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-10 14:51:30 +00:00
stefanorigano (SRI) b7098ddf2c [IMP] web_editor, website: review color combination preview
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:18 +00:00
stefanorigano (SRI) 36a8e2a791 [REF] web_editor, *: allow reusing links and buttons design
*: website

Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:18 +00:00
Samuel Degueldre c3dacfea05 [IMP] web_editor, website, *: create background-type toggler option
*: website_blog

Previously, background colors, images, and videos could all be applied
on the same section, such that the image can be used as a fallback for
the video, and the color as a fallback for the image. However, if you
wanted to change the background color behind the background image, the
background image would be removed. The background image and background
video also shared the same widget to pick the image or video.

This commit adds a background-type toggler, where the user can toggle
the background color, image and video individually. It also makes the
video picker into its own UserValueWidget, such that the user can pick
both an image and video without overriding the other.

Part of https://github.com/odoo/odoo/pull/53017
task-2210790
2020-08-07 15:34:45 +00:00
qsm-odoo 315ba1cfeb [IMP] web_editor, *: simplify UserValueWidget updates
*: website

Before this commit, editor widgets were updated by 3 successive calls
to methods 'setValue', 'updateUI' and '_updateUI'. The last two were
in charge of updating the UI depending of the value that was set, only
in specific condition (like "if the widget is not focused", "or not
previewed", ...).

This is now in fact useless: 'setValue' can be in charge of the UI
update. Indeed, when a value is set on a widget there is no reason to
not update its UI anymore. This was useful when the UI was updated on
preview, which is not the case anymore. This could also be useful for
widget with multiple options attached to them... but in those rare cases
updating the UI multiple times (one time per option method) should not
be a problem.

Part of https://github.com/odoo/odoo/pull/55588
2020-08-07 08:51:23 +00:00
xO-Tx a2ed3bda2e [IMP] website: add mobile visibility option on columns
Allow the user to indicate if a column should be visible or not on
mobile viewport.

task-2308828

closes odoo/odoo#55195

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-07 09:16:32 +00:00
qsm-odoo 78ef2ec813 [FIX] website: restore sub-headings edition toggling
Since [1], the sub-headings edition was not possible anymore in the
'options' tab of the editor panel. This is because the visibility of
rows is now automatic, depending of the visibility of the inner widgets.
The custom code for that row visibility, controlled by the user, was
thus not working anymore.

Note: this fix solves the problem with big hacks. Better code will
handle foldable zones generically.

[1]: https://github.com/odoo/odoo/commit/8d57f21d7df2033f462ead60fcb5abba4546213e

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

closes odoo/odoo#55529

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-06 09:46:48 +00:00
qsm-odoo 6a258db1e9 [IMP] website, *: review the 'options' tab of editor panel
*: web_editor

This will more probably change again in the future but this is a first
step towards a hierarchized 'options' tab for the editor panel.

Part of https://github.com/odoo/odoo/pull/55529
2020-08-06 09:42:48 +00:00
0659a500ef [IMP] website_event_online: ensure to link visitor at registration
RATIONALE

Events are sometimes held online, gathering a community. In this merge we
improve Event application to better support full-online events with improved
tracks, wishlists, chat rooms, ...

PURPOSE

Ensure to have a visitor when people registers, in order to enable wishlist
or notifications. Improve visitor model to keep information when people change
device.

SPECIFICATIONS: REGISTRATION FLOW

This commit ensures a visitor is created when a registration is done on an
event. Creation is done only if a visitor does not already exists like all
visitor-based flows.

In case of multiple registrations made by the same visitor, only the first
registration is linked to the created/existing visitor. We take the opportunity
to update the visitor's information based on the registration's infos.

We also add some fields to get all visitors from an event, based on visitor
and registration link. This could be used for example to contact them, like
sending a mailing or push notification to all attendees of an event.

SPECIFICATIONS: VISITOR LOGIN / INFORMATION UPDATE

When a user is linked to a visitor (e.g. when customer logs in) its partner
is propagated to the registration. Using visitor as middle-model it allows
to propagate information through those models, leading to better contact
data notably.

SPECIFICATIONS: VISITOR IMPROVEMENTS + PUSH TOKEN

In this commit we improve visitor behavior. Currently when there are several
visitors that may be linked to the same user, only the last one is kept and
other one are unlinked.

However visitor model holds push tokens, allowing to store approval for push
notifications. Unlinking records is therefore a bad idea as we may loose
information. In order to solve this an intermediate solution is implemented.
A new parent_id field is added on visitors. Instead of unlinking "duplicates"
we link them to the parent and de-activate them. This means more visitors
are present in database, but this is required to keep push tokens.

A better solution would probably be to separate visitor from push tokens
but as this merge targets a stable version it was difficult to do in a clean
way.

LINKS

Community PR #53540
Enterprise PR odoo/enterprise#11384

Task ID-2252655 (Main Online Event task)
Task ID-2283796 (Event B2Basics / Registration Flow
Task ID-2284043 (Visitor-based track wishlist)
Task ID-2283869 (Notify attendees by push)

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-08-04 14:28:29 +00:00
qsm-odoo 90033c95ea [FIX] website: prevent page flickering when modal is opened
Commit [1] introduced a flickering when any modal was opened on the
frontend. Indeed, it introduced the possibility to go into "fullscreen"
mode, which makes the Odoo UI navbar and sidebar disappear. This is
animated: the padding of the `<body/>` element is using a CSS
transition... but when a Bootstrap modal opens, the padding-right is
changed to compensate the scrollbar removal. This change now being
animated, it creates a flickering.

A generic solution was made: only animate what is animated for the
duration of the fullscreen mode switch.

[1]: https://github.com/odoo/odoo/commit/0b0690a3934cedcab0d5e34373e8d40c2ab25660

closes odoo/odoo#55210

X-original-commit: ccadb20c82a651e9ef87e818b898f3e9a081cacd
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-30 14:50:04 +00:00
567bd4d9d9 [REF] website(_event): allow to give a placeholder to website search box
RATIONALE

Even will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff.

PURPOSE

Prepare Event Online support by providing fixes in registration and event
frontend flows. Also provide a quick back2basic in backend views to prepare
addition of Online sub modules.

SPECIFICATIONS

Be more explicit in search boxes: allow to set a placeholder. It helps users
understanding purpose of the search tool.

Set it to "Search an event ..." in website_event.

LINKS

Community PR odoo/odoo#55197
Enterprise PR odoo/enterprise#12113

Task ID-2309702 (Event Preparatory Merge 4)
Prepares Task ID-2252655 (Main Online Event task)
Prepares Task ID-2283796 (Event B2Basics / Registration Flow)
Prepares Task ID-2299857 (Event Design Review)

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-07-31 15:35:32 +00:00
DramixDwandqsm-odoo ea009585e1 [IMP] website_blog, *: add a way to search blog posts
*: website

As there was no way to search a blog post, it could be hard for someone
to find a particular post if there was a lot of blog post for example.

Part of https://github.com/odoo/odoo/pull/52759
task-2267693

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-07-31 07:40:31 +00:00
Thanh Dodeur a258874132 [FIX] website: prevent flickering on image reorder in the image wall
Before this commit, reordering the images in the image wall was
causing a flicker of the snippet options.

It was caused by a forced deselection of the snippet (image) that is
not necessary since 17e7e754cd

task-2307083

closes odoo/odoo#55090

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-30 07:07:07 +00:00
Benjamin Vray 2458098f60 [IMP] website: ease google font selection
Before this commit users needs to link an embed code provided by
Google. But it became less obvious to find this code so we now ask for
the link of the font page. But we still keep the possibility to link
an embed code if ever a user is wrong.

task-2304075

closes odoo/odoo#54816

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-23 09:12:12 +00:00
stefanorigano (SRI) 167e70347b [IMP] website, website_form: add position options ui icons
Part of https://github.com/odoo/odoo/pull/54913
task-2157252

closes odoo/odoo#54913

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-30 11:12:03 +00:00
stefanorigano (SRI) 58927d6fc3 [IMP] website: add s_rating size option's icons
Part of https://github.com/odoo/odoo/pull/54913
task-2157252
2020-07-30 11:12:03 +00:00
stefanorigano (SRI) 3906bd33e8 [IMP] website: review options UI for media list
Reword custom controls for image position and content vertical
alignment. Use different icons set according to the selected image
position.

Part of https://github.com/odoo/odoo/pull/54913
task-2157252
2020-07-30 11:12:03 +00:00
stefanorigano (SRI) fd743b104a [IMP] website: use icons for vertical alignment option
Part of https://github.com/odoo/odoo/pull/54913
task-2157252
2020-07-30 11:12:03 +00:00
stefanorigano (SRI) e847acc8ed [IMP] website: replace dropdown of shadow options with icons toolbar
Part of https://github.com/odoo/odoo/pull/54913
task-2157252
2020-07-30 11:12:03 +00:00
stefanorigano (SRI) 3d2c591215 [IMP] website: replace icons for content-width option
Also reorder options from small to large.

Part of https://github.com/odoo/odoo/pull/54913
task-2157252
2020-07-30 11:12:03 +00:00