Commit Graph
141092 Commits
Author SHA1 Message Date
williamandh4818 dc696c8ed4 [IMP] analytic: allow cross analytics
Purpose
=======

Make it possible to compare analytic values between plans by inputting
up to one account per plan on each line.
For instance, if we have 2 plans: "Country" and "Product Type", with the
following accounts

| Country | Product Type |
| ------- | ------------ |
| BE      | Drinks       |
| LU      | Food         |

And the following invoices:
* 1000€ of drinks in Belgium
* 2000€ of food in Belgium
* 3000€ of food in Luxemburg

We want to be able to display the following pivot tables:

|     | Drinks | Food | Total |
| --- | ------ | ---- | ----- |
| BE  |   1000 | 2000 |  3000 |
| LU  |      0 | 3000 |  3000 |
| Tot |   1000 | 5000 |  6000 |

|        | Total |
| ------ | ----- |
| Food   |  5000 |
| * BE   |  2000 |
| * LU   |  3000 |
| Drinks |  1000 |
| * BE   |  1000 |
| Total  |  6000 |

Implementation
==============

* `ir.fields` are added/removed dynamically on `account.analytic.line`
* Each analytic plan corresponds to one field on `account.analytic.line`
* The fields are added dynamically in the views.
* `account.analytic.plan` doesn't have a `company_id` field anymore,
  meaning that all the companies have access to all the plans. This
  means that the applicability fields and lines are now company
  dependent, and those can be used to know which fields/plans to display
  for which company.
* There can no longer be one "Project" plan per company, even if the
  accounts of that project can still be owned by only one company.
* There is now only one method to get the default (or "Project" plan),
  which is `_get_plan_columns`

task-3497653

closes odoo/odoo#139225

Related: odoo/upgrade#5306
Related: odoo/enterprise#49226
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: william <wan@odoo.com>
Co-authored-by: h4818 <ayh@odoo.com>
2023-10-25 18:10:57 +00:00
Valentin Chevalier 41440868c2 [IMP] website_sale: add shown_on_product_page on kanban view
closes odoo/odoo#137975

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-25 18:10:55 +00:00
Valentin Chevalier e3fe2b01f1 [IMP] web,sale: allow selection widget in kanban view
Currently, users who want to change the visibility of product's
documents need to open their form view and edit it.

The selection widget now allows users to quickly edit the way a document
is displayed to their customers from the product's documents kanban view.

Part-of: odoo/odoo#137975
2023-10-25 18:10:55 +00:00
Arnold Moyaux 7dda6bb927 [REF] stock: quantity pocalypse
The rational is:
Currently we have 2 columns. One for reservation, the other
for quantity picked.

However in real time, either you follow the reservation and everything
goes well. Otherwise you pick something else. In the case where you
pick somewhere else than reserved, you would like to modify the
reservation to have something similar and free the quantity you
didn't pick and expect the system to not suggest the ones you took.

In other hand, we always want to have the reserve quantity similar to
the done.

On top, having two columns could be confusing for the end user.

The cons:
-The qty_done column could be use during the picking, to
remember if something has been pick or still to pick.
- For some flow (put in pack), it's easier to write a part of the quantity to pack
and still want to reserve the full amount of product.

We goes back and choose a ligther interface over complex feature.

Changes:
Qty done and reserved qty are merged into a single column.
A new checkbox on the move exists to mark it as picked or not
Since the reservation always follow the quantity, it's now possible
to have more reserved quantity than stock. However the system will
never propose it and the inventory showing reserved > quantity should
be a warning.
The system should never modify a move that has been picked. We don't
want to overide the user action.

Regression:
Not able to pick a single stock.move.line

closes odoo/odoo#137864

Related: odoo/enterprise#48709
Related: odoo/upgrade#5310
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-25 18:10:54 +00:00
Loukas Wets (lowe) c43297435c [IMP] pos_restaurant: default floor plan when new config
In this commit a new default floor plan is added along with one table when
creating a new restaurant pos_config. It ensures that the default floor
is removed for the demo data and for the tests.

