Commit Graph
18067 Commits
Author SHA1 Message Date
Ritika Rathore 2b2d0e8b7e [FIX] web: fix color alignment in the kanban view
Steps:
- Install Field Service
- Open the Field Service module
- Click on the configuration
- Go to the Worksheet Template
- Now go to the kanban view
- In view, Click on dropdown menu of any card

Issue:
- In kanban view, when we are viewing in dropdown menu colors are not correctly
 centered.

Fix:
- Added in kanban color picker mb-0 & ms-2 for margin space from bottom & left.

Task-3508241

closes odoo/odoo#140807

X-original-commit: 97e90710f5f2e300131df442bba833a5e7ece29e
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-11-04 04:29:35 +00:00
Julien Carion (juca) 04a67936d5 [FIX] web: add shortcut to cog menu
This commit adds the "alt+u" shortcut to open the cog menu in order
to match with the behavior of the actions menu.

task-3560446

closes odoo/odoo#140798

X-original-commit: fbf245cb81453e1fedbfd4649a8284546da44ffb
Related: odoo/enterprise#50074
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-04 04:29:34 +00:00
Julien Carion (juca) 924a797a3b [FIX] web: domain field: foldable invalid domain
This commit fixes an issue with the domain field where a traceback would
be launched when an invalid domain is received. It also changes how
invalid domains are displayed in foldable domain fields so that only the
content of the domain selector component is displayed in this case.

closes odoo/odoo#140719

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-04 00:38:32 +00:00
Julien Carion (juca) 058117c333 [FIX] web: domain field: validate domain when edited in debug
This commit changes the behavior of the domain field such that it
performs a quick validation of the domain after it has been edited in
the debug input. This solves an issue where the isValid state was not
properly updated after debug input edition.

Part-of: odoo/odoo#140719
2023-11-04 00:38:32 +00:00
Leonardo Pavan Rocha b9ea99f667 [FIX] web: calendar hide weekends feature not showing
After the calendar revamp, a button in the scale selector to hide/show the
weekend in the calendar view was not being rendered. This was caused by a
wrong rebase that removed the props that were supposed to be passed to the
ViewScaleSelector component. This commit fixes this, therefore bringing back
the feature.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Elisabeth Dickinson f2579aa30c [FIX] web: remove unused xpath
This xpath was added in the calendar's revamp PR but is not used.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Elisabeth Dickinson 501f5cd58e [FIX] web: remove margin in the day-header of calendar's week view
The left margin in the day header was meant for day view only.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Elisabeth Dickinson 905b3f39e4 [FIX] web: add more space before calendar's title
The calendar's title in the header can use a bit more spacing

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Elisabeth Dickinson 740ddbb12b [FIX] web: fix calendar's sidebar spacings
The datetime picker's top and bottom padding is unnecessary in the 
calendar's sidebar.
An extra margin is added below the filters because the sync buttons
were too close.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Elisabeth Dickinson a78dd31669 [IMP] web: remove .o_calendar_popover_open class
The class was added to make the event highlighted when the popover is 
open, but this is buggy at the moment, better to remove until a better
fix can be made.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Leonardo Pavan Rocha d1285bc41c [FIX] web: calendar grid not being applied in tablet resolution
After https://github.com/odoo/odoo/pull/138670, the calendar view would start
breaking in tablet resolution. This was caused by a wrong media query that
was not being applied to tablets.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Leonardo Pavan Rocha 7eda053830 [FIX] web: scrollbar in calendar mobile view is on top of text
Currently the overflow-auto of the filters is in the wrong div, causing the
scrollbar to render on top of the attendees' names. This commit fixes this
issue by moving the overflow-auto to the correct div.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Leonardo Pavan Rocha a4ef58e6d5 [FIX] web: datetime picker gap not being set between picker titles
Currently the datetime picker computes a gap property in css for the rendered
titles, however since the display is not set as flex, the gap is not applied.
This commit adds the flex display so that the gap is applied.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Sébastien Theys 06603e9dc7 [FIX] mail: show translations for emails
Due to shadowRoot, emails were not properly translated.

