Commit Graph
18015 Commits
Author SHA1 Message Date
Xavier-Do d988030134 [REF] base: don't add id to assets bundle url
The main motivation is to be able to generate assets bundle outside
the t-call-assets call.
The need of an id in the url makes it mandatory to have an attachment
when adding the url in the page. Without this restriction, we can guess
the url without generating the assets.

This can also have other useful side effect:
There are corner case when a worked could have an invalid url in
cache because, if the transaction is rollbacked or if another request
generates the same attachment at the same time. This should be
partially solved by removing the id: The url remains valid even if the
attachment does not exist.

Note that the extra part of the url was made explicit, always there and
taking one / to remove complexity and ambiguity.

Note that an additional query appeared in .test_50_perf_sql_web_assets
because of the search, this but two of them were in _find_record. One of
them was an `exist`, not making much sense since we are not getting the
id from the attachment url anymore but from a search, and the other one
was prefetch of the "public field" since the call to _find_record does
not go in other cases (xmlid, website published, access token, ....). A
attachment of a asset is always public, and this part of the security
was moved to the search domain. The final result is one less query:
- one query to search
- one query to read the fields (_get_stream_from) (the prefetch could
actually be set to avoid prefetching everything)

Part-of: odoo/odoo#131353
2023-10-27 11:34:52 +00:00
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
Renaud Thiry 044cd8af7b [FIX] web: update reference resModel with props
When ReferenceField uses an M2O field. The model is not updated along
with the props when the model field is updated.

Because of this, the onWillUpdateProps hook will keep trying to update
its value. This results in an infinite render loop.

task-3248500

closes odoo/odoo#139954

X-original-commit: f8f6aaa5e32967d6c7cd888fbe574acdc6f79dc6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
2023-10-27 07:14:45 +00:00
Rémy Voet (ryv)andPolymorphe57 e6f501bea5 [FIX] web: fix domain_selector to handle false as display_name
Since https://github.com/odoo/odoo/pull/137098, `display_name`
can be false (from the default behavior in BaseModel). It isn't
handle correctly in domain_selector Component, which trigger a
traceback trying to `split` false.

closes odoo/odoo#139450

X-original-commit: 06f3cbb95b2e4cfb271039a19660991c743c2ba8
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Co-authored-by: Polymorphe57 <dam@odoo.com>
2023-10-26 13:41:14 +00:00
Damien Bouvy f1eee6c5fc [FIX] web: correctly space x2many kanban create buttons
Part-of: odoo/odoo#138804
2023-10-26 13:41:07 +00:00
Damien Bouvy 253c214b5b [IMP] base: allow server actions to update records across relations
Up until now, the 'Update record' server actions could only update the
record on which the action was triggered.

This is a rather serious limitations, especially in modules that
leverage server actions, like base automation - indeed, if you want a
server action run on e.g. Leads that will write changes on the leads'
customer, you *had* to use Python code.

This commit makes it possible to traverse relations when selecting the
field to update, and indeed to write across relations.

Task-3450200

Part-of: odoo/odoo#138804
2023-10-26 13:41:07 +00:00
Damien Bouvy e17f06baea [IMP] web: new size option for badge_selection field
When you have more 3-4 options, it quickly takes a *lot* of space.

This commit allows you to set the size to 'sm' (if you have many
options) or 'lg' (if you want super extra big buttons).

Task-3450200

Part-of: odoo/odoo#138804
2023-10-26 13:41:07 +00:00
Bastien Fafchamps (bafa) 37ab6ff1b5 [IMP] web: Company service refactor and improved ease of understanding
This commit improves the company service to be more readable. Variables
have been renamed to better indicate what they represent. Jsdoc has
also been added to further improve the ease of understanding of the service.

The following have been renamed:

- `allowedCompanies` -> `activeCompanies`
- `nextCompanies` -> `selectedCompanies`
- `logNextCompanies` -> `applySelectedCompanies`

The SwitchMenu & SwitchMenuItem components have also been simplified by
making use of useState on the company service itself.