closes odoo/odoo#139594

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-10-25 17:03:23 +00:00
anhe-odoo 02c4f52a9a [FIX] spreadsheet_edition: fixes image export in .xlsx
Task Description

o-spreadsheet now allows to insert images in a spreadsheet, and
we also allow to export them inside .xlsx file. However, while this
works as intended in a standalone o-spreadsheet server, it doens't
work correctly in Odoo as the data of the image are not found while
we try ton convert the spreadsheet to an xlsx file. This PR aims to
simplify the request made to get the binary data of the image file.

Related task

closes odoo/odoo#139549

Task: 3524473
X-original-commit: 301a98c
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-25 17:03:21 +00:00
Bastien (bvdn) 78f551b2fc [FIX] project: allow state reset for stage batch modification
The onchange on the stage_id/project_id wasn't triggered when modifing tasks in batch
we are now putting the same conditions as the onchange but in the task write() method

closes odoo/odoo#139491

X-original-commit: 0accffc0eb65f40e44d31402a0a362abaaa9b9bd
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-25 17:03:20 +00:00
Mathieu Duckerts-Antoine 39e5124170 [IMP] web: support set intersections in condition tree
Now that some field attributes like invisible are given by Python
expressions that can involve set operations, we want to be able to easily
edit those expressions in the expression editor. For this we have to
improve a bit the mapping expression <-> condition tree, in order to
have simple rewrittings like
"set(user_ids).intersection([1, 2])" <-> condition('user_ids', 'in', [1, 2]).

Part-of: odoo/odoo#139451
2023-10-25 17:03:19 +00:00
GorashandMathieu Duckerts-Antoine febece1371 [IMP] web: py_js: support of set and some set operations
We make py_js support sets and the operations intersection, union, and
difference.

Part-of: odoo/odoo#139451
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
2023-10-25 17:03:19 +00:00
Mathieu Duckerts-Antoine 55e1a4546e [FIX] web: py_js: improve evaluation of bool
The evaluation of some expressions involving bool like "bool()" were wrong.
We fix that and add some tests.

Part-of: odoo/odoo#139451
2023-10-25 17:03:19 +00:00
Rob Coekaerts 6c89c9b312 [FIX] hr_work_entry_contract: fix the time off defer
This commit addresses a specific issue: the prevention of work entries being
generated when an employee's leave needs to be deferred. In some cases,
employees may need to postpone or reschedule their entire leave period at
once, rather than creating separate work entries for each day of leave. This
change in the code ensures that such deferred leaves are handled more
efficiently, allowing for the entire leave duration to be deferred in one action
streamlining the leave management process.

closes odoo/odoo#139434

Task: 3424006
X-original-commit: 17ca2e19fd231df5e19297eaee72a4e946825a94
Related: odoo/enterprise#49390
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-10-25 17:03:17 +00:00
vishal padhiyar 0987ee5b5e [FIX] web_editor: sanitize html pasted in codeview
Before this commit:

When we paste html using selectAll and we click code view button then the newly
added template will be visible and immediately got removed by old template. This
problem is because of pasted html is not sanitized.

After this commit:

Now when we paste html using selectAll then we actually see new html template in
result.

task-3473633

closes odoo/odoo#139384

X-original-commit: 6d6e1527ccdf5e616330905bc4b7e4fdd80c6192
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-10-25 17:03:16 +00:00
visp-odoo 45f70979a8 [FIX] mass_mailing: issue when pasting html in email marketing
Before this commit:

When you try to copy paste html in code view of email marketing then in preview
it will show the code instead of template.

After this commit:

Now when you try to paste html in code view of email marketing then it will show
template preview as a result.

task-3473633

X-original-commit: 5cd1a900d89c34877be2c1036ad52d8b4a70c849
Part-of: odoo/odoo#139384
2023-10-25 17:03:16 +00:00
Daniel Kosky (dako) c66cfcca81 [FIX] account_peppol: fix config setting option
The res config settings view contains block in which peppol can be
enabled. Enabling peppol using the checkbox inside the block installs
the peppol module. Once installed, the "Use Peppol invoicing" option is
available, which is itself a checkbox, nested inside of the previous
one. This gives the appearance of duplication, and in addition it's not
relevant at this point to provide the user the option to uninstall
peppol from this menu.

