Commit Graph
100 Commits
Author SHA1 Message Date
Pierre Paridans 3fd016a443 [IMP] web,survey,website_slides: remove unused jQuery Form plugin
None of the main methods provided by this plugin were stil used; only
the internal method `enable()`.

This commit replaces these calls by toggling the `disabled` HTML
attribute.

closes odoo/odoo#130817

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-04 15:02:27 +02:00
Pierre Paridans d6edddb216 [IMP] web,point_of_sale,website_slides: remove legacy daterangepicker
Note: the "event_tour" stil has step targetting the .daterangepicker
selector... but as this tour is broken since (at least) 14.0, its fix
will be tackled in another PR.

closes odoo/odoo#129993

Related: odoo/enterprise#44742
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-04 13:42:00 +02:00
Pierre Paridans 690e184dd2 [IMP] web,website_slides: removes placeholder attribute polyfill
Mainly used for Internet Explorer support (cf. placeholder attribute is
supported since IE 10).

We are in 2023...

closes odoo/odoo#130692

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-04 10:59:16 +02:00
Pierre Paridans ba6784eebd [REF] web,website_slides: move scss out of legacy
closes odoo/odoo#129983

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-28 16:29:09 +02:00
Pierre Paridans 22407b51ea [IMP] web,website_slides: remove unused banner.scss
Part-of: odoo/odoo#129983
2023-07-28 16:29:08 +02:00
Pierre Paridans fc254684fe [IMP] web: remove unused datepicker CSS rules
Part-of: odoo/odoo#129983
2023-07-28 16:29:08 +02:00
Pierre Paridans a14151c7bc [IMP] web: remove unused rules for .o_field_color_picker_preview
Part-of: odoo/odoo#129983
2023-07-28 16:29:08 +02:00
Pierre Paridans 54a34733a6 [IMP] web: remove unused markAnim CSS animation
Part-of: odoo/odoo#129983
2023-07-28 16:29:08 +02:00
Pierre Paridans d64a23ea22 [FIX] website: CSS properties value comparison
Due to a change between Chrome 101 and 114, the CSS Custom Property
containing custom string are now always serialized using the type of
quotes used in their declaration (ie. single quotes will be kept ;
double quotes also) which wasn't the case in previous versions of Chrome
(and still not the case in WebKitGTK 2.40.0 at least).

This doesn't impact the value itself but only comparison between the
computed value and an arbitrary one (like we do in the design-themes
test).

This commit fixes it by removing the single/double quotes in the
`assertCssVariable` test helper.

The impacted precondition was introduced in odoo/odoo@b29e17765f and
odoo/design-themes@8b377af3a7 .

closes odoo/odoo#125500

X-original-commit: 82074846c429dd6abad5734680ca3e7923668bb9
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-06-20 11:33:28 +02:00
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
Pierre Paridans 2a09a948f8 [IMP] web: ControlPanel adaptations on mobile
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
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
Pierre Paridans 7c94decb77 [FIX] web: non deterministic error in calendar view's mobile test
Missing `nextTick` for this `tap` (compared to other similar calls).

closes odoo/odoo#119479

X-original-commit: 7ff8c563edf1b32ecf8222399637c294b5f58e9d
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-04-24 23:49:07 +02:00
Pierre Paridans f949217256 [FIX] web,mail,web_tour,test_main_flows,tests: no hardcoded user agent
Main Flow Tour Mobile shouldn't require a specific `user_agent` as it
targets a small screen and not a mobile platform (iOS, Android...).

Actually, during refactoring of the tours (odoo/odoo@3a798039d6),
a confusion was made between the legacy `isMobile`, which represents a
small screen (cf. `env.isSmall`) and `isMobileOS`, which targets
"mobile" platforms (ie. iOS, Android...) independently of the screen size.

This commit applies the proper condition (isSmall) for the tours
management and removes the useless `user_agent` property. It also
removes the logic added to support custom user_agent in the Chrome
automation for testing.

closes odoo/odoo#116186

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-24 09:05:13 +01:00
Pierre Paridans 1ea7a3d6ad [FIX] web: don't update related daterange field when not in the DOM
This commit avoids to update the related daterange field (aka. end date
when changing start date, and vice-versa) when this field is not present
in the DOM (could be 'invisible' field or hidden column in list).

Steps to reproduce:
- Open Field Service
- Switch to list view
- hide the End date column
- select record(s) to enter multi edit mode
- click on the Start date of the selected record to open the date range
  picker
- select a new range
- click Apply
==> Error saying that cannot read setStartDate from undefined

task-3200845

closes odoo/odoo#115766

X-original-commit: 9e00bd26ac43bfdaacd74de324ead84e4154a912
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-20 09:03:46 +01:00
Pierre Paridans d4a9881e03 [FIX] web: translation tests fixed for Chrome 110+
This commit adapts the translation tests for non-English Numbering
system to rely on the month's numbers instead of names, as the goal of
those tests is to verify that the correct Numbering System has been
applied instead of this specific datetime format.

This is due to Chrome 110+ modifying/fixing month's name translation in
the Intl API, and more specifically the bengalese's test breaking since
this update.

Note: Firefox and Webkit browsers applied similar fixes in their recent
versions.

closes odoo/odoo#113121

X-original-commit: 42b679b9b71bf2b58e0f785c21ef002de6f3ca32
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-02-20 13:44:38 +01:00
Pierre Paridans ba7b9975c5 [FIX] web: regex syntax unsupported by Webkit
Positive Lookbehind regex syntax is currently not supported yet by
Webkit, and thus Safari (both on macOS and iOS) resulting into a crash
as the syntax is not recognized.

This issue affects both frontend and backend.

This commit fixes it by reimplementing the feature without using this
syntax.

closes odoo/odoo#112985

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-02-18 04:36:32 +01:00
Pierre Paridans 6f700b2973 [FIX] web,purchase: no content helper position in modal on small screen
This commit fixes an issue where the "No records found" helper text is
wrongly positioned below the sample data's records (i.e. not visible)
instead of over them.

This is basically a revert of 9407383a56
due to the changes in the DOM and styling made in the meantime.

But actually we can go further and ensure we always have the ListView's
table present in the DOM. This change allows to simplify the positioning
of the helper and the implementation of the Purchase's dashboard.

Steps to reproduce:
- create a new database **without demo data**
- install "Planning" and "Sales" apps
- with a mobile-like screen size, open Planning
- switch to Gantt view
- in a cell, click/tap on the magnifier button (which is on hover...)
- the many2x view doesn't contain data
=> action helper "No records found" isn"t visible (scroll to bottom to
find it)