Indent has aslo been added to SwitchMenuItem on mobile to display the
hierachy of companies.

closes odoo/odoo#138521

Related: odoo/enterprise#48862
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-26 13:41:05 +00:00
Adrien Dieudonné e6c747b43b [REF] *: keyboard: replace deprecated charCode, keyCode and which properties
These properties are deprecated.

We should consider to use `KeyboardEvent.key` or `KeyboardEvent.code` for new code.
Note that we prefer to use the `key` property as multiple physical keys
can send the same value (e.g. Enter can also be sent by the numeric pad).
We should only use `code` when we explicitly want to target a single physical
key on the keyboard.

By doing this, we can now remove the dependency of `jQuery.ui.keyCode`
that was used as mapping of key code descriptions to their numeric values.

References:
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode (deprecated)
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode (deprecated)
https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which (deprecated)

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

https://api.jqueryui.com/1.12/jQuery.ui.keyCode/

Some links that helps:
https://w3c.github.io/uievents/tools/key-event-viewer.html
https://www.toptal.com/developers/keycode/table

closes odoo/odoo#139809

Related: odoo/enterprise#49591
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-26 08:46:00 +00:00
Pierre Paridans 963842381e [IMP] web,*: replace ClipboardJS with Web API and homebrew polyfill
*: auth_totp_portal, mrp_subcontracting, project, survey, web_editor,
   website, website_links, website_sale_loyalty, website_slides, test_lint,
   spreadsheet

Implements missing `clipboard.write()` and `ClipboardItem` ; targets
only Firefox (which partially implements Clipboard API, features hidden
behind a preference flag).

Supported browsers: Chromium 76+, Safari 13.1+, Firefox 63+, Safari iOS
13.4+.

This allows to replace ClipboardJS by the native Clipboard Web API.

Reference:
https://caniuse.com/?search=clipboard
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
https://w3c.github.io/clipboard-apis/

task-3439226

closes odoo/odoo#134881

Related: odoo/enterprise#47154
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-26 07:22:54 +00:00
Thomas Becquevort (thbe) f25ede851e [IMP] account: easier payment registration for bills
Description of the issue/feature this commit addresses:

Currently, the payment registration for vendor bills is kinda hard to figure.
Noticing which bills are overdue, which require a payment is not made so easy
by the interface and could be improved. Also there is no way to register a
payment for multiple lines at a time which could improve the UX.

Desired behavior after the commit is merged :

The buttons "Bills to Pay" and "Late Bills" redirect to a Journal Items view
called Payment Items with specific filters to show only the necessary lines.

The order of the columns in the Journal Items has been changed and their
visibility has been changed too.

The default filters of the Journal Items when coming from the dashboard buttons
has been changed. Payable has been replaced by Purchases.

Filters, Group by and Search by options have been added for the Due Date
and the Discount Date fields in the Journal Items.

task-3516496

closes odoo/odoo#138188

Related: odoo/enterprise#48679
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-25 22:14:51 +00:00
Yannick Tivisse 7ebafb1eb7 [IMP] base: Remove manager rights to user demo
closes odoo/odoo#139731

Related: odoo/enterprise#49562
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-25 20:56:11 +00:00
Julien Carion (juca) 1693fee3db [REF] web: remove orm service nameGet
This commit removes all usages of the nameGet method of the orm service
following changes introduced by https://github.com/odoo/odoo/pull/122085

task-3377209

closes odoo/odoo#139727

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-25 20:56:10 +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
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
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
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
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
Luis González 024ef699e5 [FIX] web: add missing aria-label to button that opens developer tools
When the debug manager was migrated to OWL on ce559992, both `title`
and `aria-label` attributes were removed from the button that opens the
developer tools. However, the `aria-label` is actually required, because
such button doesn't contain any text, just the bug icon.

This commit restores (only) the `aria-label`text.

closes odoo/odoo#139630

X-original-commit: aefeb337f132d43f6ee3d5a9fc5bf4b6ef0af454
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-10-25 05:02:01 +00:00
FrancoisGe 2f0e7d5822 [FIX] web: KanbanRenderer is rendered twice
Before this commit, the KanbanRenderer was rendered twice.