The solution is to replace this content in the view when peppol is
installed, such that the peppol options are always displayed, and the
enable peppol checkbox is replaced.

For this reason, references to the "is_account_peppol_participant" have
been removed, as its use was primarily for hiding/displaying these
settings. The field is no longer useful, and should, references to be
removed in a later Paccount_R have been removed, as  its use was
primarily forhiding/displaying these settings. The field is no longer
useful, and should be removed in a later upgrade script.

Required fields have been modified in the xml such that they no longer
prevent saving from the res config settings, instead validation is
performed on the "validate registration" button action.

closes odoo/odoo#139379

Task-id: none
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-25 17:03:15 +00:00
Chrysanthe (chgo) fc551f36a6 [FIX] portal: remove unused SCSS variables
This commit removes unused variables inside portal.

Before the redesign, portal was using a card layout. To ensure these
cards were always visible and readable, we used SCSS variables to detect
the `background-color` of the page. If the `background-color` was white,
we would set it to a light gray to ensure our cards are visible.

With the new design, we modified the structure and layout of the page,
using a bg-light class directly on the cards rather than modifying the
background of the body, which made these lines useless.

Since they are not used anywhere, we remove them from our SCSS file.

task-3046004

Part-of: odoo/odoo#138077
2023-10-25 15:50:36 +00:00
Chrysanthe (chgo) df8535fbd4 [REF] portal, *: portal redesign
*: base, account, account_payment, auth_top_portal, hr_timesheet, loyalty,
   mrp_subcontracting, payment, project, purchase, sale, sale_stock,
   sale_timesheet, website_crm_partner_assign, website_sale,
   website_slides

Portal general redesign. Increase visual consistencies with the backend
[1] and adapt to the new default website design [2].

[1] https://github.com/odoo/odoo/pull/116641
[2] https://github.com/odoo/odoo/pull/120302

task-3046004

Part-of: odoo/odoo#138077
2023-10-25 15:50:36 +00:00
Michael (mcm) fcb16a3b1b [IMP] *: remove guarded catch
This commit removes the promise extension which added the function
`guardedCatch`. It was used to filter server and connection errors from
javascript errors. Instead of using guardedCatch, we should use catch
and check if the reason is a server or connection error if needed and
re-throw the error if it's not handled.

closes odoo/odoo#137702

Task: 3439226
Related: odoo/enterprise#48451
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-25 15:50:34 +00:00
william-andre d8627c4e38 [REF] account,sale*: remove local cache for currency rates
Since it is cached by the ORM (see parent commit), there is no need to
manage the caching in the business code anymore.
In most cases in addition to making the code shorter, it also makes it
more readable by making the direction of the rate more obvious with the
use of the `to_currency` parameter.

closes odoo/odoo#137609

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-10-25 15:50:33 +00:00
miad-odoo 2e974c10af [FIX] product: print labels only for consu, storable, combo
Before this commit, the "Print Labels" button shows for all products except
services.

However, this button does not make sense for event_booth, event_ticket, course,
... products

So we only show this button for storable, consumable and combo products.

Task-3390587

closes odoo/odoo#136753

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-10-25 15:50:32 +00:00
Pratik Raval 28097c6dc2 [IMP] various: update wording of action labels
This commit changes the wording of actions and notifications in the modules
listed below:
1) Discuss (Leave Conversation)
2) Web (Delete Filter, Get View - Close, Tours - Close, and property field
   access warning)
3) Calendar (Stop Synchronization, Configure, and Discard)
4) CRM (Assign Leads)

Task-3390780

closes odoo/odoo#130353

Related: odoo/enterprise#44919
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-10-25 15:50:30 +00:00
damr 3b7dd79e5f [IMP] sale: Invoicing flow improvements
This commit's purpose is to ease the the flow of invoicing from the
project app. The warning message when the user tries to invoice without
fulfilling the condition has been updated.
When the customer of an SOL is a person and belongs to a company, the
company is now also shown on the sol, in addition of the name of the
customer. The idea is that the user is more keen to recognize the
company than just the name of the person.