closes odoo/odoo#112878

X-original-commit: 766498a36b322ffe9c647616f56f3ba04cc51d96
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-02-16 17:57:00 +01:00
Pierre Paridans 4ce90e196d [FIX] web: oe_title + oe_avatar alignment in Form view
This commit fixes a broken selector when an avatar image (`.oe_avatar`)
is used next to a title element (`.oe_title`) to put them side-by-side.

Also it goes beyond that by ensuring the `.oe_title` element doesn't
take the whole width (cf. max 75%) to make a visual distinction between
it and the other form's fields, both in editable and non-editable form.

In small screen, as space is limited, the whole width is kept to make it
more userfriendly, only allowing a thin gap between the `.oe_title` and
the `.oe_avatar`.

Steps to reproduce:
- Open Apps
- Choose an App and, in the dropdown, click on Module Info
=> there is a huge gap at the top of the title

closes odoo/odoo#112205

X-original-commit: 45ebcbf320eaeedf0a4c6c068ea727cf18bedd4b
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-02-08 15:39:03 +01:00
Pierre Paridans 93790839b6 [FIX] web,website,point_of_sale: settings' header alignment
This commit is a follow-up of odoo/odoo@bb819f6a5c.

Even if the fix above worked around having the settinggs header's
content out of screen on smaller screen, the solution was ugly and was
meant to be improved later on.

This commit reworks the HeaderSetting's template and simplifies it to
properly fix this issue.

closes odoo/odoo#110530

X-original-commit: 0ab079664e380e5e77440e290ec604e3830108bb
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-20 21:56:45 +01:00
Pierre Paridans 85c6f0b9aa [IMP] web: theme-color matches community theme
This commit sets the theme-color to match the Community brand color
instead of the Enterprise one.

task-3063485

closes odoo/odoo#109181

Related: odoo/enterprise#35322
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-11 22:42:56 +01:00
Pierre Paridans 3664e1c0c6 [IMP] web: remove unused Android icon
This commit removes link to an Android specific icon.

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
Pierre Paridans ec4bb75dec [IMP] web: cleanup Apple's web-app related meta tags
Deprecated tags in favor of WebManifest.

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
Pierre Paridans dcae6d7afc [IMP] web: remove deprecated msapplication-* meta tags
Windows 8 tiles and superseeded by WebManifest support in Windows
10/Edge 79+ (Chromium based).

Also this icon has been overriden by the favicon since
odoo/odoo@fa2cc58ef3.

task-3063485

Part-of: odoo/odoo#109181
2023-01-11 22:42:56 +01:00
Pierre Paridans fea6aee7a1 [FIX] web: MobileCompanyMenu's checkbox rendering
This commit replaces the .h2 with the .fs-2 class on the
MobileCompanyMenu checkboxes' icons to keep the same visual size but
without the other styling changes made for the header-like tags/classes.
This avoids an override of the .fa font-family which breaks the Font
Awesome's icon font.

Note: this is a "symptomatic fix" ; the proper fix should be to look for
the override's cause (cf. o-bg-color mixin).

closes odoo/odoo#108051

X-original-commit: 2aa76227296767701b1ea4b2e78e0701a061cf6f
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-12-15 13:41:02 +01:00
Pierre Paridans 015c2f345d [FIX] web: BugerMenu's user name color
This commit sets the username's foreground color to match the one from
the body to avoid having a white text on a white background (cf. bg-view
for the background).

Note: the dark mode isn't affected
X-original-commit: 35072cab808ca0598cd16b7294d07abb42758c78
Part-of: odoo/odoo#108051
2022-12-15 13:41:02 +01:00
Pierre Paridans bc325631b3 [FIX] web: lint tooling - exit script if cd fails
Ref:
- https://www.shellcheck.net/wiki/SC2164

closes odoo/odoo#107937

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-12-14 17:17:57 +01:00
Pierre Paridans 591c091c7a [FIX] web: lint tooling scripts - Double quote to prevent globbing
Double quote to prevent globbing and word splitting.

Ref.
- https://www.shellcheck.net/wiki/SC2086

Part-of: odoo/odoo#107937
2022-12-14 17:17:57 +01:00
Pierre ParidansandJoseph Caburnay 31125eabb9 [FIX] web: mispositioned caret of the list group header
**Issue:**

On the first group level, the caret that prefixes the label is
separated from the label by 5px.

But, on the 2nd group level (and deeper levels), the caret and
the label have no space in between. This is not visually pleasing.

**Solution:**

The span containing the caret has a fixed-width which conflicts with
the specified padding to show hierarchy of the groups.

We avoid this conflict by specifying margin to indent nested groups
instead of padding. This indentation (start) margin is calculated in
css to be able to reuse the values from `$spacers`. It is based on the
dynamically assigned css var "--o-list-group-level" that is calculated
based on the group level.

We also specified the end margin using a utility class (.me-1). This
is the space that separates the caret to the group's label.

closes odoo/odoo#107333

X-original-commit: 1d8f6359bbf55983a9582282d12a187c67cdf509
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Co-authored-by: Joseph Caburnay <jcb@odoo.com>
2022-12-06 17:12:24 +01:00
Pierre Paridans ef172fee4c [FIX] web: kanban muted quick create column
In grouped kanban, when having groups but no record to display, the
group creation button (ie. "+ Stage" in Project) and its related column
are muted instead of being the regular colors (like for the groups'
titles).

This commit fixes it by applying a fix similar to the group's title one
(cf. odoo/odoo@cbefc9cd51)
for the quick create column element.

Steps to reproduce:
- Open Project
- Create a new project and open it in kanban view
- create a few stages
=> the quick create column is "muted"
- dismiss the quick create column (ESC or click outside it)
=> the "+ Stage" button is muted

closes odoo/odoo#106022

X-original-commit: e95e2a23bc168815a27a9c64e4ff9394de468ada
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-11-18 14:00:25 +01:00
Pierre Paridans bb26532e02 [IMP] test_main_flows: enable mobile main flow in community
Since Odoo 16 is also responsive in community, we can activate
the mobile main flow tour.

closes odoo/odoo#105606

X-original-commit: 453882a17e27b89b87e2573732d17d96970d4a96
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-11 12:59:00 +01:00
Pierre Paridans 121ead1589 [FIX] web: text field's translation icon position
This commit restores the `display: inline-block` to the fields' textarea
to match the char field's input and allowing the textarea and the icon
to stand side-by-side. This rules went away in the
odoo/odoo@fb0bebc6cf commit, but should
have been restored in this case afterward.