closes odoo/odoo#140847

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-03 00:49:06 +00:00
Raphael Collet b7940d3760 [FIX] web: web_read() when the cache of x2many fields contain inaccessible records
closes odoo/odoo#140789

X-original-commit: 7dd900024f4ee9e6df05d979ae1e10e3f72a2565
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-11-02 23:23:01 +00:00
Romain Estievenart bd8565be2b [REF] web,*: remove jQueryUI
*: mrp_subcontracting, project, test_website, web, web_editor,
   website_slides

This commit removes jQueryUI autocomplete that was the last usage of
jQueryUI.

No longer usage of these features inside the codebase

task-3439226

Part-of: odoo/odoo#139209
2023-11-02 21:02:44 +00:00
Romain Estievenart 99f5ae32d3 [REF] web(site): migrate jQuery.autocomplete to owl component
Adapt the website industry selection autocomplete inside the
configurator to use the autocomplete owl component instead of jquery
autocomplete

task-3439226

Part-of: odoo/odoo#139209
2023-11-02 21:02:44 +00:00
Romain Estievenart 86a9171ec7 [REF] web(site): migrate jQueryUI urlautocomplete to owl component
*: web, website, website_form_project

Remove the jQuery UI Widget `urlautocomplete` by using made some
refactor to allow usage of the owl component.

task-3439226

Part-of: odoo/odoo#139209
2023-11-02 21:02:44 +00:00
Bastien PIERRE 9a798bc51a [FIX] web: fix install prompt on ios
Before this commit, the install prompt was half shifted out of screen.

After this commit, the install prompt is not shifted anymore.

closes odoo/odoo#140659

Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-11-02 16:57:54 +00:00
Manushi Shah (mash) ec2c7f0f54 [FIX] web: discard unnecessary scrollbar in kanban examples
Steps:
- Open Project
- Create New Project
- Select the blank new project and click on see examples below the stage.
- This also appears in the existing project where you want to add more stages.
- A Kanban Examples popup view will open.

Issue:
- A scrollbar appears on the bottom left due to the long name of the example.

Cause:
- Due to the overflow property, when the name is long, it will automatically
create a scrollbar, making it look weird.

Fix:
- Add overflow-x visible in notebook It will counterbalance the overflow-x: auto;
rule used in the general (aka. horizontal) use case, and force the overflowing
element to take the space it needs, adjusting the headers column's width accordingly.

closes odoo/odoo#140590

Task: 3422009
X-original-commit: 4fff4fbb308bf411603cfc239e9f651598d0de78
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-11-02 12:03:53 +00:00
Elisabeth Dickinson 89082fbd56 [IMP] web, *: fix favorite alignment
*: account, hr_recruitment, project, lunch, mrp

By removing the absolute positioning on ".o_favorite" inside kanban
views, we allow it to align naturally with the rest of the elements,
thus removing the custom code that was needed for padding.

By doing so however the icon - which is now only visible on hovering the
card in the Project's kanban view - should remain visible at all times.
The behaviour would be the same as in other kanban views: an outlined
star when not active and a full yellow star when it is.

The margin on the kanban heading in the Manufacturing orders has been
removed to realign the top elements.

task-3462098

closes odoo/odoo#131559

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-02 12:03:40 +00:00
Christophe Monniez 7094215e65 [FIX] web: skip clickbot qunit test
The clickbot test fails after October because of a hard coded month. It
needs to be refactored but let's skip it in emergency.

closes odoo/odoo#140641

X-original-commit: f9ec63dc3d865a24ec7da3f9389ce6b46fb66a83
Related: odoo/enterprise#49990
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-11-02 10:15:05 +00:00
Louis (wil) a46c800d53 [I18N] *: export source terms
closes odoo/odoo#140529