task-3251615

closes odoo/odoo#122611

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-25 15:50:28 +00:00
Abderraouf Ghrissi (abgh) 3c6c796f32 [IMP] sale{project,timesheet}: Generic Improvement
Before this commit:
An internal use case of training cannot be handeled with the current ux.
Basically, training is sold to customers. It is given by a consultant who needs to timesheet their time.
With the current implementation, each training would generate 1 SO per customer per training.
This makes it impossible to timesheet because the consultant cannot split nor multiply their
time per person attending the training.
Because of that, timesheets cannot be billable which leads the reporting to be inaccurate.

After this commit:
A new field called `billing_type` is introduced allowing the users to flag the timesheets from a project as
considering as billable even they have no SOL set. And so
a billable project with billing_type set to 'billable manually', will have its timesheets without any SOL
considered manually billed.

task-3565762

closes odoo/odoo#139478

Related: odoo/upgrade#5318
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-25 11:37:39 +00:00
Paolo Gatti (pgi) 6637f1a4ab [FIX] l10n_it_edi: Send and print Checkbox behaviour fix
Several fixes after test:

- `l10n_it_edi_warning_message` 's compute was wrong

- `is_being_sent` allows for the Check Sending button to show, it just
  reloads the page

- now the XML export button is only readonly if there's PDF and no XML.
  In the other cases, it can be checked. It's checked and readonly if
  all XMLs are generated.

- some label fixin'

closes odoo/odoo#139362

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-25 11:37:35 +00:00
Adrien Minne (adrm) 61d54527fc [IMP] spreadsheet: improve wrong linked menu handling
If a chart was linked to an odoo menu, but the odoo menu didn't have
an action, the user would get a traceback when clicking on the chart.

This commit:
- Improves dashboard validation. Now we test that the menu is linked
to an action, in addition to testing that the menu exists
- Send a "danger" notification when the user clicks on a chart with
a menu without an action linked to it, rather than a traceback

closes odoo/odoo#139324

Task: 3563450
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-25 11:37:33 +00:00
Jérémy Hennecart (jeh) b3ffdf02bb [FIX] mass_mailing: remove extra domain in view
Remove the extra mailing_domain in the form view and
keeping the one on a separate line.

This extra domain field was introduced by the improvement
task on the mailing form view design.
For more info see: e542cca69e

task-3562293

closes odoo/odoo#139224

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-10-25 11:37:32 +00:00
Shaan Thakkar (THSH) 4e7d383692 [FIX] website_slides: unwanted html text
How to reproduce:
=================
1. Open any course having quiz.
2. Select quiz content.
-> In the quiz template we can see that the html content is not sanitize.

Technical:
==========
I think the issue arises after this commit https://github.com/odoo/odoo/commit/0d7acf60b4cca84a8c700edd97af8c4de6b78010

After this commit:
==================
Now t-esc is deprecated and the HTML text is not sanitize in the template
so instead of t-esc we are using t-out.

Task-3555159

closes odoo/odoo#138873

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-10-25 11:37:30 +00:00
Mélanie 3f8ee12ca0 [IMP] *: redesign employee kanban card
* = hr, hr_holidays, hr_homeworking

Change the disposition in Kanban card.
Changes the behavior of the image in the kanban card: if an employee don't have an image the avatar's image is displayed.

task : 3527398

closes odoo/odoo#138858

X-original-commit: c55dd60baa8aeb6d54a2dc7f1039be1e84113cf8
Related: odoo/upgrade#5314
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-25 11:37:28 +00:00
william-andre 334f4e852d [FIX] account: temporary skip invoice sync
Find out why the PoS has a different computation on the rounding lines.
See `--test-tags .test_rounding_half_up_cash_and_bank`

closes odoo/odoo#138140

Related: odoo/upgrade#5303
Related: odoo/enterprise#48980
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-25 11:37:23 +00:00
william-andre 30a37c10ec [IMP] account: journal items match improvements
This commit contains some misc improvements based on the 16.0 overall improvements regarding navigation and Journal Items

