Commit Graph
151563 Commits
Author SHA1 Message Date
Benjamin Vray 22bc9e142d [IMP] website_sale: stop showing variant option when not active
Since this commit [1], we don't want to display the "List View of
Variants" option on the product page if option "Variants" in settings
was disabled. Now that the customize show menu options have become
snippet options in edit mode, the code to do this has been adapted.

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

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 823d46fc6f [IMP] website, *: adapt customize show options in website pages
*: website_crm, website_crm_partner_assign, website_customer,
   website_forum, website_hr_recruitment, website_membership,
   website_slides, website_slides_forum

This commit adapts "customize show" options from several website modules
by creating new options available in edit mode.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 208612b173 [IMP] website_event, *: move specific options to edit mode
*: website_event_meet

This commit adapts "customize show" options from website event modules
by creating new options available in edit mode. These "customize show"
options used custo JS code which was adapted to work with the global
options system.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
qsm-odoo d8db21f947 [MOV] website_event_meet: move editor option file
As the first commit of the merge of this work at [1], this moves files
without modifying them to preserve code history and ease forward-ports.

As this was about static XML being converted into python XML, it was
not done in the first commit but just before the relevant commit.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Benjamin Vray 92287ef450 [IMP] website_event, *: adapt customize show options in event pages
*: website_event_exhibitor, website_event_track

This commit adapts "customize show" options from website event modules
by creating new options available in edit mode.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 59e01b7a76 [IMP] website_blog: adapt customize show options in blog pages
This commit adapts "customize show" options from the website blog module
by creating new options available in edit mode.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 17a8a37e9b [IMP] website_sale, *: adapt customize show options in shop pages
*: website, website_sale_comparison, website_sale_loyalty,
   website_sale_slides, website_sale_wishlist

This commit adapts "customize show" options from website sale modules by
creating new options available in edit mode.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 9b1f4a84e3 [IMP] website: remove _cache_customize_show_views method
Remove _cache_customize_show_views method added by [1].
As the customize show options have been moved to edit mode. The
"customize_show" attributes will be less used.

[1]: https://github.com/odoo/odoo/commit/697f6007847e0cf209610acd533c5cd4d2c83296

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray dab8827e3b [IMP] web_editor: page options activated on click on the customize tab
With this commit, clicking on the "customize" tab automatically
activates the page options (if there are any). This commit also replaces
the name of the "style" tab by naming it "customize".

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 1216cea321 [IMP] web_editor: add a new string attribute on snippet option
This commit introduces a new way to set the title of an option section
in the customize panel. The title can now be filled in a new "string"
attribute in the template of an option.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Younn Olivier 2eef2b5430 [FIX] website: return to the correct url after editing in backend
Before this commit, clicking on the breadcrumb item "Website Editor"
after an "Edit in backend" systray item click would not redirect to the
edited object path. It would redo the website_editor action with the
initial params (most often path is undefined, and the component will by
default redirect to '/').

Now, when clicking on the "Edit in backend" systray, the frontend path
of the edited object is saved in the service. The client action
component takes it as the default path for the iframe if there is one.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 3326281e1a [FIX] web, website: correct items order on website systray
Before that commit, after the OWL2 rebase, the website systray items
were shuffled following those steps:
- Install website_blog
- Go to the posts list
- Click on a post
-> Until now, the systray items are correctly sorted
- Go back to the posts list, clicking on the blog navbar menu
-> Items are shuffled

For now, a temporary fix is to add an empty div with the index of the
item as the data-attribute to somehow force the rerender of the systray
items. That bug should be investigated further.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
xO-Tx 8925df7e75 [IMP] website, *: add new content dialogs
*: website_blog, website_event, website_forum, website_livechat,
   website_sale, website_sale_slides, website_slides,
   website_slides_forum

The goal of this commit is to add dialogs to create new website content
using a 'target:new' action on the form view and an overridable
"website" form controller.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
qsm-odoo 2f6aa250eb [MOV] *: move some static XML to view definitions
*: website_event, website_forum, website_slides

As the first commit of the merge of this work at [1], this moves files
without modifying them to preserve code history and ease forward-ports.

This part is about moving static XML to non-static files where the
XML will be changed into view definitions (as some UI now become normal
backend views). This cannot be a standalone working move of course.
So it was not done in the first commit but here, just before the
relevant commits of the merge.

[1]: https://github.com/odoo/odoo/pull/89223

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier ac55f2bb11 [IMP] website, website_links: add Promote menu and SEO dialog
The media dialog is added in a later commit.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier f260e3c144 [IMP] website, *: add edit in backend systray dropdown
*: website_blog, website_customer, website_event_exhibitor,
   website_event_track, website_hr_recruitment, website_sale,
   website_slides

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 751f522d62 [FIX] web: fix NavBar currentAppSections getter patch
After OWL next was merged, an error popped up while patching the Navbar
currentAppSections getter, coming from the Enterprise NavBar render.
A setter was added on the Navbar component to allow for the patch.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 2c77b90eee [IMP] web_editor, website: add edit menu
This commit also suggests a way to conditionnaly display menus. Here the
website edit menu should only be visible when the website is displayed.

