Commit Graph
14516 Commits
Author SHA1 Message Date
Pierre Paridans eef262abf4 [FIX] *: adapt QUnit tests and tours
[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Damien Bouvy 3aaa0bfff1 [FIX] web: don't override control panel display
The control panel 'display' prop provided to the list controller can
sometimes be falsy instead of being an object - in that case (mainly
studio), the cp should not be displayed at all. The display getter did
not return a structure that allowed this to behave properly.

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Elisabeth Dickinson 80098df3dd [FIX] *: fix ribbons position and size
This commit fixes the ribbons used in `kanban` and `form` views.

The SCSS uses the square root of the parent `div.ribbon` to calculate its
diagonal width and applies that width to the child `span`.

After changing the ribbon's transform-origin, we calculate the ribbon's
position based on CSS variables of the view's top padding,the height of
the ribbon and the shadow's size (to avoid it being cropped by
overflow-hidden).

By changing the values of a few of these variables in the kanban view,
we were able to remove all the specific SCSS related to ribbons in the
modules.

Other changes were applied inside some of the modules to make this
work:

- `event`: padding corrections on the kanban's cards;
- `hr_holidays: replaced `margin:0` in the SCSS with negative margin
utility classes on the element to achieve the same visual result;
- `discuss`: moved the ribbon to the parent element;
- this was also done to `discuss`, `survey` and `helpdesk`;
- `crm_team_view` in `sales_team`: the ribbon's height made it overflow
from the kanban's card. We fixed this by changing the value of one of
the CSS variables in the view's SCSS file;
- the same thing was done in `survey` and `appointment`;
- `website_event_exhibitor` had some SCSS that wasn't being used because
it uses `.o_ribbon` instead of `.ribbon`

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:21 +02:00
Brieuc-brd 8a2875bb38 [IMP] delivery, sale_loyalty, project: adapt for milk
This commit adapts the spacing between the buttons in the
sale_order_views to fit with Milk.

project: layout fixes:
- Fixed kog displaying on top of the project status button
- Fixed the flickering in project updates when selecting rows in list
view

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:21 +02:00
stefanorigano (SRI) 3e5a012ebf [IMP] web: BadgeSelectionField, predictable and consistent design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:21 +02:00
chrysanthe(chgo) 4f3e886c68 [IMP] web: fix calendar year view min-width
== ISSUE ==

When you access the calendar view inside a module and render the year
view, there is only one month per row, which is due to the base `rem`
unit value change.

In fact, we introduce a new value for the `rem` unit with Milk,
which is 16px.

On Master, 1rem is actually 12px, so 4px less.

Since the `min-width` of the `.fc-month-container` is defined using rem,
we have :

`min-width: 144px` on Master
`min-width: 192px` on Milk.

This huge difference cause the months to occupy more space than needed.

== After this commit ==

The `min-width` of the month container is removed so we have one single
month per row on small devices. This makes the calendar more accessible
and easier to navigate through for users.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:20 +02:00
Damien Bouvy 56ef4017cd [IMP] web: allow overriding the breadcrumb
Some apps may like to easily override the breadcrumb (e.g.
spreadsheet_edition, which makes the breadcrumb *editable*)

Part-of: odoo/odoo#116641
2023-05-12 22:59:20 +02:00
Damien Bouvy 05b10edc02 [IMP] web: controlpanel selection-actions slot
Selecting records in a list view will trigger the display of UI elements
that will allow users to manage the selection and run actions on the
selected records.

Prior to this commit, this UI section was displayed within the
'additional actions' slot of the CP, but for UI consistency when
switching to/from mobile view (where the searchbar is usually hidden),
a new slot for 'selection-actions' is added to the control panel, in the
same place as the searchbar (indeed the searchbar is hidden when a
selection occurs, so sharing the same space seems like a good idea as it
avoids clipping/overflow issues)

Part-of: odoo/odoo#116641
2023-05-12 22:59:19 +02:00
Damien Bouvy 4b21d735f9 [IMP] web: cp responsiveness
- Avoid isSmall in template and use bootstrap display classes for
  better responsiveness
- Re-order items to preserve order between size transitions as much as possible
- Change several breakpoints:
  - Viewswitcher collaspses faster (lg instead of sm)
  - Create 'always' buttons collapse in dropdown faste (lg instead of sm)

Make the searchabr appear/disappear based on sizing for better
responsiveness.

Hide the searhbar by default  once we go under the LG breakpoint,
so that it does not cause re-flows when a user selects a record's
checkbox in list view.

'always buttons' that are meant to always be included in the control
panel are collapsed into a dropdown attached to the 'new' button when
the size drops below a specific breakpoint.

This commit ensure these breakpoints are correctly mirrored between the
JS code and the XML template, and also make sure the 'btn-group' class
is removed when there is no button to display in the dropdown (otherwise
the 'new' button is styled as-if some buton is supposed to be next to
it).

Part-of: odoo/odoo#116641
2023-05-12 22:59:19 +02:00
Damien Bouvy 1e706d3069 [IMP] web, *: milk adaptations
*: hr_holidays, stock, sale, product, web, sale, purchase, stock,
   website, survey

Adapt some custom control panels (mainly for custom reports) to the
milk controlpanel.

hr_holidays:
Move the buttons to create a new time off or a new allocation to the
"create button" slot and transform it into a dropdown (creating
allocation requests is clearly a secondary action, not a primary one)

stock:
3 lines does not fit, must be on 2 lines

Part-of: odoo/odoo#116641
2023-05-12 22:59:19 +02:00
Damien Bouvy 1136803dc5 [IMP] web: Settings: search input & save/discard buttons
Properly styled search input.

Use the correct slot for "save/discard" buttons, as they should never collapse
even in mobile mode.

Part-of: odoo/odoo#116641
2023-05-12 22:59:19 +02:00
Damien Bouvy 8bcbdff415 [IMP] web: reverse the collapsed breadcrumb
The collapsed breadcrumb should list its older entry at the bottom, so
that the reading direction is somewhat linear (start from bottom of
dropdown, go up, then go right - instead if going down the breadcrumb
then go back up before moving right).

Part-of: odoo/odoo#116641
2023-05-12 22:59:19 +02:00
Damien Bouvy 012b01fb74 [IMP] web: keyboard shortcut for searchpanel
The unified search panel deserves its own shortcut
Use shift+q to be consistent with the searchpanel's input shortcut (q)

Part-of: odoo/odoo#116641
2023-05-12 22:59:18 +02:00
Pierre Paridans 2a09a948f8 [IMP] web: ControlPanel adaptations on mobile
Part-of: odoo/odoo#116641
2023-05-12 22:59:18 +02:00
Brieuc-brd 0f065ed8ea [IMP] web,mail: pivot & chatter design adaption
Part-of: odoo/odoo#116641
2023-05-12 22:59:18 +02:00
stefanorigano (SRI) 316c4dc801 [IMP] web: control_panel, inject breadcrumbs actions in the right spot
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:18 +02:00
Pierre Paridans ffc359dc5c [IMP] web,*: CP's CogMenu rework to add misc items from favorite
Part-of: odoo/odoo#116641
2023-05-12 22:59:17 +02:00
Romeo Fragomeli c8ca9da7bc [IMP] web: move views' buttons into the view itself
Were previously in the ControlPanel.

Part-of: odoo/odoo#116641
2023-05-12 22:59:17 +02:00
Pierre Paridans caef16ee4e [REF] web,*: ControlPanel layout
This commit brings the ControlPanel into a single line with 3 main
sections:
- buttons & breadcrumb
- layout related actions (ie. the SearchBar in multirecord view or
  ButtonBox in formView)
- navigation (pager, switch view...)

Add new search bar menu, this is a merge of the following components
into one big component display in column:
* comparison_menu
* favorite_menu
* filter_menu
* group_by_menu

Also adapt navigation hook.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Brieuc-brd d17743e34e [IMP] * : add missing borders
Depending on Milk, this commit adds some missing borders.

Also adapts default `border-radius` to apply milk design.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:15 +02:00
stefanorigano (SRI) 23504d3d85 [IMP] web: searchbar, mini-calendar & CommandPalette design
Ensure square-ish table cell in mini-calendar.

Better breadcrumbs actions alignment in ControlPanel.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:15 +02:00
stefanorigano (SRI) 87a6d95c38 [REF] web: calendarView & graphView design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:14 +02:00
824024f8aa [REF] web,mail: formView design
- ButtonBox is moved to the ControlPanel's actions section (center).
- StatusBarField, ButtonBox and PercentPieField design.
- Chatter is moved below the ControlPanel (aka "in the view")

task-2818586

Part-of: odoo/odoo#116641
Co-authored-by: Pierre Paridans <app@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2023-05-12 22:59:14 +02:00
stefanorigano (SRI) c964329add [REF] web,account: listView & kanbanView design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:14 +02:00
stefanorigano (SRI) fb8c6f652d [REF] web: ControlPanel colors
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
stefanorigano (SRI) f951b72716 [REF] web: inputs, dropdown, popover, tooltips design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
stefanorigano (SRI) 79f57643ce [REF] web, mail, hr, website, auth_totp, test_apikeys: top-menu design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
stefanorigano (SRI) ef31306130 [REF] web, mail: badges design
Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
stefanorigano (SRI) 051ac37232 [IMP] web, * :introduce o_avatar
*: account, gamification, mail, mrp, note, project, website_blog,
   website_event_track.

Uniform design defining a common element shared across different
modules.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +02:00
stefanorigano (SRI) 24e89badac [REF] web,project,hr_holidays: buttons design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +02:00
stefanorigano (SRI) 46b762a1f1 [REF] web, *: milk colors
*: google_calendar, hr_holidays, hr_skills_slides, mail,
microsoft_calendar, point_of_sale, web_editor, website_livechat,
website_sale

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +02:00
stefanorigano (SRI) 589f6954dc [REF] web, mail, project, website_slides: backend bootstrap review
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +02:00
stefanorigano (SRI) e81f4c1a56 [REF] web: uniform spacing
Uniform measures for spacing elements.

Round up the buttons' paddings: prior to this commit, `.btn` had
unrounded padding that created a blurred effect when we used UI Icons in
it.

task-3280695
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:11 +02:00
stefanorigano (SRI) 2b32d1431a [IMP] web: increase base font-size to 14px
task-2818586
task-3280695

Part-of: odoo/odoo#116641
2023-05-12 22:59:11 +02:00
Mathieu Duckerts-Antoine 4e33d82e2f [FIX] web: graph: avoid some useless chart renderings
With a slow network, make a new search in the search bar of a graph view
would lead the graph renderer to be rendered twice. This was due to the
fact that in the graph controller template an arrow function is passed
as a prop to the graph renderer. The reactivity system treats that prop
as changing at each graph controller rendering and ask unnecessarily (in
this case) the graph renderer to render.

closes odoo/odoo#121292

X-original-commit: dab0187e382e5f93dd5ccc78ecbd7e2f47f5c75e
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-12 20:52:23 +02:00
FrancoisGe be520c4638 [IMP] web: useCommand supports hotkeyOptions
With this commit, all hotkeyOptions are accepted when defining a command
with hotkey.

In the hotkey service, to unify the API with the command service, we will
rename validate to isAvailable and remove the target param because
it is never used.

closes odoo/odoo#121257

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-05-12 20:52:13 +02:00
gawa-odoo dba7056c71 [FIX] analytic: allow filtering based on analytic distribution
Currently, the field `analytic_distribution` does not appear in
the filters, while it should (to be able to filter `account_move_line`
for example).
We added Json to the filterable fields. If not overriden, it will
search on it like a String.

We also have to add a non-stored field to be able to define a search
function for `analytic_distribution`, to be able to search based
on the keys of the json.

closes odoo/odoo#121223

X-original-commit: 3d3e6847230d5cc9cd61a9bf83bef403a5b4b3ec
Signed-off-by: William André (wan) <wan@odoo.com>
2023-05-12 20:52:06 +02:00
Julien Banken c93ca58d2a [IMP] web: add "fs" size option for dialog
This commit will add a new size named "fs" for the Dialog component. It
will force the dialog to have a width of 100%.

task-2796157

closes odoo/odoo#114401

Related: odoo/enterprise#34663
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-12 19:54:19 +02:00
Om Rabara b4a2479033 [FIX] web: file uploading state after failed upload
when file uploading is failed that time file uploading state does not change.

sentry - 3957419658

closes odoo/odoo#120818

X-original-commit: https://github.com/odoo/odoo/commit/1493ec2fedf7070882f3497f214f39c862432a2b
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-05-11 18:25:20 +02:00
qsm-odoo 1b428bd0b0 [FIX] web, base: review lazy loaded <script> definitions
The assets bundle system allows to generate `<script>` elements whose
resource is meant to be lazy loaded. In that case, a "data-src" is used
instead of "src" directly as attribute. This is valid HTML code: "src"
is not required. However... this lazy loading system also automatically
added `defer="defer"` which makes the "src" attribute required, thus
failing W3C validation.

Now, we only add "data-src" and the `defer="defer"` part is added on the
client-side, once the "data-src" is switched to "src". Note that this
"defer" attribute may not be needed in this case at all, but it cannot
hurt.

Part-of: odoo/odoo#120311
2023-05-11 18:25:08 +02:00
Julien Mougenot 805197daf9 [IMP] web: Optional start date in daterange fields
Before this commit, the date/datetime/daterange fields only allowed for
an optional end date field. This meant that the primary date was always
the start date.

This commit allows the field to do the opposite: with the primary date
being the end date, and having a `start_date_field` option for an
optional start date.

closes odoo/odoo#120695

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-05-11 09:36:24 +02:00
MerlinGuillaume a84e9b05ca [FIX] web: prevent email field to overflow
Readonly email fields break the layout if the value is long enough

Steps to reproduce:
1. Install CRM and Studio
2. Go to CRM and open any lead
3. Change the lead email and make it too large for the field size
4. Toggle Studio, in the View tab, uncheck 'Can Edit'
5. Close Studio
6. The email overflows its expected position

Solution:
Put the email field inside a grid layout div

opw-3248361

closes odoo/odoo#121020

X-original-commit: 855e72af9907cbfdcf1a0debd8011be9934eeb8f
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-05-10 21:18:21 +02:00
Julien Mougenot 61414cb8fc [FIX] web: Fix crash in datetime field tests
Before this commit, a test spawning a datetime field in an editable list
view would crash randomly based on the assertion that a datepicker
should not be in the DOM after clicking on that field.

This is wrong however since a click triggers a focus, which is the
condition for the picker to open, althouth this mostly happens after an
additional animation frame because of the way the list works (field
becomes editable on next render -> picker then opens on next render).

This commit adds a nextTick delay after clicking on the cell to restore
the intended behaviour, which is to wait for the picker to open.

closes odoo/odoo#120999

Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-05-10 21:18:16 +02:00
FrancoisGe 21d3b73c2f [FIX] web: change action from a dirty form view
Before this commit, if we try to change the action from a form view
a new record in an x2m and the new action fails to mount, then the new
record in the x2m will always have a virtual id even if it has already
been saved on the server side.

Why:
When you try to exit the form view, the form view will save the record
and not read the record because you leave the view (in the beforeLeave).
But in our case, we fail to mount the new action and so we will stay on
the form view without it doing a read to know the id of the record added
in the x2m. So the view thinks that the x2m still contains a virtual record.

Solution:
Going back to action should rebuild the whole compound. To cause this,
we'll restore the last controller.

How to reproduce:
- Going to a form view with an x2m field and a widget performing a doAction
- Add a line to the x2m
- Click on the widget to change the action
- New action fails to mount, it returns an error
- Close the error dialog
- Edit another field
- Save the form view

Before this commit:
    The new line in the x2m is duplicated.

After this commit:
    The new line in the x2m is unique

opw-3193765

closes odoo/odoo#120765

X-original-commit: 72f68e2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-05-10 19:17:17 +02:00
Bruno Boi 2ddc7348f2 [FIX] web: optional viewMode in x2m field
Before this commit, when having a x2many field invisible in a view, and displaying
it anyway in studio, there was a crash because some variable was undefined.

This originated from commit f22961a, which did not account
for the fact that viewMode is an optional props.

After this commit, the util function used by the x2m field and where the
crash occur has been refactored.
Moreover, the x2m field template has also been slightly refactored.

closes odoo/odoo#120918

Taskid: 3305808
Related: odoo/enterprise#40852
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-05-10 16:36:51 +02:00
luvi 9575aba9ca [IMP] mail, *: add hover title to the activity button
*: project, web

This commit adds the title and aria-label attributes to the activity
button. This makes the hover display the summary or an explaination
about the button, especially when there is no text displayed next to
the button (in Kanban view).

In the state selection field, a title has been added when hovering
the state in kanban, allowing to see the current value. The project
task state selection has also been adapted to have that title attribute
set on the toggler.

task-3207639

closes odoo/odoo#120871

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-05-10 16:36:45 +02:00
Adrien Schoffeniels ece5f26c10 [FIX] web: use copy of fields when using a kanban model
Since commit [1], properties can be displayed in list views. However,
when switching from a kanban view showing the properties to a list view
that should be showing the same properties, these are not shown.

This happens because the model in the kanban controller currently uses a
reference of the fields. When loading the list view, the properties are
thus already in the fields, and they are skipped when trying to apply
them.

This commit solves the issue by working with a copy of the fields in the
kanban controller, as the list controller does since commit [1].

[1]: https://github.com/odoo/odoo/commit/70619d0e6a23f955265c99aa6b25924357e46223

Task-3284508

closes odoo/odoo#120128

X-original-commit: 4ccb018ef1d301d2e52fea05b4949d77049be3ca
Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-10 13:21:49 +02:00
Julien Carion (juca) 787c6ff32a [FIX] web: Handle access rights in readonly fields
This commit adapts the behavior of all readonly fields
to take access rights into account when deciding whether the field
should be editable or not.
Steps to reproduce: give minimal access rights to Marc Demo user,
log in as Marc Demo, go to crm, make sure no one is assigned as
salesperson in a record and check if the add user icon is available.
Also applies to every kanban view fields (like priority,
many2many_avatar, ...)

opw-3265086

closes odoo/odoo#119818

Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-05-10 13:21:47 +02:00