in account.full.reconcile, 'name' field has been removed, and the replacement for matching_number will be the SQL id instead (no more sequences)

For full reconciliations, the matching number now don't have an 'A' prefix
For partial reconciliations, the matching number will have a format of 'P{id}'

Community-pr: https://github.com/odoo/odoo/pull/138140
Enterprise-pr: https://github.com/odoo/enterprise/pull/48980
Task-id: 3530458
Part-of: odoo/odoo#138140
2023-10-25 11:37:23 +00:00
Soukéina Bojabza d1c7e37149 [IMP] web_editor, web_unsplash: improve the UX of the media dialog
When using the media dialog, the dialog always seems glitchy as its size
is always changing with the loading files. This behavior is not really
convenient as it can make the user click on unwanted images. Another
"issue" of the current media dialog is that when loading more images,
the dialog auto-scrolls to the "Load More" button, which can make the
user miss new images and he therefore needs to revert the scroll. A last
issue encountered by the users is that some of them think that the "Add"
button in the footer is used to upload files from their device, while it
only adds the selected media to the page.

This commit improves the UX of the media dialog:
- The dialog height is now fixed and has the same size as when it is
fully filled by images.
- The top bar with the search input now stays at the top when scrolling.
- There is now a small footer under the attachments (for the Images and
Documents tabs only) and containing the following:
    - When there is content to scroll, a small circle with an arrow that
scrolls one row when clicking on it.
    - When there is nothing to scroll, the "Load More" button which will
load more images. When new images are loaded, if we can scroll, the
small arrow is displayed again.
    - When there is nothing to scroll and to load anymore, the "All
images/documents have been loaded" text.

Note that the main goal of this footer is simply to indicate to the user
when there is still content to scroll and when he can load more files.

In order to solve the "Add" button issue, this commit also enables and
disables this button, depending on whether some media are selected:
- if a media is already selected, we can click on the button;
- if not, the button is greyed out and we cannot click on it.

task-3441587

closes odoo/odoo#135875

Related: odoo/enterprise#49535
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-25 11:37:21 +00:00
Killian Frappart a3bab45dbe [IMP] mail: translate message from chatter
This commit introduces a new optional feature in the chatter.

Users can request translation from the Google Cloud Translation API.
Documentation: <https://cloud.google.com/translate/docs#docs>

Adding the key in settings will instantly enable the feature for all
users of the database and consumption is not measured nor limited
by Odoo as it is natively supported using the Google Cloud Console.

Translation values are stored in the database to reduce cost as
much as possible. Therefore, translation values are automatically
garbage collected every 2 weeks to prevent database pollution.

Task-3338165

closes odoo/odoo#126555

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-25 11:37:17 +00:00
xO-TxandChrysanthe f64c9f27f1 [IMP] web, web_editor, website: add text highlight effects
The goal of this commit is to replace the "Toggle underline" option
from the website's text editor by a new "Highlight effects" option which
should allow applying some highlights on the selected text and setting
their color & thickness. Also, the text editor "Toggle strikethrough"
option will be moved to the list of highlight effects in the new option.

For this purpose, the JS code used for text animations will be updated
to be more generic and handle text highlights too. Moreover, The "Text
Highlight" options will be applied by adding a SVG to the targeted text
element (allowing to adjust their `stroke` and `stroke-width`).

To simplify adapting highlights when the text content is updated,
we follow this generic structure:
```
<span class="o_text_highlight">
    <span class="o_text_highlight_item">
        line1-textNode1 [line1-textNode2,...]
        <svg.../>
    </span>
    [<br/>]
    <span class="o_text_highlight_item">
        line2-textNode1 [line2-textNode2,...]
        <svg.../>
    </span>
    ...
</span>
```

Rendered line breaks in text nodes are detected using range client
rectangles (see: `text_processing.js` > `splitNodeLines()`), and the
highlights are updated on window resize...

We also need to adjust highlight SVGs to fit an updated text in "edit
mode" (mainly using editor's commands), a `MutationObserver` is used
for this purpose (we only redraw the SVG for each text unit).