Although, a tweak is required for the editable ListView as it triggers
a layout shift at the row's height level (ie. bigger when editing). This
is due to the textarea content's vertical alignment which, in its
default setting (ie. baseline) makes room for the descender portion of a
letter (eg. the part below the baseline, as "g", "j", "q", "p", "y"
letters) and, as result, makes the field vertically bigger.

Steps to reproduce:
- In Settings, add (at least) another language
- Open Project
- Open a project
- Edit a kanban stage
=> the description field's translation icon is below the textarea

closes odoo/odoo#105565

X-original-commit: 2168893749c2c361c3c79e8c3879d673e366c36b
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-10 22:21:53 +01:00
Pierre Paridans d70b67a7a8 [FIX] web: kanban group's long title
In a grouped KanbanView, long group's title makes the group (aka.
column) grows instead of keeping its original size and truncate the
title using an ellipsis.

This commit fixes it by forcing a maximum width in addition of the
Flexbox rules (`flex-basis`, `flex-grow`) to prevent this effect.

Steps to reproduce:
- Open CRM
- In the KanbanView, create a new Stage with a very long title
=> the column grows instead of keeping its original width

closes odoo/odoo#105554

X-original-commit: d9872ecce78d6d7ad02cdaa16782aa473e5a7655
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-10 21:16:22 +01:00
Pierre Paridans 7277197434 [REF] web: kanban group's width
In grouped KanbanView, group's width follows three usecases:
- on smaller screens, the group (aka. column) takes 90% of the viewport
  (to give a hint of the next/previous column)
- on desktop-like screens, the group's width is based on the regular record's
  width and padding
- on desktop-like screens, a smaller variant of the one above (cf.
  `o_kanban_small_column`)

As the definition of those usecases where a bit
all-over-the-place, this commit takes advantage of the CSS custom
properties and the cascade to conditionally define the
`--KanbanGroup-width` property and set only once the group's width (cf.
`flex-basis`).

Note: it fixes a small issue where the "quick create" column was always
set to the smaller variant, even with regular record size.

X-original-commit: d7aa7dc892c9aa7120291e6eedad7f03bf78baf2
Part-of: odoo/odoo#105554
2022-11-10 21:16:22 +01:00
Pierre Paridans ebd149857e [FIX] bus: SharedWorker is buggy on iOS 16.1
Since the iOS 16.1 update, the WKWebView used in the iOS mobile app
crashes when trying to instanciate a `SharedWorker`... even if this
feature was newly added in iOS 16.0.

Safari iOS doesn't seem to be impacted.

This commit works around this issue by disabling the usage of the
`SharedWorker` in the iOS mobile app, using instead the existing
fallback to a regular `Worker`.

Steps to reproduce:
- On a device running iOS 16.1
- Open Odoo in the iOS mobile app
=> Once connected the app freezes with a gray screen

opw-3045539

closes odoo/odoo#104459

X-original-commit: afac382bd711b1a506629742456d91526cc52c53
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-28 14:21:13 +02:00
Pierre Paridans d98f4d2cf3 [FIX] web: add support for switch type in Burger's UserMenu
This commit adds an implementation of the UserMenu item's type 'switch'
for the BurgerMenu (used in smaller screen).

Note: this commit also adds unit tests for the BurgerUserMenu ; the
asserts are largely inspired by the regular UserMenu tests.

closes odoo/odoo#103102

X-original-commit: 0653ec8672e5878e40c804ea569dfccbd6105edc
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-11 18:56:14 +02:00
Pierre Paridans d2d7a280a7 [MOV] web: matching folder structure in web/tests/mobile as web/tests
X-original-commit: 6d12386ce2a82a4851d021194fa9326ff0f4b334
Part-of: odoo/odoo#103102
2022-10-11 18:56:13 +02:00
Pierre Paridans d616ade15c [MOV] web: BurgerUserMenu file should match class name
X-original-commit: 2cb344aad9f74b54cf8a125ab7ce0e41c56e44fa
Part-of: odoo/odoo#103102
2022-10-11 18:56:13 +02:00
Pierre Paridans dd9877e080 [REF] web,*: each module handle its own dark mode variables
Instead of having a dedicated module for all-things dark mode related,
this commit moves the (S)CSS files into their respecting modules and
uses `web` and `web_enterprise` to provide the base infrastructure for
the dark mode (cf. dedicated assets bundle).

Note:
Don't forget that you have to handle 2 cases:
1: SCSS variables must be placed BEFORE bright ones
2: CSS variables must be placed AFTER

task-2710677

Part-of: odoo/odoo#102868
2022-10-11 13:15:56 +02:00
Pierre Paridans efc30998a4 [MOV] base,web: move onboarding variables in a dedicated file
Commit preparatory to the introduction of dark-mode.

task-2710677

Part-of: odoo/odoo#102868
2022-10-11 13:15:56 +02:00
Pierre Paridans 81defa2804 [FIX] web: ListView footer columns with optional field
This commit fixes the number of cells created in the ListView's footer
when the optional field's button is present.

Steps to reproduce:
- Open Accounting > Customer Invoices
- Switch to ListView
=> the footer (containing totals) has one less cell

closes odoo/odoo#102222

Forward-port-of: odoo/odoo#101954
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-08 13:30:04 +02:00
Pierre Paridans 1233ff1b18 [FIX] web: ListView group's pager position
This commit fixes the pager's position in a grouped ListView when the
optional field's button is present.

Steps to reproduce:
- Open Account > Intrastat Code list
- Unfold "Commodity" group
=> The group's pager is misplaced

Forward-port-of: odoo/odoo#101954
Part-of: odoo/odoo#102222
2022-10-08 13:30:03 +02:00
Pierre Paridans 692b4e93ec [FIX] web: properties field matching group's alignment
This commit fixes the properties field alignment to make it more similar
to the form's group layout (using grid and its gap).

Steps to reproduce:
- Open CRM
- On a lead's form view
- Add properties
=> labels from second column aren't aligned with fields above

closes odoo/odoo#102730

X-original-commit: 5a1c14fe5761e964a2370883bf209b474e498918
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-08 09:42:47 +02:00
Pierre Paridans f52486dcc4 [FIX] web: Dialog Form buttons' spacing
This commit applies the proper spacing between FormView's buttons in a
Dialog's footer.

Steps to reproduce:
- Open Notes
- Enable debug mode
- In Debug menu, open "Edit View: List"
=> dialog's buttons have no spacing

