Commit Graph
34 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
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
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
Jorge Pinna Puissant baebb6a5b0 [REF] web, *: Unique id for field nodes
Before this commit, the field node id (`field_id`) uses the field name
for the first occurrence on the arch, and add an underscore and a number
for the rest of the occurrences. This can create inconsistencies when
sombody assumes that the field_id is equal to the name, and don't take
into account the possibility of multiple occurrences.

Now, a unique id is created since the first occurrence, this remove all
ambiguity between the id and the name.

Part-of task-id 3179751

closes odoo/odoo#117799

Related: odoo/enterprise#39511
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-11 15:17:20 +02:00
Stefan-Calin Crainiciuc (stcc) e1639c2c1e [FIX] web: move test
The test added in dea66e1df317ca8782a68ece6c1e5917f6e8f3ec depends on a `mail`
helper, even though it is in the `web` module.

opw-3133731

closes odoo/odoo#115104

X-original-commit: e0ac9c41c6852cc147a9dea236421193161d7abe
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
2023-03-14 11:08:10 +01:00
Michael (mcm) 50aaf73eea [IMP] web: improve list control panel style
Before this commit, the bottom row of control panel in
list view could change height when reducing window size
and give an ugly layout.
This commit gives more flex to this row to keep a correct
layout when reducing window size.

task 3095775

closes odoo/odoo#110277

Related: odoo/enterprise#36895
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-02-10 09:11:54 +01:00
luvi b31daf2f7b [REF] web, *: improve view scale selector style and behavior
*: hr_holidays, hr_work_entry_contract

The commit introduces a new standard view component made to implement
in a consistant way the scale/select the appropriate period to display
in a view. This component is currently used by the Calendar view.

Tests have been added for this new component, as its behavior specs must
remain comprehensive. When there is no options or only one, the button is
removed from the view to keep space available, as its purpose is reduced.

This component gives the opportunity to keep the same style and behaviors
for views implementing it (eg: Calendar, Gantt) and should be used in
other views as well as soon as they are converted to Owl.

Other modules have been adapted to use the component name in xpath instead
of the span with the o_calendar_scale_buttons element. Tests have been
adapted as well.

A scss file has been modified to prevent the arrow to be misplaced on touch
devices due to a higher padding in the dropdown item element.

part of task #2867569

closes odoo/odoo#109090

Related: odoo/enterprise#35435
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-01-11 14:30:46 +01:00
Romeo Fragomeli 1171432b99 [FIX] web: allow to clear a many2one field on small screen (Mobile)
Since the rewriting of the views in OWL2, it is not possible to clear a
set many2one field.

In this commit, we restore the clear button.

Steps to reproduce:
* Go to Sales (on Mobile)
* Create a new Quotation
* Select a customer
* Try to remove the selected customer => BUG

closes odoo/odoo#109531

X-original-commit: 57cb2a34c8211352baa439ee784dc370cc6abb1b
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-01-10 16:50:55 +01:00
Hubert Van de Walle (huvw) c5e324cbe4 [FIX] web: attach_document widget now works when triggered from a dropdown
Steps to reproduce
==================

- Use a mobile viewport
- Go to Expenses
- Create a record
- Enter a description and a category
- Click on Action
- Click on Attach Receipt
-> Nothing happens

Cause of the issue
==================

When the button is clicked, the dropdown is closed. This means that the
AttachDocumentWidget and FileInput Components are both destroyed.

Solution
========

Instead of using the FileInput Component, use an input element outside
the DOM.

We also use `this.env.services.orm` instead of `useService("orm")`
because the last one does nothing when the widget is destroyed

opw-3065590

closes odoo/odoo#108897

X-original-commit: 84d50b40f150f251a81e128fa9645d7fcc729dab
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-02 13:55:50 +01:00
Jorge Pinna PuissantandMichael Mattiello (mcm) c7c2959449 [IMP] web, *: simplification and standardization of the settings arch
The aim of this commit is to simplify and standardize the settings archs.

To do this, a small DSL exclusively for the settings was created. This
new DSL introduces 3 tags: `app`, `block` and `setting`.

The `app` tag is used to declare the application on the settings view.
It creates an entry with its logo on the sidebar of the view. It also
acts as delimiter when searching.

```xml
    <app string="CRM" name="crm">
    ...
    </app>
```

- `string` : The "display" name of the application.
- `name` : The technical name of the application (the name of the module).
- `logo` *optional* : The relative path to the logo. If not set, the
        logo is created using the `name` parameter :
        `/{name}/static/description/icon.png`.

The `block` tag is used to declare a group of settings. This group can
have a title and a description/help.

```xml
    <block title="Title of group Bar">
    ...
    </block>
```

- `title` *optional* : The title of the block of settings (the old h2),
        you can perform research on its text.
- `help` *optional* : The description/help of the block of settings
        (the old h3), you can perform research on its text.