A simple SVG path generator was implemented in this commit (see:
`text_processing.js` > `drawPath()`) to build highlights. It applies a
list of SVG path commands according to text dimensions in a specific
mode (E.g. on "pattern" mode, we repeat the same elementary path to fit
targeted text node...).

Remarks:

- The `--text-highlight-width` and `--text-highlight-color` properties
are used to control the highlight effect's thickness and color.

- We build the highlight option preview in the same way as text content.
To achieve this, a hack was used (we open the `<we-select/>` first since
we need the right `getBoundingClientRect()` dimensions to correctly draw
highlight SVGs).

task-3285817 (rd-website)
task-3269759 (rd-design)

closes odoo/odoo#122751

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Chrysanthe (chgo) <chgo@odoo.com>
2023-10-25 11:37:14 +00:00
Serge Bayet (seba)andqsm-odoo dc81acfb2d [IMP] website, *: allow to add a language from theme tab + options
*: web_editor, portal

This adds a button to add language in theme tab. When clicked, opens
the "add a language" wizard.
If the website has only one language, the options to enable language
in header & footer are hidden.
When an user add a language, the default behavior is Header: dropdown
& Footer: inline.
Also provides two more rendering options : Language Code and Flag +
Language Code.

task-3457554

closes odoo/odoo#119650

Related: odoo/design-themes#651
Related: odoo/upgrade#5214
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2023-10-25 11:37:12 +00:00
qsm-odoo fb63a6abbb [REM] website: remove forgotten compatibility code for sign-in option
Commit [1] was not adapted properly for its master version.

[1]: https://github.com/odoo/odoo/commit/68ed032b8ac29431550846a60189f4f32223d68a

Related to task-3474743

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Robin Lejeune (role) a017f6b7e9 [IMP] website: define one-sided or full borders on header templates
When we set a border on a header, its 4 sides are affected. For most
templates, it doesn't make sense to have borders on the top, left and
right sides.
This commit applies a border-bottom-only style by default to headers,
and adds two classes `.o_full_border` and `.o_border_right_only` to
override the default behavior. As their names imply, they respectively
apply borders on the 4 sides or on the right side only.

task-3474743

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Robin Lejeune (role) e7dcfc1929 [IMP] website: allow varied default behaviors for header templates
Currently, the template headers all have the same default behavior, you
cannot define different default behaviors for header A and header B
(e.g. have header A appear over the content and header B fixed).
This commit allows to specify other behaviors than the default ones for
each header template. It should be noted that, as it currently stands,
most options trigger a reload of the page, which prevents simpler
solutions like using `data-trigger` attributes to tie some options to
the header selection.

Specifically, this commit:

- defines a header visibility for each header with `data-trigger`. This
is actually the only option of the 3 concerned by this commit that could
be handled that way, for the aforementioned reasons. Only the visibility
of the `header_rounded_box` template is actually modified, but to allow
switching back and forth between the different templates and still have
the intended Odoo experience, a trigger is specified for each header
choice (the other ones having the default visibility).

- applies the "pills" link style for the `header_rounded_box` template
and introduces a `customizeWebsiteVariables` public method to do so.
This method, called through the `data-customize-website-variables`
attribute, allows to specify additional variables that should be
modified by selecting the option. It is as of now only used in that
specific case, but could be used with a number of other options which
are defined in a similar way, such as the scroll effect, alignment,
font, logo height...

- uses the default link style to apply it to each template by default
through the use of `data-default-variables`. This is needed (1) to make
sure that the `header_stretch` template can never have another style
than the default one, as the option is hidden when it is selected, and
(2) to go back to the default behavior when switching between headers.
Both `data-customize-website-variables` and `data-default-variables` use
the same syntax: a list of `variable: value` separated by a comma.
e.g. `header-links-style: pills, header-scroll-effect: fixed`

- removes the "Round corners" option field and border-radius for headers
sales_one, sales_two, sales_three and sales_four, because the option
does not play well with their layouts.

task-3474743

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Robin Lejeune (role) 143d475c3a [IMP] website: partially hide content in headers on scroll
Following the redesign of website template headers, this commit
introduces a new class `.o_header_hide_on_scroll` to hide some part of
the header when scrolling.