closes odoo/odoo#101974

X-original-commit: f67a8fff6c86a67ce2f6a162f1de992fe25eefbd
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-04 12:30:14 +02:00
Pierre Paridans 16ddf96e0f [IMP] web: cleanup notebook's styling in Form & Kanban examples
This commit removes unecessary overrides of the Notebook component
styling in the Form and Kanban columns examples.

Additionally, it also moves the most generic styles (like responsive)
into the Notebook component itself.

closes odoo/odoo#101868

X-original-commit: c1b9905b2e17ca0fda3aeb152c2927031d1662c4
Related: odoo/enterprise#32158
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-03 12:00:41 +02:00
Pierre Paridans a89c3b3893 [REV] web_editor: toolbar should be scrollable on smaller screens
This reverts commit 3a7349d02b6b667c890af2f197a3640d875b804e.

This toolbar being more accessible in mobile (scrolling to access all
the buttons), sadly it broke the toolbar's dropdown...

closes odoo/odoo#101766

X-original-commit: 253152d93f381ba0e55787818294aaee24383e0a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-30 16:42:54 +02:00
Pierre Paridans 7fbc49d486 [FIX] web: ListView colspan for empty lines
Before this commit, empty lines on non-editable form's list are 1 column
too long and breaks the list's layout (ie. squish other columns and
empty space on non-empty columns).

This commit fixes it by properly calculating the number of columns and
their application on the empty lines' colspan. It also fixes an assert
in the list view's tests which mistakenly required that list's records
should be editable in a non-editable form.

Steps to reproduce:
- Open a Contact
- In the notebook, choose the Accounting tab
=> The Bank Accounts list has broken layout

closes odoo/odoo#101550

X-original-commit: 543134e215200bafd89edc1303032a210a4206cf
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-09-29 12:17:12 +02:00
Pierre Paridans d4c9a58d1d [FIX] web_editor: toolbar should be scrollable on smaller screens
Before this commit, when all editor toolbar's items doesn't fit into the
screen width, they can't be reached.

This commit fixes it by allowing the toolbar to be scrolled horizontally
to let the user reach all the items.

Steps to reproduce:
- Open a Contact
- In the notebook, open the Internal Note tab
- Focus the description field
=> the toolbar's last items are inaccessible

closes odoo/odoo#101537

X-original-commit: 3a7349d02b6b667c890af2f197a3640d875b804e
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-09-29 11:13:15 +02:00
Pierre Paridans 6c4fb8805e [FIX] web: tags field placeholder when tag selected
This commit properly removes the Many2ManyTagsField and
Many2ManyTagsAvatarField's placeholder when at least one tag has been
selected.

Steps to reproduce:
- In Contacts, open a partner's form view
- Edit and set at least one "tag"
- The placeholder is present next to the selected tags

Note: the placeholder was already present in previous versions.
Reported by FP.

closes odoo/odoo#101042

X-original-commit: 5976e19a31b9b0edaefc1079541514810d12b240
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-09-23 22:04:23 +02:00
Pierre Paridans 9da6640c9a [FIX] web: FormView x2many in notebook shouldn't have padding
This commit adapts the x2many as first notebook tab's child selector to
the DOM of its OWL implementation, restoring the correct padding in this
case.

Steps to reproduce:
- Open Product form view
- Select the Variants notebook's tab
- Tab shouldn't have padding when the first child is a one2many

closes odoo/odoo#100912

X-original-commit: 74875dcc0b84236c0911b117666fc6deb41ed432
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-09-23 12:28:44 +02:00
Pierre Paridans 772a274b04 [FIX] web: grouped kanban column width on smaller screens
This commit restores the almost-full (aka. 90%) width for the grouped
kanban's column (which use .o_kanban_small_column) on smaller screens.
As a reminder, to goal of this specific size is to give as much space as
possible for the column's cards *but* also showing a hint to the
previous/next columns.

Steps to reproduce:
- Open CRM grouped kanban on a mobile-like screen size
- Columns' width is not properly set (too small)

closes odoo/odoo#100911

X-original-commit: 6b60d332a0207342fec0a3a32af8ed30a8a73d91
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-09-23 07:21:35 +02:00
Pierre Paridans 586ed792fb [REF] web,*: group Bootstrap config/customization files
- Take them out of `legacy` codebase.
- Group them in a generic `static/src/scss` folder, as those files are
  used in webclient but also in public livechat, portal...

X-original-commit: ca2e4fea92b5a26078a412072275a969508358c7
Part-of: odoo/odoo#100759
2022-09-23 01:39:34 +02:00
Pierre Paridans 8f45f517e8 [FIX] web: grouped kanban header shouldn't overlay dropdowns
Before this commit, in grouped kanban, when the "switch view" dropdown
(on smaller screens) is open, it is hidden behind the kanban group's
header.