Related: odoo/enterprise#49925
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-31 15:54:32 +00:00
Antoine (anso) 124f247bd5 [FIX] web: fix hover style on disabled o_arrow_button
This commit fixes an issue where the interior of the arrow of the
disabled `o_arrow_button` was darker on hover

task-3573542

closes odoo/odoo#140122

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-31 13:26:41 +00:00
Mathieu Duckerts-Antoine ef97eaf987 [FIX] web: drag and drop: allow pointer down blur
If one edits an input value in a dialog and click on the dialog header,
the blur event is prevented because the dialog is draggable and the
pointer down native behaviour is prevented by the draggable hook builder.
This can cause data losses or the dialog content to not be render correctly.
For instance, this happens with the debug input of the domain selector
dialog.
We fix that by triggering the blur event programatically.

closes odoo/odoo#140436

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-10-31 10:34:01 +00:00
Aaron Bohy 4dc211dff8 [FIX] web: display filters directly in search bar
In views with a searchbar, we want the filters to be displayed
directly when they are activated, without waiting for the view to
be reloaded. This is to provide a direct feedback to the user.

Before this commit, this didn't work in grouped kanban view with
progressbar. The regression has been introduced by [1] which moves
the progressbar logic out of the model. With [1], the rendering of
the KanbanController waits for the progressbar data to be loaded
in onWillUpdateProps, thus delaying the rendering coming from the
WithSearch when a filter is toggled.

This commit applies the same logic as for the model: we do not wait
for the loading promise in onWillUpdateProps. That way, the
rendering coming from WithSearch is synchronous, but a reload is
initiated and another rendering will be scheduled by the Controller
itself when the data will be loaded.

This commit also adds a test for the model case, as it appears that
this wasn't tested.

[1] 58ca40b032

closes odoo/odoo#139967

X-original-commit: 47cf6e326f5a795984bac2138b169503c3dd099c
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-31 10:33:51 +00:00
FrancoisGe f534d1cccf [FIX] web: x2m editable in line and dialog
Purpose:
-------
The "StockMoveX2ManyField" custom field has given rise to a new need,
that of being able to edit a record in an x2many directly or from a dialog.
This is the first use case to require the ability to do both at the same time.

This particular use case highlighted a bug preventing a change from being saved.

How to reproduce:
- Go to a form view with an x2m using a custom widget
- Open an x2m record in dialog mode
- Close the dialog
- No changes have been made to the record, so the save button is not displayed
- Edit a field in the same record

Before this commit:
    The save button is not visible

After this commit:
    The save button is visible.

closes odoo/odoo#140298

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-10-30 15:18:02 +00:00
Michael (mcm) 89bf62b0c1 [IMP] web,*: remove legacy/utils.js from backend
This commit removes useless function from legacy/utils.js and removes it
from several backend bundles. The file is moved in wysiwyg and frontend
bundles as it is still used in these bundles.

task id: 3439226

closes odoo/odoo#140260

Related: odoo/enterprise#49812
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-30 15:18:00 +00:00
Michael (mcm) d8c0373f33 [IMP] web: link popover together
Before this commit, cliking on a popover that was open inside another
popover closed both of them.
After this commit, the popovers are not closed. them will close only if
we click out of them and the popovers they opened.

closes odoo/odoo#140258

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-30 15:17:59 +00:00
FrancoisGe 64037d03d0 [FIX] web: FormStatusIndicator flickering
Purpose:
--------
Before this commit, if you edit a char field with an onchange in
an x2many, the FormStatusIndicator buttons will flicker.

How to reproduce:
-----------------
- Go to a form view with an x2many field in list mode
- Type a char in the char field of a record
- The FormStatusIndicator buttons are visible
- Click outside the char field
- An onchange is triggered

Before this commit:
    The FormStatusIndicator buttons will disappear until the onchange returns.

After this commit:
    The FormStatusIndicator buttons remain visible.

closes odoo/odoo#140179

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-10-30 13:56:01 +00:00
FrancoisGe 6b045f540a [REM] web, *, remove few dom.js functions
In this commit, we will remove "closestScrollable", "compensateScrollbar"
and the last usage of "scrollFixedOffset" outside of dom.js.