There may be a better way to filter out some menus. That feature will
be reviewed anyway as part of a `patch` the framework team would like to
avoid.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier c4a8f86265 [IMP] website, *: implement some "add new content" actions
*: website_sale, website_hr_recruitment

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn OlivierandArthur Detroux d2ed93f780 [IMP] website: switch to fullscreen when pressing esc
See merge commit for more information.

task-2687506

Co-authored-by: Arthur Detroux <ard@odoo.com>
2022-06-24 10:28:05 +02:00
Younn Olivier 028efcbffe [IMP] website: add publish systray item
See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier fbfe4d1fcb [IMP] website: allow to add a website page from the new content menu
See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 3db77ce975 [IMP] website: add dialog component
This commit adds a generic Dialog component, for the website.
It has a default footer with two buttons.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier ca2e143d54 [IMP] website, *: add new content systray item
*: website_blog, website_event, website_forum, website_hr_recruitment,
   website_livechat, website_sale, website_slides

The NewContentModal component is added. It displays tiles, which will
install a module if not already installed, or perform an action defined
by the module otherwise. So that modules can patch that component to
define an action when installed (for example, website_sale will handle
the logic of creating a new product), the elements to displayed and
their state (NOT_INSTALLED, INSTALLING, INSTALLED) are listed in the
state of the component.

A key 'isDisplayed' is added on the new content elements that should not
be displayed to the user, depended on his security groups.
By default, the new content elements are displayed to the system user.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier f9d2b7a01f [IMP] website: add website switcher systray item
Courtesy of ARD.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 54dd238ffc [IMP] website: add edit website systray item
See merge commit for more information.

task-2687506
2022-06-24 10:28:04 +02:00
Younn Olivier b03bd93629 [FIX] web, website: fix NavBar systrayItems getter patch
After OWL next was merged, an error popped up while patching the Navbar
systrayItems getter, coming from the Enterprise NavBar render. A setter
was added on the NavBar component to allow the patch.

task-2687506
2022-06-24 10:28:04 +02:00
Younn OlivierandArthur Detroux 4255d16ac4 [IMP] website: patch navbar to display a specific website systray
This commit adds a new website_systray registry, that the patched navbar
will use when the user is editing the website through the WebsitePreview
client action.

This patch is subject to debate with the framework team, it will be
discussed further post-merge.

See merge commit for more information.

task-2687506

Co-authored-by: Arthur Detroux <ard@odoo.com>
2022-06-24 10:28:04 +02:00
Younn Olivier 7b19831e1c [IMP] website: add a fallback to the iframe to avoid white flickering
This commit adds an underlying iframe, below the main one used to
display the website.

This iframe, used as a fallback inbetween the events 'beforeunload' and
'load' of the main iframe, will host its replicated content to avoid
seeing white flashes.

These white flashes can happen on Chrome Linux and Windows - even on a
regular navigation - but are even more visible in the context of an
iframe.

See merge commit for more information.

task-2687506
2022-06-24 10:28:04 +02:00
2d44f2792d [IMP] website, *: handle url redirections from website iframe
*: auth_signup, portal, web, website_knowledge

When navigating in the iframe, only same origin redirections should be
open in the iframe contentWindow. External redirections should be done
in the top window.

Some internal pages had to be served with X-Frame-Options header set to
SAMEORIGIN, and Content-Security-Policy to "frame-ancestors 'self'" (see
[1]).

All the links that are redirecting to another host, and the client
actions, are opened in the top window.
Exemples that will be opened in the iframe's top window:
- Clicking on a link google.be that should not open in a new tab
- Clicking on the language selector and adding a new one, or
clicking on "logout".

[1]: https://github.com/odoo/odoo/pull/78298#discussion_r898853383

See merge commit for more information.

task-2687506

Co-authored-by: Arthur Detroux <ard@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-06-24 10:28:04 +02:00
qsm-odoo 8bf1f332af [IMP] website, *: add links to backend and website app in user dropdown
*: portal

The user dropdown (containing link to /my and a link to logout) now also
contains two other links (provided the user has the access rights):
- Link to the backend (app switcher for enterprise)
- Link to the website client action to configure the current page

See merge commit for more information.

task-2687506
2022-06-24 10:28:04 +02:00
Quentin Smetz 14ff4c00b4 [IMP] website, *: display a mini-nav to redirect to the backend
*: survey

Add a small overlay allowing common actions, which all redirect to the
Odoo backend.