This commit fixes it by setting the kanban group header's `z-index` to
only overlay its siblings (cf. this groups' records) but not the
ControlPanel's dropdowns. The static value "1" allows to elevate locally
the header above the records instead of using the Bootstrap's
`$zindex-sticky` variable which is aimed at raising an element (like a
navbar) above any other content.

X-original-commit: 1799e02cd56a26e48665043ca23ac1c735996c50
Part-of: odoo/odoo#100759
2022-09-23 01:39:34 +02:00
Pierre Paridans 0573d9d6c2 [FIX] web: ActionMenu position on mobile
This commit fixes the ActionMenu's position on smaller screens by
pushing it to the bottom-right part of the ControlPanel (instead of the
bottom-left one on regular sizes).

It also adjusts its vertical alignment.

X-original-commit: 42966bc89f873032fa6bad41c2cfa7a001537f9b
Part-of: odoo/odoo#100759
2022-09-23 01:39:34 +02:00
Pierre Paridans 491385842d [FIX] web: FormView's label color
Before this commit, the contrast between the form fields' label
(specifically the one where the field is empty) was hard to read (light
gray on a white background).

This commit fixes it by differentiating the color used as main
background and the "secondary" one (which is used for labels, among
other things) and providing a better contrast.

X-original-commit: 8cd30bb4478d50d74ba5074d1b4a54b09daef369
Part-of: odoo/odoo#100759
2022-09-23 01:39:33 +02:00
Pierre Paridans f96c8821a0 [IMP] web: normalize FormView's layout
This commit normalizes the FormView's layout allowing to simplify it
and reduce disparities between community and enterprise.

It also allows to remove the `form_view_extra.scss` replacement.

X-original-commit: 9c2e851af3bfae8e6e6c11f061a8a5b952c54db9
Part-of: odoo/odoo#100759
2022-09-23 01:39:33 +02:00
Pierre Paridans d82ac0c351 [IMP] web: remove unused ui_extra.scss
Note: this file was only present to be overridden in enterprise.
X-original-commit: 7d73cd5ed4f59fdca1d94820757942a25ddc58fa
Part-of: odoo/odoo#100759
2022-09-23 01:39:33 +02:00
Pierre Paridans f437086285 [IMP] web: normalize ListView's layout
This commit normalizes the ListView's layout allowing to simplify it
and reduce disparities between community and enterprise.

It also allows to remove the `list_view_extra.scss` replacement.

X-original-commit: 40228334436fd03ee251bd89c794aa439bed5839
Part-of: odoo/odoo#100759
2022-09-23 01:39:33 +02:00
Pierre Paridans b222fc8059 [IMP] web,mail: normalize WebClient's layout
This commit normalizes the WebClient's layout allowing to simplify it
and reduce disparities between community and enterprise.

It also allows to remove the `webclient_extra.scss` replacement.

X-original-commit: d3d35397aeec18b54e342ef2d19749229d95c694
Part-of: odoo/odoo#100759
2022-09-23 01:39:32 +02:00
Pierre Paridans 062e7b1c21 [IMP] web,*: make ControlPanel, SearchView, SearchPanel responsive
This commit transfers responsive related customizations for
ControlPanel, SearchView and SearchPanel to community which allows them
to render properly on smaller devices.

Note: a page reload (aka. F5) is required to properly adapt the UI after
a resize to a mobile-like size.

X-original-commit: 26a755610da36b01ba07ca224cc5937a672eb6a8
Part-of: odoo/odoo#100759
2022-09-23 01:39:32 +02:00
Pierre Paridans 66517b0e0b [MOV] web: transfer touch customization to community
This commit moves and integrates the touch device detection and
customization (through the o_touch_device class).

X-original-commit: 60acbb73e16ca551dfbadb8b29b73637e39bf9a9
Part-of: odoo/odoo#100759
2022-09-23 01:39:32 +02:00
Pierre Paridans 2571f6d4bc [MOV] web: enable responsive mode
This commit enables the WebClient's "responsive" mode by setting up the
"viewport" meta tag to allow it to scale to the device's width (instead
of being desktop-like only).

X-original-commit: 4d6169000aad92bed68879d90c360cb5cd62b8eb
Part-of: odoo/odoo#100759
2022-09-23 01:39:32 +02:00
Pierre Paridans 0c4819f8c3 [FIX] web: list selection banner takes the whole width on mobile
On mobile, in list view's selection mode, both the left & right bottom
parts of the ControlPanel are displayed but only the left one
(containing the selection banner and actions menu) should be displayed
(and take the full width).

Also, small alignment adjustments.

closes odoo/odoo#99483

Related: odoo/enterprise#31269
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-09-13 20:30:01 +02:00
Pierre Paridans 2736d832bd [FIX] web: Layout's display props could be dynamic
Before this commit, if the Layout's `display` props is a dynamic value
coming from the parent Component (ie. a getter on the component that
controls which parts of the ControlPanel should be displayed), this
value isn't applied after the first initialization.

This commit fixes it by extracting the `display` logic applied in the
constructor to a getter (moving from initialization only to once
called).

Part-of: odoo/odoo#99483
2022-09-13 20:30:01 +02:00
Pierre Paridans 5e7d17a126 [FIX] web: tests/views/helpers.js should be in test_assets bundle
Before this commit, the `/web/static/tests/views/helpers.js` was only
imported in the "desktop" qunit test suite but unavalaible for the
mobile one.

This commit adds it in the `web.test_assets` bundle to be available in
all tests suites.

closes odoo/odoo#99498

X-original-commit: 2875f43da28d01f837c1ee53f8cadd21e169b612
Related: odoo/enterprise#31029
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-09-02 23:16:41 +02:00
Pierre Paridans 8546efe940 [FIX] web: searchbar vertical alignment on mobile
On non-legacy views (like Pivot) the vertical alignement of the
searchbar wasn't properly centered. Also there wasn't enough spacing
between the actual search input and the bottom line.

This commit fixes it by certically center it and normalize the bottom
padding accross legacy/non-legacy and mobile/desktop.

closes odoo/odoo#99476

X-original-commit: cdee502c05cfacdefd2e656001c6f9ae7d3146af
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-09-02 17:45:58 +02:00
Pierre Paridans 062ef13483 [FIX] web: restore sizing for XXL Form View
XXL Form View doesn't apply the right max-width (1320px instead of
1140px).

This is due to the precedence of the selector for `.o_xxl_form_view`
since https://github.com/odoo/odoo/pull/96627. Also this code block
applies to both legacy an new FormView instead of only the new one.

This commit fixes it by properly targetting the `.o_form_view` with the
`.o_xxl_form_view` and restores the previous behavior.

closes odoo/odoo#98686

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-27 03:33:30 +02:00
Pierre Paridans 2a2f605a32 [FIX] web: list view optional columns button top border
Steps to reproduce:
- Open Online Appointment in list view
=> a "double-border" is visible above the optional columns button

closes odoo/odoo#97592

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-08 22:15:48 +02:00
Pierre Paridans 72f0897313 [FIX] web: list view optional columns icon position
Before this commit, the column customization icon sometimes covers the
last column header in list views (or the 'ordering carret' icon).

Steps to reproduce:
- open Survey in list view
=> Avg Score column header overlaps with the icon

This commit adapts the headers last column's padding and the
customization icon's width to match each other and avoid overlapping.

It also adapts the vertical positionning of the icon.

task-2816987

closes odoo/odoo#97562