Why:
---
The "getGroupsOrRecords" function used in the KanbanRenderer templace
uses the "sort" function on "list.groups". The "sort" function modifies
the array on which it is called, which will generate a rerender because
"list.groups" is reactive.

Solution:
---------
Call the "sort" function on a clone of "list.groups".

closes odoo/odoo#139547

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-24 15:23:31 +00:00
Pierre Pulinckx (pipu) 1d6f2da14a [REF] *: add chartjs assets bundle
In the goal of simplify assets loading, in this commit we create a new
assets bundle for chartJS and its luxon adapter.
With this, we can now use loadBundle instead of load these two libraries
with loadJS.

task-3562357

closes odoo/odoo#139544

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-10-24 15:23:30 +00:00
Pierre ParidansandAaron Bohy feaa6d64bd [FIX] web: tests: click helper: throw error if target is disabled
This commit is a backport of odoo/odoo@f065276a46

Before chrome 116, programmatic clicks on disabled buttons weren't
actually fired. With chrome 116, they are. As a consequence, some
tests fails on chrome 116 because they click (on purpose) on
disabled button to highlight the fact that nothing happens.

This commit improves the click helper to make it throw an error
when the target is disabled. It also adapts the tests that were
clicking on disabled button, in general to simply assert that the
button is disabled instead.

closes odoo/odoo#139537

X-original-commit: 0e8b50d540c9eee0837282883d603937b94b2fd2
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2023-10-24 15:23:28 +00:00
Adrien Dieudonne a2016359d0 [REF] web, *: avoid extend on h5 for kanban card title
´extends´ generates a lot of css rules.

So in this commit, we remove it by replacing it by the ´h5´ html tag.

closes odoo/odoo#139484

Related: odoo/enterprise#49408
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-10-24 13:55:30 +00:00
Aaron Bohy da257e9d57 [IMP] web: save a has_group rpc at webclient startup
...when voip addon is installed.

We want to avoid predictable rpcs that are systematically done at
webclient startup. In particular, the voip service needs to know if
the user has group "base.group_user", which produces a rpc when
the service is started.