closes odoo/odoo#140181

Part-of-task: 3439226
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-10-30 12:05:31 +00:00
Jorge Pinna Puissant 77c89b3316 [IMP] web: remove hasScrollableContent function from dom.js
Part-of-task: 3439226
Part-of: odoo/odoo#140181
2023-10-30 12:05:31 +00:00
Jorge Pinna Puissant 95fa59533d [IMP] web: remove areColliding function from dom.js
Part-of-task: 3439226
Part-of: odoo/odoo#140181
2023-10-30 12:05:31 +00:00
Jorge Pinna Puissant e2b0d3efe4 [IMP] web: remove non used dom.js functions
Part-of-task: 3439226
Part-of: odoo/odoo#140181
2023-10-30 12:05:31 +00:00
Jorge Pinna Puissant 3de178ed42 [IMP] web: remove non used safeConfirm from legacy Dialog
Part-of-task: 3439226
Part-of: odoo/odoo#140181
2023-10-30 12:05:31 +00:00
Hamza (hisl) c3289f0734 [FIX] web: set pointer events none for ribbon
The forms where we have ribbons do not provide a great user experience when the internal links are right below the ribbon. Because of the shape and size of the ribbon, the internal link button on the topmost fields gets behind the ribbon. Because the rectangular part of the ribbon is transparent, we can see the button, but cannot click or hover over it, because the ribbon element takes over. To resolve this, I set the pointer-events of ribbon to none. The ribbons already do not have any click events so this solution seems okay.

Steps to Reproduce:
1. Move a helpdesk ticket to the archive.
2. Try to move to the customer page using the internal link.

Current Behavior:
The link button cannot be hovered over and clicked.

Expected Behavior:
The link button should be above other elements and clickable.

OPW-3468153

closes odoo/odoo#140099

X-original-commit: c9aa5fb7645470c5a63784e58fdb4ee9acf7d5e8
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Simon Goffin (sig) <sig@odoo.com>
2023-10-30 12:05:26 +00:00
Pierre Pulinckx (pipu) e179fce25c [FIX] web: graph: sort tooltip content
Tooltip items are not correctly sorted anymore after migration to last
Chart.js version in the commit eb530b83b06a057f96.
This feature is fixed in this commit.

task-3552948

closes odoo/odoo#139676

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-30 12:05:20 +00:00
Pierre Pulinckx (pipu) ce1b61918a [FIX] web: graph: position correctly tooltips
Since c8ca9da7bc, the tooltips in the
charts can come out of the container and make the scrollbar appear,
which is not desired. In this commit, we fix that.

task-3568895

closes odoo/odoo#139987

X-original-commit: c1f08c60b7272e5a30951c53b67427e2f205b722
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-30 09:01:00 +00:00
Julien Carion (juca) 0c7e7e12af [IMP] web: edit domain button is available while loading records count
This commit removes the requirement that the records count should be
set before the edit domain button is shown for domains which must be
edited in a dialog. This could be annoying in cases the records count
loads slowly.

task-3561782

closes odoo/odoo#139969

X-original-commit: f2ba825eac5e4bda3d1b1d3676a1b737701c0fb8
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2023-10-30 09:00:58 +00:00
Odoo Translation Bot 6739c317d1 [I18N] Update translation terms from Transifex 2023-10-29 00:07:17 +02:00
c0b683e2f4 [IMP] web,*: improve darkmode
This commit introduces some adjustments to the dark mode color scheme
and the use of bootstrap classes in Community.

- Mini calendar contrast -

The colors were not using variables, making them non dynamic
and breaking the contrast in dark mode.

- Avoid !important rules spreadsheet -

Prior to this commit, spreadsheet top bar was using a `bg-white` class,
making it pure black in dark mode.

Since spreadsheet is designed with light colors and we don't provide a
dark mode for it, we remove that class and set a `background-color`
property using CSS in Enterprise.