See merge commit for more information.

task-2687506
2022-06-24 10:28:04 +02:00
Younn Olivier 1763568520 [IMP] website: display website iframe url from website_preview action
The browser's url is replaced when navigating inside the website from
the client action's iframe.
Exemple:
"/web#action=website.website_preview&path=/shop" becomes "/shop".

See merge commit for more information.

task-2687506
2022-06-24 10:28:04 +02:00
Younn Olivier 59b96b0742 [IMP] website: add client action to display current website in an iframe
This commit adds a new client action, that will display the frontend
website in an iframe, inside the backend.
Besides that iframe will be instantiated the edition components (the
snippets menu, or the translate menu).

This allows for a better integration with the other odoo apps, an easier
mobile edition. It also avoid reloading the edition components when
navigating inside the website.

See merge commit for more information.

task-2687506
2022-06-24 10:28:04 +02:00
Younn Olivier a9a0107f7c [IMP] website, *: reorganize website menus
*: website_blog, website_forum, website_mail_group, website_sale,
website_sale_comparison

task-2687506
2022-06-24 10:28:04 +02:00
qsm-odoo 29f21a23f1 [MOV] website, *: move static files to prepare website UI in backend
*: web_editor, web_unsplash, website_event, website_blog,
   website_event_meet, website_forum, website_links, website_livechat,
   website_sale_slides, website_slides

With [1], many files will move as the website UI is moved in the
backend. This commit moves all the static files (JS/CSS/XML) to their
final destination without modifying them, in an attempt to preserve
some history and ease some forward-ports.
After this commit, everything works as before as the files are simply
renamed and the references to them adapted.

However, technically, many files will actually be split into multiple
files by the work made with [1]. While it is theoretically possible to
preserve history over multiples files, this would require inner merge
commits, which does not go well with robodoo. In those cases, the "main"
file of the split was chosen. Mainly, 4 worth-noticing splits were
detected (and so the history moved only to the first file):

move: addons/web_editor/static/src/js/wysiwyg/widgets/media.js
to: addons/web_editor/static/src/components/media_dialog/file_selector.js
  - addons/web_editor/static/src/components/media_dialog/search_media.js
  - addons/web_editor/static/src/components/media_dialog/image_selector.js
  - addons/web_editor/static/src/components/media_dialog/document_selector.js
  - addons/web_editor/static/src/components/media_dialog/icon_selector.js
  - addons/web_editor/static/src/components/media_dialog/video_selector.js

move: addons/web_editor/static/src/js/wysiwyg/widgets/upload_progress_toast.js
to: addons/web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js
  - addons/web_editor/static/src/components/upload_progress_toast/upload_service.js

move: addons/website/static/src/js/menu/content.js
to: addons/website/static/src/components/dialog/edit_menu.js
  - addons/website/static/src/components/dialog/page_properties.js
  - addons/website/static/src/components/wysiwyg_adapter/page_options.js
  - addons/website/static/src/js/website_page_list.js

move: addons/website/static/src/js/menu/edit.js
to: addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js
  - addons/website/static/src/systray_items/edit_website.js
  - addons/website/static/src/components/editor/editor.js

Notice that as those moves were made post-work and the rest of the work
(80+ commits) rebased on top of it, some commits may remove more than
they should in a moved file to then reimplement some of what was
removed in a later commit... ideally this should have been avoided of
course but keep in mind that the final files are just entirely rewritten
and split as converted to OWL. It seemed however worth it to keep most
of the inner history of the work made here to see step by step what was
done. [1] will obviously be merged with a merge commit, binding the
whole work together.

[1]: https://github.com/odoo/odoo/pull/89223

task-2687506
2022-06-24 10:28:04 +02:00
Kevin Baptiste ce272ce13b [FIX] hr_expense: handle False-y list_help
The string concatenation would fail on False help_message.

Closes #93036

closes odoo/odoo#94505

X-original-commit: 97e066b4cfda8ac34208f84753a40c10524ae989
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-24 08:20:51 +02:00
hieu 69b5085f0b [FIX]hr_expense:fix constrains _check_payment_mode only applied on sheet
closes odoo/odoo#94497

X-original-commit: 5ba6c9ff5f842c32bfa0081cd277576114882fc7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-24 08:20:48 +02:00
Arthur Detroux (ard) 081b4ce84b [FIX] website: split s_countdown templates into specific files
The s_countdown snippet had 2 templates defined inside one file
(000.xml):
- One for showing a redirect message which is rendered in the
  public widget flow.
- Another for showing an end message which is rendered and
  appended to the snippet in the option flow.

The templates were loaded by the public widget, which means that even
if no end message was shown, the template would be downloaded for a
visitor.

This commit fixes that by splitting the file in 2, one for the options
and one for the public widget, ensuring that the option will load what
it needs.