task-3474743

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Robin Lejeune (role) 5cf32b489f [IMP] website: adapt website headers options and behavior
Following the redesign of website template headers, this commit applies
a few fixes and modifications to the behavior:

- It separates some elements' options into their own option sections:
  brand logo, language picker, searchbar.

- It disables interactive elements in the header (search modal, language
  dropdown, logout button) while in edit mode.

- It solves the following bugs introduced by the headers redesign:

  - Displaying the language selector with an inline style and flags
    only is working.

  - Social links are now unmovable and unremovable (other than by
    clicking on the "Show/hide social links" expressly made for it), as
    their place in the templates is fixed, as allowing the snippet to be
    moved caused several tracebacks, and as removing it through the
    options and trying to show it again caused a server error.

  - The CTA button is made unremovable (other than clicking on the
    "show/hide button" expressly made for it) for the same reasons.

  - It was possible to write in spaces where it shouldn't have been
    (search icon, mobile menu closing icon): they are made not editable.

task-3474743

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd a3917a24be [IMP] website: floating dropdown of search bar
Prior to this commit, the dropdown of the search bar which was displayed
in a navbar had a static position when the viewport was below lg.
This dropdown pushed the navigation down instead of being in front of
it, creating a layout issue in the offcanvas menu.

To fix this, this commit forces the `dropdown_menu` of the search bar to
be in absolute position.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd c6c2cdd676 [IMP] website: rename #top_menu_container
Prior to this commit the id used for the main navigation wasn't
descriptive enough.

This commit fixes this issue.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd d8ea618732 [IMP] website: relative dropdown in offcanvas menu
Prior to this commit, dropdown menus floated in offcanvas menus. This
can create an UX issue on mobile when you want to click/tap on a
link that is behind the open dropdown menu.

To fix that, this commit removes the floating style and lets the
dropdown menu extend below the parent button.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd e5380a8e40 [IMP] website, *: add extra elements feature
*: website_sale, website_sale_wishlist

This commit allows the user to show and hide the menu items they want
using the web editor.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd 0784aef08d [FIX] portal: color issue in user dropdown
Prior to this commit, icons in the user dropdown were not visible when
we applied a dark background color on the header.
In fact, when we use a dark background, it applies the "nav-dark" style
and turns the "text-muted" in a light gray which is not visible on white
background.

This commit fixes this issue by using the primary color instead of the
muted gray.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd 55d416cd32 [IMP] website, *: remove some header templates
*: website_sale, website_sale_wishlist

This commit removes the following templates:
- template_header_image
- template_header_hamburger_full
- template_header_magazine

New templates were added by previous commits. Those old 3 do not have
an equivalent anymore and are simply removed.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd f87cee6d58 [IMP] website, *: adapt sidebar header
*: website_sale, website_sale_wishlist

This commit improves the layout of the sidebar header.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd c7ff507f5e [IMP] website, *: add sales_four header
*: website_sale, website_sale_wishlist

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd 986a76da4a [IMP] website, *: replace contact by sales_three header
*: website_sale, website_sale_wishlist

The new header is quite different from the old one, the xml_id of
the header will thus change. That new "sales_three" header will however
be the closest one to the "contact". A related upgrade script will be
made to treat this as a simple xml_id renaming.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd 73e465e9c7 [IMP] website, *: replace slogan by sales_two header
*: website_sale, website_sale_wishlist

The new header is quite different from the old one, the xml_id of
the header will thus change. That new "sales_two" header will however be
the closest one to the "slogan". A related upgrade script will be made
to treat this as a simple xml_id renaming.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd f0c8e84b01 [IMP] website, *: add sales_one header
*: website_sale, website_sale_wishlist

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00
Brieuc-brd 036777ee61 [IMP] website, *: replace centered_logo by search header
*: website_sale, website_sale_wishlist

The new header is quite different from the old one, the xml_id of
the header will thus change. That new "search" header will however be
the closest one to the "centered_logo". A related upgrade script will be
made to threat this as a simple xml_id renaming.

task-3060986

Part-of: odoo/odoo#119650
2023-10-25 11:37:12 +00:00