- Input color -

This commit fixes the focus behavior on the searchbar in the control
panel, the `command_palette_search`, and the `start a conversation` in
discuss.

- Copy clipboard field border color -

Make use of the `text-primary` color for the copy to clipboard field
We use the o-theme-color function to avoid an undefined since primary
doesn't exist in the o-theme-text-color map in white mode.

- Web_editor toolbar variables -

The toolbar was using the `o-brand-primary` variable
which was set to a darker shade. This caused issue when activating an
option due to how vibrant the color is.

- Improve the controls on border-color -

Introducing a custom property on the border-color to allow
further control on individual components (such as the popover).

- Improve setting tabs colors use -

Prior to this commit, the colors of the settings tabs menu were kinda
inverted. The menu was light in dark mode and dark in light mode.

We fix this by changing the values associated to the CSS variables in
use.

- Make model field selector dark mode proof -

Fixing the design of the model field selector popover in both
light and dark mode. Since the popover was using custom style with
arbitrary values, it was not designed for the dark mode and had a lack
of consistency.

To improve the design, we use variables rather than custom style, and
make sure the desired render is as close as before.

- Sign colors use -

This commit aims to improve the sign module in both light and dark mode.
There were some readability issue with some `btn-light` having poor
contrasts in both light and dark mode, and the use of some classes was a
bit unexpected (e.g `card-header` to set a grey background with some
padding).

- Improve buttons design inside listview -

Prior to this commit, this button was using custom CSS to make it look
like a primary button, while it was using classes related to secondary
buttons.

We remove the custom CSS used to style it correctly and keep our button
design consistent.

- Messaging menu layout in mail -

This commit aims to improve the design of the notifications displayed
in the messaging menu. Prior to this commit, the notifications dropdown
was using custom CSS variables overriding the regular behavior
of our dropdowns.

In fact, the layout was generating some friction:

1) Marking a notification as read would turn its background into a
darker color

2) Effects like `:hover` were all based on the custom CSS variables
resulting in an inconsistent layout.

- Multi company selector adaptations -

In darkmode the multi company selection was using the btn-light which
creates a weird effect and overrides the dropdown default hover behavior

This commit uses the btn-link to display an hover effect on the
company switch and on the checkbox while blending with the background
and the default dropdown hover effect.

- Adapts default badge design -

Improve the design of the default badges in dark mode.

If you open the light mode, these badges are dark grey with a white
text. If you switch to dark mode, they are dark grey but with a dark
text, which makes them look either muted or off.

We make use of SCSS variables to handle the color of the component,
providing a good styling in both modes.

- Fix kanban cards borders inside dropdown -

Fixes the issue with the divider inside the kanban dropdown menu not
showing in dark mode.

To ensure it is visible, we assign it the `$dropdown-divider-bg`, which
is the color it should use, as the horizontal divider above uses.

- Fix tour pointer design for dark mode -

This commit aims to insert the tour pointer and its content inside the
styling we applied to our tooltip.

To do so, we make sure it uses CSS variables, allowing more control and
consistency, plus we replicate the overall look of our tooltips.

- Fix `text-primary` on action background contrast -

This commit improves the readability of our `text-primary` classes when
it's used on a `$o-component-active-bg` background.

Prior to this commit, the `text-primary` was not meeting the contrast
standard, mainly when you were using the `CMD+K` shortcut on the
app switcher.

To prevent that, we changed the background to a `$o-component-active-bg`
background with an opacity ensuring our text provides a good contrast.

- Fix input states -

Prior to this commit, the `--o-input-border-color` CSS variable was
using the `$o-form-lightsecondary` variable to define the standard color
of the `border-bottom` property of our inputs.

This was conflicting since `$o-form-light-secondary` is also used to
define the `background-color` of our table on focus.

With this commit, we separate these two element with different variables
to make sure they don't affect each others.

- Fix kanban ghost background -

Before this commit, if you created a project without any stage or element
in it, the ghost cards that act like placeholders would be pure `#000` in
dark mode, due to the `bg-white` class.