The `setting` tag is used to declare the setting itself. The first field
in the setting is used as the main field (optional). This field is
placed on the left panel (if it's a boolean field) or on the top of the
right panel (otherwise). The field is also used to create the setting
label if a `string` is not defined. The `setting` tag can also contain
more elements (e.g. html), all of these elements are rendered in the
right panel.

```xml
    <setting string="this is bar">
        <field name="bar"/>
        ...More elements
    </setting>
```

- `type` *optional* : By default, a setting is visually separated on two
        panels (left and right), and is used to edit a given field. By
        defining `type='header'`, a special kind of setting is rendered
        instead. This setting is used to modify the scope of the other
        settings. For example, on the website application, this setting
        is used to indicate to which website the other settings apply.
        The header setting is visually represented as a yellow banner on
        the top of the screen.
- `string` *optional* : The text used as label of the setting. If it's
        not defined, the first field is used as label.
- `title` *optional* : The text used as tooltip.
- `help` *optional* : The help/description of the setting. This text is
        displayed just below the setting label (with classname
        `text-muted`).
- `company_dependent` *optional* : If this attribute is set to "1" an
        icon is displayed next to the setting label to explicit that
        this setting is company-specific.
- `documentation` *optional* :  If this attribute is set, an icon is
        added next to the setting label, this icon is a link to the
        documentation. Note that you can use relative or absolute path.
        The relative path is relative to
        `https://www.odoo.com/documentation/server_version`, so it's not
        necessary to hard-code the server version on the arch anymore.

closes odoo/odoo#106425

Task-id: 3081367
Related: odoo/enterprise#34337
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: "Michael Mattiello (mcm)" <mcm@odoo.com>
2022-12-02 14:40:25 +01:00
Romeo FragomeliandRomain Estievenart d3ad21cdfc [FIX] web: Many2One field don't show all records in small screen
Since the conversion in OWL of the `many2one_barcode` widget, on Mobile
when we open the search more a filter value is added automatically in
the filter and so when we want to change the value we need an additional
step to remove the filter to see all records.

This commit, use a 'custom event' to open the barcode search and restore
the normal behaviour on the `click` event.

Steps to reproduce:
* Go to Timesheet
* Add a new line
* Select a project
* Try to change the project => BUG show only the selected project

closes odoo/odoo#106267

X-original-commit: 6d7f5a0abd79f6185831a2b9617b031d13da89be
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Co-authored-by: Romain Estievenart <res@odoo.com>
2022-11-22 17:09:30 +01:00
Joseph Caburnay c412f11c02 [REF] web,web_*: import owl features using "@odoo/owl" module
In @odoo-module files, we do the following conversion:

`const { ... } = owl;` -> `import { ... } from "@odoo/owl"`.

While in legacy odoo module (odoo.define):

`const { ... } = owl;` -> `const { ... } = require("@odoo/owl");`.

closes odoo/odoo#104260

Task-id: 3032274
Related: odoo/enterprise#33298
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-10-27 14:41:17 +02:00
Sergey Shebanin 0c0656eadd [FIX] web: statusbar field on mobile doesn't show current value
closes odoo/odoo#103715

X-original-commit: a045d4555f3546bf9b0327b24f5c6f3fecf247f1
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-10-21 10:11:14 +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
Dardenne Florent (dafl) 9a132ba95f [FIX] web: many2many_tags_field: fix mobile placeholder
Before, in mobile, the placeholder for `many2many_tags_field` when in mobile
was the text "props.placeholder".

Now the placeholder text is dynamically set.

closes odoo/odoo#101513

X-original-commit: b7fe9f2cf2b04b1172ec2ecbb3998328976f4960
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-29 09:09:09 +02:00
Michael (mcm)andluvi 710271240f [IMP] web: remove readonly mode of form view
This commit does multiple things:
- The readonly mode of form view is removed but not for the fields.
  it means that the fields in the view are always in edit mode except
  if we force them to be readonly.
- The control panel is revamped to take less vertical space and shows now
  the record editing (dirtiness)/validity status after editing the record.
- The record is saved only when leaving the view or by clicking the save
  button when hovering the record status in the control panel.
- The record can still be discarded by clicking the discard button when
  hovering the status text in control panel.

task id: 2822553

X-original-commit: 77824ad44b6945a9811120380747f87ef6362ae2
Part-of: odoo/odoo#101118
Co-authored-by: luvi <luvi@odoo.com>
2022-09-27 12:43:50 +02:00
Bruno BoiandJorge Pinna Puissant ed9a9d024a [REF] *: calendar view in owl
This commit introduces the new calendar view written in owl.

closes odoo/odoo#101185

X-original-commit: e88988f58582d5b49a32d7102a74a176f40c4c69
Related: odoo/enterprise#31808
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-09-26 22:48:44 +02:00
Jorge Pinna PuissantandBruno Boi 3f15989e15 [MOV] web: transfer settings touch customization to community
This commit adapts codebase following the move and integration of the
touch device detection and customization (through the o_touch_device
class) in community.

X-original-commit: f3adc2b0f70feb80292f6c755d53690e49647dbb
Part-of: odoo/odoo#101185
Co-authored-by: Bruno Boi <boi@odoo.com>
2022-09-26 22:48:44 +02:00
Bruno BoiandJorge Pinna Puissant 156d41dbda [MOV] web: transfer ActionSwiper to community
This commit adapts codebase following the move and integration of the
touch device detection and customization (through the o_touch_device
class) in community.

X-original-commit: 5ae86ad473dd69559820b1f599ce389484cdebbc
Part-of: odoo/odoo#101185
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-09-26 22:48:43 +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
Romeo Fragomeli b6a36df34a [IMP] web: convert many2one_barcode to OWL
Before this commit there is a widget `many2one_barcode` that allows
to scan a barcode.

After this commit, we have converted it to OWL, but it's more than a new
component. From now, the logic is in the basic Many2One as a
property/option (`canScanBarcode`) and we also have the equivalent
Component (`widget="many2one_barcode"`). This choice has been made to
support multiple use cases (e.g. having the product_configurator and the
barcode on the same product field).

Note:
now we use the `browser` class to allow to patch the browser feature
during testing.

Part-of: odoo/odoo#100082
2022-09-15 11:05:22 +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
FrancoisGe 3f94f5a0f6 [REF] web: convert attach_document to owl
closes odoo/odoo#99585

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-07 09:23:40 +02:00
Adrien Dieudonne f28781b358 [FIX] test_main_flows: avoid useless click in burger menu
As all burger menu items are unfolded now, it is no longer necessary
to click to open sub menus.

Part-of: odoo/odoo#88073
2022-09-05 09:31:50 +02:00
Brieuc-brdandAdrien Dieudonné 8b96a8a993 [REF] web: BurgerMenu, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

- Converts dropdown into "nav ul li" structure.
- Removing of '.o_burger_menu_user'
- Removing of '.o_burger_menu_app'
- Removing of '.o_menu_sections'
- Removing of '.o_burger_menu_section'
- Some 't-key' not necessary anymore (thx to OWL2)

task-2812594

Part-of: odoo/odoo#88073
Co-authored-by: Adrien Dieudonné <adr@odoo.com>
2022-09-05 09:31:50 +02:00
Bruno Boi 0ae158bf43 [LINT] web
closes odoo/odoo#99295

Related: odoo/enterprise#30900
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-31 18:53:51 +02:00
Michael (mcm) b1f072cba4 [IMP] web: adapt dialog for mobile
This commit modifies the dialog to make it more user
friendly on small screen. On small screen, the dialog
opens in fullscreen and saves the scroll position when
opening to restore it on close.

Part-of: odoo/odoo#92475
2022-06-30 09:29:46 +02:00
Michael (mcm) 466cfbfb42 [IMP] web: fold statusbar field on mobile
This commit modifies the statusbar field to render all
its buttons in a dropdown when the user is on a small screen.

Part-of: odoo/odoo#92475
2022-06-30 09:29:46 +02:00
Michael (mcm) 2f9c346974 [IMP] web: group statusbar buttons on mobile
This commit modifies the statusbar's buttons to render
them in a dropdown when the user is on a small screen.

Part-of: odoo/odoo#92475
2022-06-30 09:29:46 +02:00
+2 48ef812a63 [REF] web: kanban, list and form views in owl
This commit introduces the new kanban, list and form views written
in owl. Even though it contains the implementation of those 3 views,
only the kanban view is activated for now (the list and form views
aren't 100% ready yet, so they aren't added to the view registry).

Alongside the views, the fields (<field name="..."/> in archs) and
widgets (<widget name="..." in archs) of web/ have been implemented
in owl as well. Legacy ones remaining in other addons are supported
in our new views, thanks to a compatibility layer. The goal is to convert
them asap though.

Legacy views, fields and widgets are kept for now, which explains the
number of added lines in this PR (around half of them concern tests).
They are still extended by custom code in other addons, that still need
to be converted (a lot of them are already on the way). Moreover,
they are still used in Studio as well. The plan is to lazy load them in
the Studio bundle when all custom code extending them will be
converted. Studio will be converted for v17.

Part-of: odoo/odoo#92475
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-06-30 09:29:44 +02:00
Prakash Prajapati 53992eb6ea [FIX] web_enterprise: close the burger menu on the new dialog
When the wizard (new dialog) is opened on the burger menu item, the burger menu does
not close. The burger menu appears on the wizard. It is fixed.

Reproduction Steps
  -Installed project application
  -Reporting -> Burndown Chart

task-2739646

closes odoo/odoo#90721

X-original-commit: 69821a67ca04d9aa5bb040d93e491c7f75b67232
Related: odoo/enterprise#27027
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-06 14:26:59 +02: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