(This is necessary for the task mentioned below, which moves the edition
to the backend, preventing the option from relying on a public widget
template.)

task-2687506

closes odoo/odoo#94118

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-06-23 23:48:43 +02:00
Odoo's Mergebot 0872502892 [MERGE][IMP] *: settings improvements
* verify settings access for "Settings" user (`base.group_system`)
* Improve loading performance through the use of conditional groups inheritance
* Do not imply application administration groups for "Settings" users
* Fix wrong view inheritance (views hooked on content defined in siblings, not in parent(s))

Enterprise PR: https://github.com/odoo/enterprise/pull/27595
Task - 2858427

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#91909

Related: odoo/enterprise#27595
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-06-23 23:48:32 +02:00
Victor Feyens 680473748f [FIX] google_calendar: access to all tokens for the settings user.
Now that the settings user implies having internal user rights 
(base.group_user), the access rules for users are applied and the test 
test_system_user_should_be_able_to_reset_any_tokens failed.

This commit adds a generic ir rule giving all rights on gg calendar 
credentials to "Settings" users, aka base.group_system group.

Part-of: odoo/odoo#91909
2022-06-23 23:48:31 +02:00
Victor Feyens 131c19f2d8 [FIX] hr: settings user doesn't have access to hr.employee
The field pos_employee_ids (pos_hr) links hr employees records to 
settings records
but this model isn't readable for Pos Administrators by default.

This commit gives read rights on hr.employee model to settings users,
reusing a confusing existing ACL whose name targeted system users,
whereas the group effectively targeted was the internal users.

Since this rule didn't give any rights, we might as well correctly 
replace
it so that the name can match its purpose.

Part-of: odoo/odoo#91909
2022-06-23 23:48:31 +02:00
Victor Feyens 53f2cfac23 [FIX] point_of_sale: access to settings for non pos users
Part-of: odoo/odoo#91909
2022-06-23 23:48:31 +02:00
Victor Feyens d2fb479d31 [FIX] mrp: settings user unable to save settings
Settings user is not able to access Bill of Material (mrp.bom) records
unless they have additional groups (account, inventory, manufacturing, ...)

This commit makes sure the operation is done in sudo so that any setting user
is able to save the settings.

Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
Victor Feyens 1bd7c55b5d [FIX] point_of_sale: missing field in view
Now that settings views are only loaded for the ones able to see their content,
the field group_cash_rounding might not be present if a pos manager without
account manager rights opens the settings.

Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
Victor Feyens d6c887f791 [FIX] delivery: settings user doesn't have access to delivery carrier
Since #87636, delivery carrier model is referenced in the settings when
website_sale_picking is installed.

Because of that, users with only settings access are not able to
open the settings anymore.

This commit adds read rights on delivery carriers so that base settings
users are able to update settings.

Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
Victor Feyens 9750a3c194 [FIX] sale_project: settings user doesn't have access to SOL
Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
Victor Feyens 954c85dc96 [FIX] account: tests
It seems most accounting tests relied on the fact that the "accountman"
test user has both the user AND manager groups (but previously, the
manager group was given by the implied group relation "Settings" ->
"account manager")

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00
Victor Feyens 76d5879c1e [REF] *: clean settings views inheritance
* make sure xpath expression content is specified in parent view.

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00
Victor Feyens fba6ea5a47 [IMP] *: do not force admins to be app admins
For bugfix purposes, app administration groups have been given to
(implied by) the "Settings" group because without those rights,
opening/saving the settings crashed.

1) Do not load hidden view content

This commit uses the conditional inheritance of views
(depending on user groups) to avoid loading unnecessary view
& record content client-side.

This improves performance for admins without the specific application
admin rights, but also fixes the main bugfix problem,
caused by the webclient querying name_get for the records in relational
fields content.

Example:

sale_management adds a res.config.settings field to specify
the default sale.order.template for the current company.

If a 'Settings' user without 'sale.group_sale_manager' opens the
settings, he won't see this setting, but if a default template is
specified for the current company, the webclient will still request
the name_get of this template to the server, because the field
was present in the view, only hidden with a groups attribute.

With this commit change in sale, the field won't be in the view unless
you have the Sale manager group, avoiding the error/traceback/bug.

2) Remove implied application administration groups

Do not force the specific application groups on all 'Settings' user,
they globally do not need those rights, and if they need it, they
can add it to their account themselves.

3) Add a test to make sure settings user are able to manage settings.

4) Enforce 'settings' -> 'access rights' -> 'internal user' groups

As the previous test highlighted some 'false positives' because
it considered a settings user unable to read `crm.team`
and `stock.warehouse` records, we also took the opportunity to enforce
the fact that 'Settings' & 'Access rights' users must be internal users.

It makes no sense for a portal/public user to have access to the
settings, and didn't work anyway.

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00