This commit replaces that class with a `bg-light`, providing a better
visual result in both light and dark mode.

- Fix new message design -

Improve the design of the new message element while
inside Discuss, using our danger color, ensuring a good visual result in
both modes.

task-3201038

closes odoo/odoo#139966

Related: odoo/enterprise#49666
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: chgo-odoo <chgo@odoo.com>
Co-authored-by: stefanorigano <sri@odoo.com>
2023-10-28 10:07:53 +00:00
Mathieu Duckerts-Antoine 0ff280ec6d [IMP] web: ExpressionEditor: better conversion of in/not in operators
When foo is not an x2many, a condition of the form
("foo", "in", [])
was transformed by the ExpressionEditor into
"set([foo]).intersection([])"
while it can be better expressed as
"foo in []"

In this commit, we improve the conversion of conditions of that kind and
similar other conditions.

Note that we also ideally want domains and their corresponding expressions
to be evaluated the same ways on records (at least on good examples).
For this we want for instance, the condition
("foo", "in", 1)
to be translated to
"foo in [1]"
and not
"foo in 1"
which is an invalid Python expression.

closes odoo/odoo#140140

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-10-27 21:36:53 +00:00
Xavier Luyckx (xlu) e24c655105 [FIX] web: stat button border-radius styling
This commit addresses issues related to the border-radius styling for
the `buttonbox` buttons. The main goal was to ensure that the first and
last buttons in the button box bar, whether directly inside the `buttonbox`
or wrapped within a `<div>`, consistently receive the desired border-radius.

Existing CSS rules were not consistently targeting the first and last
buttons, especially when they were wrapped inside `<div>` tags, like the
"Go to website" button or "more" dropdown button.

I also added a z-index-0 to the buttons inside `<div>` tags, so they can
receive the correct border-color on their active state.

This commit resolves this issue.

task-3563305

closes odoo/odoo#140106

X-original-commit: d5cf6c6ac7eb7674d6a9c18a23c37ec0861ba258
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Xavier Luyckx (xlu) <xlu@odoo.com>
2023-10-27 21:36:49 +00:00
Xavier Luyckx (xlu) 82de0d7dc4 [FIX] web: stat button active border
Previously in the button box, right borders of stats buttons in their
active state were hidden/not displayed correctly.

This commit addresses and resolves that issue.

task-3568551

closes odoo/odoo#140103