To avoid this, this commit adds the information in the page
directly. As this information is also useful at other places
(even though it's not at startup), we directly add it to the
groupCache of the user service (and we do the same for the
"base.group_system" group, which we also receive in the page).

closes odoo/odoo#139477

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-24 13:55:26 +00:00
Jorge Pinna Puissant 54ae8f96cc [FIX] web: clickbot test modal menus
Before this commit, the clickbot avoid testing modal menus.

Now, the clickbot open and closed the modal menus.

task-id 3535596

closes odoo/odoo#139389

X-original-commit: 60e16f1e32a0e1448c91826ec06c1e0e8a7bb1fc
Related: odoo/enterprise#49352
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-10-24 13:55:20 +00:00
Aaron Bohy a4069e25b6 [FIX] web: CodeEditor: do not notify value props updates
Before this commit, the CodeEditor component called the `onChange`
props function each time the ace library fired the `change` event.
This in particular happens the value of the editor is set
programmatically by a update of the `value` props. Worse, in that
case, the event is fired twice: once with the empty string, and
one with the new real value. This isn't what we want for the
CodeEditor API. We only want to notify the parent of updates done
by the user in the UI. This commit thus filters out the noisy
`change` events fired by ace.

This fixed an issue with the ResourceEditor of the website: select
a scss or js custom resource, click on Reset: the resource is
marked as dirty, because `onChange` is called when the CodeEditor
is updated with the new value.

closes odoo/odoo#139154

Related: odoo/enterprise#49286
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-10-24 12:38:30 +00:00
Aaron Bohy 87c6dde49d [REF] web,*: SearchDropdownItem becomes CheckboxItem
Before this commit, there was a special kind of dropdown item
defined in the search/ folder, named SearchDropdownItem, which was
basically a DropdownItem but with role "menuitemcheckbox" instead
of "menuitem". It allowed to displayed a check icon in front of
values to indicate that they are selected. It is used especially
in the search menu, to indicated which filters/groupbys/favorites
are active.

This specific item is used in other context that search (e.g. pivot).
A similar usecase has also been introduced in website, in the
ResourceEditor (the wowl version of the AceEditor).

This commit thus moves the component to web/core/dropdown and
renames it into CheckboxItem.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 85372ffa94 [REF] web,*: remove last legacy stuff from several bundles
This commit removes the last low level legacy stuff (e.g. Widget,
mixins...) from the backend bundle, and from the webclient bundles
of mrp_subcontracting and project. They are no longer used in the
backend. There're still necessary for the frontend and for the
web_editor though, so we had to manually add them in the lazy
loaded bundle of the editor. Hopefully, the last widgets and
dialogs will be converted soon, and we'll finally get rid of all
those legacy files.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 5b511e27b8 [REF] web: remove select2 from backend assets
The select2 library is only used in the frontend, now that the last
backend usecase (AceEditor) has been removed. This commit thus
removes the select2 library from the backend assets.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 28d85defa5 [REF] web: remove useWidget compatibility helper
Now that the last Component using that helper have been fully
converted to Owl (AceEditorWrapper -> ResourceEditor), we can
remove it.

Part of task~3439226

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy fddb78a2af [IMP] web: SelectMenu: add autoSort props
By default, the SelectMenu component alphabetically sorts the
choices. Before this commit, this wasn't avoidable. As there's now
a usecase of SelectMenu where we want to enforce a specific order
on the choices (the website AceEditor), this commit introduces a
props `autoSort`, which is `true` by default, but which allows to
disable the sort.

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy fff1fa0392 [IMP] web: add initialWidth props to ResizablePanel
This props allows to specify the initial width of the panel, whereas
before the initial width was the minimal width, i.e. the user could
only expand the panel, not shrink it.

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy 4b79bbff82 [MOV] web: move ResizablePanel component to web
This component has been introduced in web_studio. We have now a
similar usecase in website, for the AceEditor component. We thus
move the component definition to web.

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
mano-odoo 88e75fd5cd [FIX] web: taglist hide avatar overlay in readonly
The avatars coming from the TagsList component could not differentiate
if the `Many2ManyTagsAvatarField` was in readonly. Displaying an hover
state style when in list view.

This commit checks if the tag.onDelete is defined to render the span
containing the hover effect.

task-3514404

closes odoo/odoo#139455

X-original-commit: ac1757d96ab9ddda934b9b49ad41d83c9567e5b8
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-24 11:10:09 +00:00
mano-odoo 787725e054 [FIX] web: kanban_card border top
In commit `2495bfa7259dcbd482b10c95a55313f86d594fcb` we introduce a fix
to adapt the kanban_card border using the border bottom of the prior
kanban_card as a border top allowing to display the outline effect.

This fix works for o_kanban_grouped but breaks the border in views that
are o_kanban_ungrouped. This commit fixes this by removing the
border-top only in the o_kanban_record that are o_kanban_grouped.

The :not(o_dragged) has been added as well to bring back the border when
the element is dragged.

task-3488451

closes odoo/odoo#139453

X-original-commit: 2be67ee122546273d12710c1c9bc3b7e11533b5d
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-24 04:59:10 +00:00
Pierre Paridans 3295c6e4c7 [REF] web: simplify iframe retrieval in position hook
This commit reworks and simplifies the `getIFrame()` method in the
following way : instead of trying to find/guess the targetted element
ancestor's document and then looking in this parent for the iframe
containing the targetted element, it now uses the popperEl as parent for
the iframes who may contain the targetted element.

In practice, the only caveats is that it won't support multiple nested
iframes (which we shouldn't use anyway in our codebase).

Part-of: odoo/odoo#138847
2023-10-23 20:07:30 +00:00
Leonardo Pavan Rocha 9086ef0296 [FIX] web: fix calendar view tests after revamp
This commit fixes breaking calendar view tests after the revamp done in
task-3455051 and task-3389317.

task-3455051
task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Leonardo Pavan Rocha ec3e3c3379 [IMP] web: save sidebar state in session storage
This commit adds the feature of saving the calendar state in the user’s
session storage. This allows the user to refresh the page and the sidebar will
be hidden/shown depending on what is saved in the session storage.

task-3455051
task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Elisabeth Dickinson bd60b947e9 [IMP] web,calendar,hr_holidays: mobile improvements
Improve Timeoff's calendar layout on mobile.
Change the "today" button into icon button on mobile.

task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Leonardo Pavan Rocha 9ffaaab0d3 [IMP] web: popover service prevent click away to cause a click event
Currently the popover service is closed when you click away from the popover.
However, it’s not expected that the click event that closes the popover,
triggers another click event. This was causing a frustrating issue in calendar
where you would close the popover by clicking on the calendar, and it would
open the “new event” form view. The solution is to prevent default when
closing the popover.

task-3455051
task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Leonardo Pavan Rocha 6e4ba770f6 [IMP] web: show date information in calendar header
This commit adds date information in the calendar header depending on the
scale that is being rendered. E.g. in yearly view, we show the year; in
monthly view, we show the month and year; in weekly view, we show the month,
the year and the week number; in daily view we show the day, the month and the
year.

task-3455051
task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Elisabeth Dickinson 94033a6386 [IMP] web: improve datetime_picker layout
The `datetime_picker` is smaller to fit into the narrower sidebar
and its header buttons improved.

task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Elisabeth Dickinson c9807a743b [IMP] calendar,hr_homeworking,web: improve popover layout
The attendance dropdown is a switch button and "Needs Action" is no
longer visible on the popover (instead none of the buttons are selected)

The popovers are larger and the icons aligned. Their headers are the
color of their event.

The year view's event links inside the popovers have the same styling
as their event in the calendar.

task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Elisabeth Dickinson 775ff75e40 [IMP] web,hr_holiday: improve calendar filter panel
We replaced the customized checkboxes with the original input element
with `.form-check-input` whilst still using the custom colors for more
consistency accross modules.

Avatars have the .o_avatar class added to them which allows us to resize
them with the CSS variable.
And SCSS has been replaced with utility classes where possible.

This commit has been moved here from
PR https://github.com/odoo/odoo/pull/127532

task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Elisabeth Dickinson f9222c4976 [IMP] calendar,hr_holidays, web: global revamp of the calendar view
What's new:
- The overall style is softer, the borders lighter
- The event's colors are less bright
- In month view: The AllDay events and multiple day events are block
colors while the events with start/end times on a single day have a
colored circle.
- A header hosts the date title and navigation buttons (which were in
the sidebar)
- The sidebar is narrower and collapses

We've fixed the height issues giving us double scrollbars in some views.
The sidebar, when long, was pushing the content beyond the frame giving 
us extra scrollbars. This has been fixed with a CSS grid and 
`overflow-y` on the proper elements.

task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Leonardo Pavan Rocha 2f4a83e5ab [IMP] web,hr_homeworking,calendar: overwrite default fc header to allow customization
In some modules at Odoo we want to have custom headers for calendar. Since
fullcalendar accepts a function callback that should render the header, it was
decided to have this method exist in the calendar_common_renderer. So any
other apps that want to add something to the header, can just extend this
method. This commit also changes how homeworking changes the header so that it
complies with this change.

task-3455051
task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Leonardo Pavan Rocha 83cd06fae6 [IMP] web: show past events with reduced opacity
In google calendar, events in the past are shown with a reduced opacity. This
makes it easier to differentiate which events are past or not. This commit
implements the same feature.

task-3455051
task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Leonardo Pavan Rocha d87d5fe51f [IMP] {google_,microsoft_}calendar: only show sync buttons if sync credentials are set
Before this commit, the sync buttons for google and microsoft would appear in
the calendar sidebar even if the sync was not set (module not installed and
credentials not set). After this commit the buttons only appear in the sidebar
if the credentials for that service are set.

task-3455051
task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00