Related: odoo/enterprise#30165
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-08 21:03:06 +02:00
Pierre Paridans deaae51fb5 [FIX] web: reorder assets as webclient/* defines base elements for views
`webclient/*` defines the main infrastructure for views and as such also
global components/utilities (like Odoo Icons variables/utility classes).

But, as the `views/*` are included *before* `webclient/*`, they can't
use SCSS variables defined in `webclient/*`.

This commit fixes it by interverting their order, which has a
significant effect on the SCSS output, but not the JavaScript (as the
modules system is responsible of the imports order, not the bundler).

Part-of: odoo/odoo#97562
2022-08-08 21:03:06 +02:00
Pierre Paridans 72357b4751 [FIX] web: don't hide datepicker on scroll for iOS
This commit fixes a glitch on iOS (both iPhone & iPad landscape) where,
when the user attempts to open the datepicker of a custom filter's
field, it pops up and immediately close.

This is due to the desktop behavior which hides datepickers on scroll to
avoid hidding fields behind it.

In our case, a scroll is triggered once the focus is set in the date's
input and the virtual keyboard opens up... which then hides the
datepicker!

Sadly, this behavior's purpose being still useful in desktop, we don't
have much other solution than "just" disabling it on affected platforms
(ie. iOS) as it affects both small screens (ie. iPhones) and
dekstop-like ones (ie. iPad).

Hopefully, a better solution will be found at some point in a future
version, avoiding this kind of "trick"...

Note: replacing the "scroll" event with the "wheel" event seems to fix
the issue at first glance... but actually has side-effects for devices
using both touchscreens and a mouse (ie. 2-in-1 laptops).

Steps to reproduce:
- Open any collection view (list, kanban...)
- Open "Filter" dropdown and add a custom filter
- Choose a date/datetime field (ie. created_on)
- Tap the input
=> datepicker opens up and close immediately

opw-2671618
opw-2819299

closes odoo/odoo#97521

X-original-commit: 1895411d29b2b803c36bded11ba79c92e5c8756d
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-08 19:22:47 +02:00
Pierre Paridans 7d9faadc5c [FIX] web,base: switch to newly installed lang button color
Steps to reproduce:
- Open Settings
- Add Languages
- Select a language
- Click Add
=> Text in the "Switch to..." button is miss-aligned and color is
unreadable.

This commit fixes the alignment by removing an exception to the dialog
footer's buttons alignment selector which is no longer needed and to
avoid confusion between inner-fields and buttons container.

Also, it fixes the color by rendering the language name as a readonly
text instead of a link inside a button (sic).

closes odoo/odoo#97007

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-07-29 15:53:24 +02:00
Pierre Paridans 21f22f3b7c [FIX] web: daterangepicker style in mobile
The DateRangePicker on mobile has a few caveats (sic) like its
positionning which prevents the user from accessing the buttons (cf. out
of the viewport).

Steps to reproduce (on small device like iPhone 5/Moto G4):
- Open Time Off
- Click on New Time Off
- Click on From/To field
=> buttons are inaccessible

This commit fixes it restyling the daterangepicker on smaller screens to
display it as Bottom Sheet-like element (cf. popping from the bottom of
the screen and growing upto 90% of the viewport).

opw-2803227

closes odoo/odoo#97024

X-original-commit: dd2bd3c22c22c49a60ca0541f84a64c3a613971c
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-07-28 21:01:56 +02:00
Pierre Paridans 171d9cffc7 [FIX] web: weird modal effect on backdrop click
Since BS5 migration, clicking on the backdrop of a "static" modal
triggers a weird scaling-up/down effect on the modal.

Steps to reproduce:
- Open Livechat Channels
- Open a channel
- Click on operator which opens a modal
- click on backdrop
=> scale-up/down effect

This commit fixes it by disabling the scaling transform effect on
modals.

closes odoo/odoo#96958

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-07-28 15:03:51 +02:00
Pierre Paridans 482b80fd14 [FIX] web: Kanban small column & quick create column width
Since odoo/odoo@2dd37982e6 , Kanban
column's width is flex based. But sadly two types of columns were not
adapted properly:
- Kanban small column didn't reduce the column width
- Quick create kanban column shrinked too much

This commit fixes both these issues by properly setting the flex-basis
size for one and disabling shrinking for the other.

closes odoo/odoo#96650

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-27 04:53:28 +02:00
Pierre Paridans ccc7706878 [REF] web: remove o-get-most-contrast function
As the `color-contrast` function provided by BS5 basically fulfill the
same need as the custom `o-get-most-contrast` function and the later one
isn't used, we can safely remove the custom one.

closes odoo/odoo#96626

Note: last (and only) usage was in mrp_workorder's tablet view.
Related: odoo/enterprise#29802
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-07-27 04:53:02 +02:00
Pierre Paridans a6857f276a [REM] web,debian: remove unused jQuery.touchSwipe lib
Since the revamp of the Kanban View in mobile and the migration of the
Settings view to the OWL views, the jQuery.touchSwipe library is not
used anymore.

closes odoo/odoo#96608

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-27 03:35:09 +02:00
Pierre Paridans f5ef77839f [IMP] web: Tooltip UX on touch-enabled devices
Port of legacy's BasicRenderer for WOWL views.

In a nutshell: Tooltips are problematic in touch devices as they are
meant to appear on hover... which doesn't happen with touch events.

This commit implements a "tap-to-show" behavior which let the user see
the Tooltip by pressing the element, and letting it disappear when the
pressure ends.

Part-of: odoo/odoo#95924
2022-07-19 11:50:51 +02:00
Pierre Paridans 69f047c26d [IMP] web,tests,test_main_flows: Chrome headless touch option
Before this commit Chrome's "touch mode" was enabled in both desktop and
mobile-like tests suite (when run headless).

To better match real usecases, this commit adds an option to
enable "touch mode" only in mobile tests suites; keeping it disabled in
desktop ones.

Part-of: odoo/odoo#95924
2022-07-19 11:50:51 +02:00
Pierre Paridans 22591206d4 [REF] web: touch detection
- use 'browser' as abstraction, allowing to mock touch detection in
  QUnit tests
- remove deprecated IE 10 touch detection (using non-standard
  MSGestureChange event)
- some linting

Note: touch detection using "ontouchstart" is a quite common practice.
It's useful to note that, when in touch mode, browser's have different
values for it ("null" in Chrome, "Function" in Firefox...) but all
agrees to have "window.ontouchstart" being "undefined" when in non-touch
mode.

Part-of: odoo/odoo#95924
2022-07-19 11:50:51 +02:00
Pierre Paridans 2dd37982e6 [IMP] web,crm: revamp grouped kanban mobile implementation
This commit revamps the grouped-kanban implementation for smaller
screens (aka. mobile) by making it more "responsive" and avoiding
mobile-specific variation. It makes the implementation simpler and
closer to what the user expects from the desktop version.

In a nutshell:
- columns are displayed individually ; an horizontal scroll allows to
  switch to the other ones, "snapping" to the column (aka. carroussel-like).
- each column takes 90% of the viewport's width to give a hint of its
  siblings.
- each column scrolls (vertically) individually to avoid being lost when
  switching from one column to another.
- folded columns are "virtually unfolded": they takes the same space as
  the other ones, but content is loaded on-demand.
- some configuration modals are fullscreen for ease of use.

Part of the SCSS revamp task-2704984

task-2883057

Part-of: odoo/odoo#94134
2022-06-22 11:05:20 +02:00
Pierre Paridans fbf7232edc [REF] web: standardize webclient layout
This commit refactors the WebClient's layout definition to avoid
differences and redundancy between Community & Enterprise editions.

This would ease the maintenance by streamlining both implementation,
keeping them closer. It also allows to have more similar scrolling
handling by default:
- on desktop: `o_content` is the action scroll container (no change)
- on mobile: `o_action` is the action scroll container (down from `html`
  node, to keep the navbar)

Part of the SCSS revamp task-2704984

task-2883057

Part-of: odoo/odoo#94134
2022-06-22 11:05:20 +02:00
Pierre Paridans 21a1d13306 [FIX] odoo: rlimit cannot be set at runtime on macOS Monterey (12.0+)
When attempting to run the Odoo server on macOS Monterey (currently
12.4), it crashes with the following traceback:

```
Traceback (most recent call last):
  File "/Users/app/Code/odoo/odoo-bin", line 8, in <module>
    odoo.cli.main()
  File "/Users/app/Code/odoo/odoo/cli/command.py", line 61, in main
    o.run(args)
  File "/Users/app/Code/odoo/odoo/cli/server.py", line 179, in run
    main(args)
  File "/Users/app/Code/odoo/odoo/cli/server.py", line 173, in main
    rc = odoo.service.server.start(preload=preload, stop=stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 1342, in start
    rc = server.run(preload, stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 553, in run
    self.start(stop=stop)
  File "/Users/app/Code/odoo/odoo/service/server.py", line 491, in start
    set_limit_memory_hard()
  File "/Users/app/Code/odoo/odoo/service/server.py", line 83, in set_limit_memory_hard
    resource.setrlimit(rlimit, (config['limit_memory_hard'], hard))
ValueError: current limit exceeds maximum limit
```

Actually, this issue is not specific to Odoo but affects Python on macOS
as a whole (see [1] and [2]).

As our memory management is based on Linux - which is our primary
deployment target - and non-POSIX systems were already excluded, this
commit escapes the rlimit modification on non-Linux systems to prevent
this kind of issue.

References:
[1] https://bugs.python.org/issue34602
[2] https://github.com/python/cpython/pull/14546

Related issue:
https://github.com/odoo/odoo/issues/79112

closes odoo/odoo#93381

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-06-16 17:26:55 +02:00
Pierre Paridans b94e612378 [FIX] web: scrolling element to bottom border test breaks in Chrome 94+
Since Chrome 94, some element's sizing computation returns a slightly
different value (in the order of a fraction of a pixel). Sadly, due to
rounding, this difference has an impact on exact sizing assertion.

In this case, assertion regarding the scrolling of an element inside its
scrollable container when it should be aligned to the bottom of the
container while being fully visible breaks due to those rounding change
(cf. the element is +/- 1px too low).

This commit fixes it by adjusting the `scrollTo()` implementation to
round the height of the element that should be visible in its scrollable
element to the upper pixel. This allows the element to remain fully
visible, with eventually a 1px margin in some cases (taken as an
reasonnable margin of error).

closes odoo/odoo#93235

Note: similar issue was also addressed in commit odoo/enterprise@6e973df114
X-original-commit: fdd03848e806b42ee0ee778bfd09d2f583b34f16
Related: odoo/enterprise#28215
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-06-09 18:57:46 +02:00
Pierre Paridans 08030d3409 [FIX] web: allow this test to pass on both newer & older Chrome
This commit should be reverted once Chrome has been upgraded to v97+ on
Runbot.

closes odoo/odoo#92921

X-original-commit: abac4e9eb4be8e31f776d745ad1fd19a310c608f
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-06-03 21:33:00 +02:00
Pierre Paridans 24f89c6dff [FIX] mail: scroll to bottom assertion in Chrome 94+
Since (at least) Chrome 94+, some element's sizing computation returns a
slightly different value (in the order of a fraction of a pixel). Sadly,
due to rounding, this difference has an impact on exact sizing
assertion.

As the difference is *really* small, introducing a margin of error (i.e.
<= 1px) looks reasonnable ; as implemented in this commit. More
specifically as Element.scrollHeight can have either an int or a decimal
value (cf. fractional-scaling), this commit allows to property handle
both usecases.

Reference:
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolled

closes odoo/odoo#92328

X-original-commit: 93348ae0d0b076fe2dfa094a2d7b3ef74442d390
Related: odoo/enterprise#27790
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-05-26 10:48:41 +02:00
Pierre Paridans 333a4e8733 [FIX] purchase_product_matrix: test breaking in newer Chrome (rounding)
Since (at least) Chrome 94+, some element's sizing computation returns a
slightly different value (in the order of a fraction of a pixel). Sadly,
due to rounding, this difference has an impact on exact sizing
assertion.

Specifically in these drag-and-drop tests, it prevents the sorting from
being triggered as the "mouse" doesn't pass beyond the center of the
destination element (aka. next row).

By setting the position to `bottom`, this commit mitigates this issue by
making sure to pass that boundary, just like a real-user would do.

closes odoo/odoo#92292

X-original-commit: ed798b216063caa299800a56c617277aabdfb8fd
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-05-25 18:01:03 +02:00
Pierre Paridans f7f07ef6e5 [FIX] web: test breaking in newer Chrome due to rounding issue
Since (at least) Chrome 94+, some element's sizing computation returns a
slightly different value (in the order of a fraction of a pixel). Sadly,
due to rounding, this difference has an impact on exact sizing assertion
(specifically in the list view column sizing tests).

As the difference is *really* small, introducing a margin of error (i.e.
<= 1px) looks reasonnable ; as implemented in this commit.

closes odoo/odoo#92203

Forward-port-of: odoo/odoo#92066
X-original-commit: 5f0353814fc314b75a34a38e700bd7f0797dd18d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-05-24 18:10:31 +02:00
Pierre Paridans 90e65f9762 [FIX] web: <details> visiblity check regression in Chromium 97+
Since Chromium 97, folded `<details>` content has non-zero computed
width and height which returns false-positive QUnit
`assert.isNotVisible()` calls.

In a nutshell, this was introduced in https://bugs.chromium.org/p/chromium/issues/detail?id=1185950
when Chromium implemented the ability for "Find in page" to search in folded
`<details>`. To do so, the `content-visibility` rule was used instead of
`display: none` which, even if functionally similar, has an impact on the
values returned by `getBoundingClientRect()` (i.e. used in
`assert.isNotVisible()`.

A regression report was filled in https://bugs.chromium.org/p/chromium/issues/detail?id=1276028
to highlight this change of behavior. What emerged from this report's
discussion is that Chromium has no intent to revert this change and
instead put the emphasis on avoiding to use `getBoundingClientRect()`
and similar methods for visibility check (even pushing a proposal for a
`Element.isVisible()` API; cf. https://github.com/w3c/csswg-drafts/issues/6850).

This commit works around this issue by forcing the content to `display:
none`, like in the previous Chromium versions.

closes odoo/odoo#91833

X-original-commit: b718e7eb5ceb827f59ac395577408b7bc54aa3f9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-05-19 19:04:59 +02:00
Pierre Paridans 8ed9d667fe [FIX] web: Dialog footer buttons' spacing
Before this commit, some dialog's footer buttons were glued to each
other which impacted their readability and usability.

This commit fixes it by properly applying the existing `gap` CSS rule
which defined the spacing between the buttons, and this independently of
the structure of the footer.

Indeed, due to historical reasons, the `.modal-footer` may contain
drastically different structures depending of the kind of modal.

A non-exhaustive list of encountered structures:
- `.modal-footer > button`
- `.modal-footer > div > footer > button`
- `.modal-footer > div > button`

Note: some existing rules already illustrate that in `modal.scss`.

task-2792884

closes odoo/odoo#91371

X-original-commit: d15bfc785d392a7dffadf9489d1d21f449d42ca4
Related: odoo/enterprise#27337
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-05-16 10:09:42 +02:00
Pierre Paridans cf75b7c2c2 [FIX] web: fix SCSS syntax for fixed-width odoo icons
Since commit odoo/odoo@9c41002b39, the
`.oi-fw` width value contained the `$oi-fw-ratio` variable name instead
of its value once compiled.

This commit fixes it by using SCSS interpolation, as expected.

To use SCSS variable in CSS `calc()`, the variable should use
interpolation to be properly evaluated at compile time.

Note: this apply only for LibSass, Ruby Sass and Dart Sass prior to
1.40.0.

Reference:
https://sass-lang.com/documentation/values/calculations

closes odoo/odoo#90125

X-original-commit: 2465c9206a78289b294599451959c6cbc2c938d3
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-04-29 13:13:38 +02:00
Pierre Paridans 7df7ecae9b [FIX] auth_totp,web: TOTP login from mobile apps
Since PR odoo/odoo#78857 , the TOTP authentication support is broken
when used inside either Android or iOS mobile apps.

Due to our inability to update the iOS app (following review from
Apple), this commit aims at restoring the bare minimum requirements to
make the current mobile apps (specially iOS but also Android)
authentication workflow works.

As extended explanation:
- Set-Cookie header is expected to be sent even when session_id hasn't
  changed (iOS specific).
- Successful credentials check on `/web/session/authenticate` expect a
  successful response with a result containing `uid` set to `null` to
  mark the need of an additional totp handshake (both platforms).

closes odoo/odoo#85463

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-02-26 13:41:23 +00:00
Pierre Paridans 48134b44d6 [FIX] web: don't show empty burger menu on mobile
When the current app doesn't provides menu-items (or the user doesn't
have the rights to access them), the mobile burger menu should fallback
to the user menu instead of an empty one (like on the App Switcher).

Steps to reproduce (on mobile):
- on a newly database, install only "notes" app
- connect as 'demo' user
- open the notes app
- open the burger menu
=> as there is no submenus, burger menu is empty.

task-2345001

closes odoo/odoo#84692

X-original-commit: odoo/enterprise@f8e85c39e6
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-02-16 11:30:43 +00:00
Pierre Paridans f6a9895d62 [IMP] web: move Burger Menu tests
Follow-up odoo/enterprise@3f78e5ade6

Standalone burger menu tests are moved to community, while we leave
other enterprise dependent tests in enterprise.

closes odoo/odoo#84406

Related: odoo/enterprise#24263
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-02-11 11:40:38 +00:00
Pierre Paridans b3dae8d669 [MOV] web: make ZXing barcode library available in community
This commit moves the ZXing library (used for QR/Barcode decoding) from
`web_enterprise` to `web` so it can be reused in other modules.

Change motivated by odoo/odoo#78204

closes odoo/odoo#80014

X-original-commit: 8c81e2f7c614c55247138278ffdf914e2866ec41
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-18 12:27:48 +00:00
Pierre Paridans bed30d93cc [FIX] web: remove unused class o_py
closes odoo/odoo#79751

Related: odoo/enterprise#22244
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-11-15 12:07:21 +00:00
Pierre Paridans 968be6be55 [IMP] web: feature detection impl. normalization
This commit normalizes the different feature/browser detection modules'
implementations to avoid difference between "newer" implementation and
legacy ones.

Its main goal is to ease future maintainability by having only one
single source of truth for feature detection and, also ensure fixes
applied to one version are applied everywhere.

closes odoo/odoo#79499

X-original-commit: 3b90e15983edcb79e6bd6e45685926cd4dfaae6b
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2021-11-09 10:11:09 +00:00
Pierre Paridans a3779735ee [IMP] web: match DateRangePicker with datepicker revamp
Following commit odoo/odoo@ce4e6bd4b1 ,
the DateTimePicker design was revamped but not the DateRangePicker.

This commit adapts the DateRangePicker's styling to match the
DateTimePicker's design.

closes odoo/odoo#79497

X-original-commit: c5c944f4240dba8f8b100d73ef1a9c8870c705a7
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2021-11-09 10:10:58 +00:00
Pierre Paridans 9b0d2add11 [FIX] web,pos,website_event: DateRangePicker (S)CSS loading order
By being lazy loaded, the DateRangePicker library's CSS files where
loaded after the Odoo specific customizations (bundled in the common
assets), resulting in some CSS rules being overridden by the one from
the library.

This commit fixes it by removing the lazy loading of the library's
(S)CSS to be able to handle their loading order. Also as our
customizations requires SCSS pre-processing, they can't be lazy-loaded.

Note: the library's JS assets are stil lazy loaded to minimize the
performance impact of this change.

X-original-commit: 4436411b6fd898d1fa32a9149b7dc12efe3ef9f8
Part-of: odoo/odoo#79497
2021-11-09 10:10:58 +00:00