X-original-commit: 2ab61bc841f0281c59e6b87700215b06acf07545
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Xavier Luyckx (xlu) <xlu@odoo.com>
2023-10-27 21:36:48 +00:00
FrancoisGe 5696b5686e [FIX] web: select all records should trigger only one rendered
Purpose:
--------
From the new RelationalModel (odoo/odoo#114024), in the list view, when
all the records are selected, the ListController is rendered once per record.
This causes performance problems and can cause a flicker where each record
is selected one by one.

Why:
----
When selecting all records, we will call record.togggleSelection() on each
record but this function uses a mutex. So each record will be selected
asynchronously. As the state is not modified by the same tick,
a rendering will be triggered for each call to record.togggleSelection.

Solution:
---------
Add a togggleSelection function to the DynamicList which will select all
the records in the same mutex. The state will therefore be modified in
the same tick and there will be a single rendering.

closes odoo/odoo#139859

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-27 20:16:02 +00:00
Julien Mougenot 43640ceb1c [FIX] web: use same date in object test
Before this commit, a test in the "objects" test suite failed because
the 2 dates generated to verify equality could potentially be created
in a different millisecond, which would make the test fail.

A first fix simply assumed that patching the date would suffice, but
this did not solve the issue since the time advances normally even for
patched dates.

This fix ensures that the dates have exactly the same values (and
removes the patch which was not necessary anyway).

Runbot task 25596

closes odoo/odoo#139953

X-original-commit: b02d7fe6c4eaee09066cf58d0e9bad91e3a3234d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-10-27 13:02:22 +00:00
Pierre Paridansandstefanorigano 75b3282246 [FIX] web,calendar: don't set static CSS properties in loop
tl;dr : it may be smaller in the SCSS file, but definitely not in the
generated CSS file. Do'nt repeat want can be set once.

These changes result in roughly 130KB gain in the backend bundle.

Follow-up of https://github.com/odoo/odoo/pull/138670

task-3546717

closes odoo/odoo#139683

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
2023-10-27 11:35:00 +00:00
Xavier-Do bf3b6b0b8b [IMP] base, web, *: change url formating
Previously proposed formating was trying to normalize extra in one part
of the path. This means that no extra needed a placeholder.

The implementation was meant to be more generic and extendible since a
part of the logic has to be in website.

A suggestion was made to make it more restricted but explicite by
keeping the url simple in web/controllers/binary.py but adding a
controller in website to add this extra part.

The base extra direction is now in the extension, as the min part.

Initial urls:
/web/assets/{unique}/[{website_id}/][rtl/]{bundle_name}[.min].{extension}

New urls:
/web/assets/[{website_id}]/{unique}/{bundle_name}[.rtl][.min].{extension}

Managed by two routes:

/web/assets/<string:unique>/<string:filename>
/web/assets/<int:website_id>/<string:unique>/<string:filename>

Where filename is in the format {bundle_name}[.rtl][.min].{extension}

Multiple possibilities where proposed

- /web/assets/website/<int:website_id>/<string:unique>/<string:filename>
More explicit but prefixing by /website was considered

- /website/assets/<int:website_id>/<string:unique>/<string:filename>
This one is a litle painfull to match similar attachement, where
website is ignored.

- /website/<int:website_id>/assets/<string:unique>/<string:filename>
Almost accepted but subjective, and anyway two previous solution breaks
the cdn mecanism and would need a migration

- /web/assets/<int:website_id>/<string:unique>/<string:filename>
Almost accepted but subjective, and anyway two previous solution breaks
the cdn mecanism and would need a migration

This last solution was not ideal to match without unique
/web/assets/%/<string:filename> can match both

/web/assets/123456/<string:filename>
and
/web/assets/1/123456/<string:filename>

Anyway, matching without unique shouldn't be supported for al (even if
it is kind of supported with any right now) but it will work by changing
unique wildcard to a more specific one (_ * 7)

closes odoo/odoo#131353

Related: odoo/enterprise#47313
Related: odoo/design-themes#730
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-10-27 11:34:52 +00:00
Xavier-Do 94a47f25ce [IMP] web, website: add validation for /web/assets
Increase the validation of assets url especially when parsing extra to
avoid aving to much possible url for the same asset.

Part-of: odoo/odoo#131353
2023-10-27 11:34:52 +00:00
Xavier-Do 64bbef5bc1 [IMP] base, web: generate assets outside rendering
The generation inside the rendering has some drawbacks:

- `commit_assetsbundle` is needed for reports rendering because the
template rendering may generate some assets that will be accessed by
another transaction before the transaction is committed. But this
solution is not ideal since the transaction is committed in the middle
of the request

- when the first rendered page is a 404, the assets are not committed
and the page is broken.

- when starting, deleting an attachment can create a concurrent update
error and the request is retried. This will occur once per attachment
and for all worker trying to access the same resource. The whole
transaction is rollbacked, even the previously created assets bundle.

- The cold page load is a slower since there is more work to do.

- Implementing a readonly request is difficult because it could be
transformed to read write and re-executed if the assets bundle does not
exist.

Generating assets when needed solves those issues. The concurrency
when deleting an assets could still occur but only once per bundle, and
in a smaller transaction. This could be solved with a lock now that we
have more control on the transaction. The commit_assetsbundle can be
removed and 404 page should have a correct layout. The cold page load
could be a little faster because the assets bundle can be generated in
parallel requests instead of sequentially when rendering the page.

Part-of: odoo/odoo#131353
2023-10-27 11:34:52 +00:00