Commit Graph
17994 Commits
Author SHA1 Message Date
Bastien PIERRE 38260f3262 [FIX] web: prevent command palette to lose focus
The command palette has the priority when useAutoFocus is call.
Like that, the command palette will not lose focus when clicking
on an app on the home menu and then directly opening the command
palette before the app mounting

TASK ID: 3338117

closes odoo/odoo#139124

X-original-commit: 660d27ac38c225559ea3697a24a34ac70ede8ec1
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
2023-10-19 02:28:10 +00:00
Abderraouf Ghrissi (abgh) b9532e7549 [IMP] project: Improve ux
Before this commit:
- project.task > list view: Currently, the progress is displayed
in purple if less than 100% and in red if above. The two colors
don't contrast a lot, making it hard to read. In addition, it
is not coherent with the color we usually apply for the remaining
hours in the rest of the app.
- onbording tour: the manual saving step is no longer necessary
as records are now automatically saved. In addition, showing it
doesn't provide a wow effect and is an extra opportunity to lose
people in the process

After this commit:
- the following color code was applied for the progress bar:
*if progress < 80 -> green
*if progress is between 80 and 100 included -> orange
*if progress > 100 -> red

- step removed.

task-3475170

closes odoo/odoo#132854

Related: odoo/enterprise#46162
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-18 18:27:25 +00:00
Hubert Van de Walle (huvw) b87e54bce4 [FIX] web: no_create option ignored for many2one + many2many_tags fields
Steps to reproduce
==================

- Install purchase_product_matrix,web_studio
- Go to purchase
- Click on a record
- Open studio
- Click on the "Products" tab > Edit List view
- Edit the product field
- Widget: Many2one
- Disable creation: enabled
- Close studio
- Create a new record
- Add a new line
- Type some random text in the product field

-> The option create is available

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

When the can_create attribute is not passed, the `canCreate` ends up
undefined. This means the default value of true is used and the
`no_create` option is ignored.

The can_create attribute should actually be passed and there is a bug in
python in the `_editable_tag_field` function, but it is not something we
can change in stable due to the fact it it requires an explicit change
in some views to pass the validation and thus, this requires an addon
upgrade (`-u ...`).
See https://github.com/odoo/odoo/pull/138032

opw-3432903

closes odoo/odoo#139068

X-original-commit: 4b6756e1775488e230bc25767adf5744f0ea9149
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-10-18 16:52:06 +00:00
Dylan Kiss (dyki) 747a9fac78 [FIX] web: show branch hierarchy in switcher when no access to parent
Currently, when a user has access to a branch of a company, but not to
the company itself, the branch will not show up in the company switcher.
As a result, the user is not able to switch back to that branch when
logged in to another company.

To fix this, we now show the whole hierarchy of the branches you have
access to, disabling the companies/branches you don't have access to.

task-3503204

Part-of: odoo/odoo#138942
2023-10-18 12:05:25 +00:00
Mélanie de0f97e08e [FIX] Fix focus view with searchpanel
Before this commit, if a view contained a searchPanel the scrollbar went at the top automatically; now the behavior of the scrollbar with or without a searchPanel is the same.

closes odoo/odoo#138341

X-original-commit: b8f881de82ab931ed8bf45e67dd8b28f943e733f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-10-18 12:05:13 +00:00
Pierre Rousseau 3d0a6c87fd [FIX] web: fix pager when using a many2many field
Before this commit, adding more records to a many2many field than the
limit of the pager did not update the pager. This commit fixes this
issue by updating the limit of the pager.

closes odoo/odoo#138883

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-18 10:49:50 +00:00
FrancoisGe bb09cf76e3 [REF] *: remove legacy time.js
The purpose of this commit is to delete the legacy/js/core/time.js file.
We have therefore replaced all calls to time.js with the l10N/date.js utilities.

Part of task 3439226

closes odoo/odoo#138609

Related: odoo/enterprise#48918
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-18 08:56:06 +00:00
Zelong Lin 7ac121b54d [FIX] web,mail: correspondent can be null
Correspondent in thread can be null and lead into crash
when getting thread action and im status.

Replace correspondent with chatPartner when type is chat.

The fix is to solve the problem so that it is not blocking
systray and chatWindow tests related.

Also, this fix small issue of systray overflowing issue.

closes odoo/odoo#138913

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-18 07:51:41 +00:00
Mathieu (mano) a036f69882 [FIX] web: document_layout color reset glitch
The color refresh button in the document layout configuration modal is
misaligned and moves the content when clicked

This commit adapts the CSS to have a proper absolute placement and
apply a height on the o_field_widget in this view to fix the issue.

task-3378759

part of: task-3326263

closes odoo/odoo#138774

X-original-commit: 907373d6e7556ecd17b0c0a87b3705e242f9d628
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-17 11:19:55 +00:00
mano-odoo 2495bfa725 [FIX] web: kanban card focus outline bottom
The kanban card do not display their outline on the bottom side of the
card. This is due to a negative margin (used to compensate for the
border bottom of the card).

This commit removes the border top if the kanban_record as a prior
kanban_record sibling, using its sibling border_bottom as its border
top and getting rid of the negative margin.

task-3488451

closes odoo/odoo#138772

X-original-commit: bf89d4ec951c77f5c7a01ccbad5edf0f7110f706
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-16 13:11:15 +00:00
Serge Bayet (seba) c584fa8de0 [FIX] web: correct the tiktok font url
This updates the relative url of the 'woff' font that was
one parent too far. Bug introduced in [1]

[1]: https://github.com/odoo/odoo/commit/47c5a092196054359d82edbc79dea0caf213dd9f

task-3477965

closes odoo/odoo#137710

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-16 13:11:09 +00:00
luvi cc0ca70428 [IMP] mail, web: call the installation prompt from the notification area
The NotificationItem component has been modified to support a new slot
allowing to display some content at the right of the notification item.
It is used in this commit to display an additional 'Install button',
inviting the user to click on the notification. Note that the entire
notification is still clickable, it is only a visual indicator.

Once the notification is clicked, the installation process is triggered:

- In case the system supports the native installation prompt, we now
display it, and the user is free to install the PWA from there.

- On Apple devices, a custom popup is displayed to the user, explaining
the steps to install the website as an application, since iOS and macOS
don't support a native prompt, and won't be using one anytime soon, since
it's a design decision from their side.

Some tests have been added to mock and test the display of the notification.
patchBrowserWithCleanup has been adapted to also remove any BeforeInstallPromptEvent
for every tests by default. This allows to test without the risk of issues with
messaging tests reading the number of notifications, or clicking the first
notification item when the service checks whether the prompt can be shown
or not (depending the availability of a native prompt, the OS, or the
localStorage, etc.).
To test the service correctly, you need to patch the test accordingly.

task-3275275

closes odoo/odoo#135866

Related: odoo/enterprise#48968
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-16 10:39:56 +00:00
Julien Mougenot 1c56280382 [IMP] web,*: status bar auto-resize
Before this commit, the status bar field could be displayed in 2 ways:
- in small screens: as a dropdown
- in larger screens: as an inline list of buttons

This commit centralizes both of these approaches into a dynamic display
that fits the available space:
- the current stage is always displayed;
- previous stages are displayed behind or contained in a dropdown if not
enough space;
- next stages are displayed behind or contained in a dropdown if not
enough space.

Task 3336856

closes odoo/odoo#124267

Related: odoo/enterprise#48706
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-16 10:39:53 +00:00
Brieuc-brd b4e96e7230 [FIX] board, web: fix dashboard icon SVG
Prior to this commit the knowledge icon from the same dropdown was
turned into an inline-svg but the dashboard one was not.

This commit aims to use an inline-svg for that icon and ensure it
renders correctly.

task-3072562

closes odoo/odoo#138279

X-original-commit: 4df55bbc7bfe0bbe62605cd88887d45460814964
Related: odoo/enterprise#48734
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-16 09:21:17 +00:00
Odoo's Mergebot 60f6fa8fef [MERGE] web_hierarchy,hr_org_chart: add hierarchy view for employees and departments
Purpose
=======

The goal is to be able to have a hierarchy view to see the organisation of a company, that is, to have organisation chart for `hr.employee` model.
To do that, a new view will be introduced in `web_hierarchy` module, called `Hierarchy` view and it will first be used in `hr_org_chart` module for `hr.employee`, `hr.employee.public` and `hr.department` models.

Implementation details
----------------------

- A new python method will be introduced in the models when `web_hierarchy` module is 
  installed. That method, called `hierarchy_read`, is created to fetch the data for the
  hierarchy view when the view will be loaded.
- The definition of hierarchy view is inspired to the definition of the kanban, 
  that is, a template called `hierarchy-box` has to be defined in the arch to draw the card
  displayed in the node of the hierarchy view.
    - Some attributes can be defined on the `hierarchy` tag:
        - `parent_field` (default='parent_id') contains the parent field name 
          to use to fetch the parent record and to be able to fetch the hierarchy.
        - `child_field` (optional attribute) contains the child field name
          to use to find the child records (it is in fact the one2many field).
          If that field is defined then some queries can be avoided since we
          directly fetch the children when a read/search_read is done.
        - `icon` (default='fa-share-alt o_hierarchy_icon') icon displayed inside the 
          `Unfold` button (to show the child nodes) in hierarchy node.
        - `draggable` (default=False) True to allow the user to drag and drop a 
          node (= record) into a row or another node to update its parent node.

task-3376776

closes odoo/odoo#131162

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-16 07:58:37 +00:00
Xavier Bol (xbo) 1048111a18 [IMP] hr_org_chart,web: define icon class on i tag for view button icon
Before this commit, the icon of the hierarchy view should be rotate
of 90 deg to have an appropriate icon for the view. The problem is
since the icon class is added on button classes, the button will
also be rotated with the icon instead of just the icon.

This commit defines a `i` tag inside the `button` element to select
the view to be able to apply css rotation only on the icon instead
of the whole button.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) e28e1e5b25 [IMP] hr_org_chart,web: extend kanban compiler for hierarchy view
This commit extends the kanban compiler for the hirarchy view. Some
changes has been done in the kanban compiler to be able to reuse the
existing code.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) adbcf6e1da [FIX] web: remove border-end-0 in search view
Before this commit, when search menu is not displayed in the
search view, then the border right is missing.

This commit removes `border-end-0` class added in the search view
to always have a border. Even with the search menu, it does not
seem to have an extra border.

task-3376776
2023-10-16 08:17:30 +02:00
Xavier Bol (xbo) c143f1dca2 [IMP] web: manage parent_of operator in domain in mockServer
Before this commit, `child_of` operator is managed in the mockServer
but not the `parent_of` one.

This commit manages `parent_of` operator in mockServer to be able
to find the record when the domain used contains that operator

task-3376776
2023-10-16 08:17:30 +02:00
Bruno Boi 25423820ed [REF] web,mail: add popover props: arrow,animation
Better API as the arrow was not displayed when the fixedPosition
prop was true, which is as we were mixing apples and pears.

And as for the animation prop, it permits to remove the hacky
"o-fast-popover" class usages.

closes odoo/odoo#135188

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-10-13 21:11:52 +00:00
Bruno Boi b449ae6036 [IMP] web: improve usePosition API
**Before this commit**
The usePosition hook takes two arguments:
- the target element (could be a function returning an element)
- the positioning options, which are optional.

This API is a bit weird for these reasons:
- the target argument's type is variable
- the "popper" option is not very meaningful and has a
  default value of "popper", which is not clearly stated

**After this commit**
The usePosition hook now takes three different arguments:
- first is "refName", which is the reference to the element to position
  in the template
- then is "getTarget", a callback that must return the target element,
- finally the "options"

Part-of: odoo/odoo#135188
2023-10-13 21:11:52 +00:00
Pierre Paridans 35122d5c7c [REF] *: use raw CSS rules instead of extend utility classes
*:mail,portal,project,web

task-3546717

closes odoo/odoo#138615

Related: odoo/enterprise#48920
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-13 11:46:30 +00:00
Pierre Paridans daf05c241e [IMP] calendar,web: extract static CSS rules out of loops
This commit seperates the static and color dependent rules for the
Calendar view and app to avoid duplicating the static ones.

task-3546717

Part-of: odoo/odoo#138615
2023-10-13 11:46:30 +00:00
Aaron Bohy c5f92537fc [FIX] web: search view: evaluate invisible attrs
Since [1], invisible attributes on views are no longer evaluated
server-side. In search views, field and filter nodes can have an
invisible attribute which can be static ("1" or "True") or dynamic,
depending on the context (e.g. "context.get('something')"). Before
[1], in the arch received by the client, the value of the invisible
attribute was always static as "context.get(...)" expressions were
evaluated server-side. This is no longer the case, and we thus have
to evaluate the expression client side.

Before this commit, the invisible attributes in search archs were
simply ignored if they weren't static. This could be observed for
instance in Project > open a project: the "Private tasks" filter
was available even though it is dynamically invisible, and shouldn't
be there.

This commit ensures the invisible attributes are always taken into
account and evaluated.

[1] odoo/odoo@ba1a5509fa

closes odoo/odoo#138590

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-13 11:46:28 +00:00
Pierre Rousseau 29e301fe32 [IMP] web: multi record selector: add keyboard navigation
This commit adds keyboard navigation to the multi record selector.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Pierre Rousseau d949e001c9 [IMP] web: introduce useTagNavigationHook
Currently, the newly created component `MultiRecordSelector` (https://github.com/odoo/odoo/commit/bd0f2c6d799961b0a41222652eae7214c01dc5fe)
does not support the keyboard navigation between its tags (selecting or
deleting a tag). This behavior is currently implemented in the
`Many2ManyTagsField` component. This commit extract this behavior from
the `Many2ManyTagsField` component into a new hook that will be used by
the `MultiRecordSelector` component.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Pierre Rousseau 78a859e0a1 [IMP] web: support placeholder for record selectors
This commit introduces the support for placeholder in record selectors.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Michael (mcm) e062e6f483 [IMP] web,*: remove legacy env
This commit removes all the legacy envs (common_env, env, public_env)
as well as the files used to set up them.

task 3439226

closes odoo/odoo#138348

Related: odoo/enterprise#48781
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-13 09:17:45 +00:00
Michael (mcm) 94824d8767 [IMP] *: remove legacy notification service mapper
This commit removes the mapper to the notification service and adapts
widgets that display notifications.

task 3439226

Part-of: odoo/odoo#138348
2023-10-13 09:17:45 +00:00
abd-msyukyu-odoo 62ca95f0fd [IMP] mail, web: create FileModelMixin for FileViewer
Extract basic props needed by the `FileViewer` for `files` instances in a
reusable `Mixin`.

task-3172056

Part-of: odoo/odoo#127021
2023-10-13 07:33:52 +00:00
Mathieu Duckerts-AntoineandMathieu Notté 6428aef678 [IMP] *: improve domain selector edition, dom, and style
We improve various aspects of the domain selector:

- We make the domain selector be able to display all domains accepted by the class Domain (domain.js)
- We improve the edition/selection of values, e.g. for the operators in/not in
- We improve/simplify the style/dom

Task IDs: 3507123, 3508940

closes odoo/odoo#128680

Related: odoo/enterprise#48324
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mathieu Notté <mano@odoo.com>
2023-10-13 06:27:42 +00:00
Pierre-Yves Dufays 35d5342887 [IMP] {test_}mail, various: generalize activity plan + activity batch schedule
Generalize the hr.employee activity plan to any model, allowing to create
activity plan that can be launched on any model.

The activity can now be created in batch by selecting multiple record in the
list view and then clicking on a "clock" icon in a row similarly to the batch
records update (selecting multiple records allows to change for example their
name in batch in the list view). We implement also that functionality for the
plan, allowing to launch a plan on multiple records at once.

We also centralize the launching of activity or activity plan through either
the  "Activities" button in the chatter or the "clock" button in the view list.

Scheduling activity is now taken in charge by a wizard that can schedule a
single activity as well as a plan. We add/update tests for checking that the
wizard is launched with the right record selection (on a single record or a
batch) and add tests for checking the wizard itself.

The plan can be defined through an added menu in the technical admin menu but
also through configuration menu added in the module crm, project.

Technical notes:
In the added wizard, to determine that there is a error, we introduce the
has_error field because we cannot use easily the error field for that. Indeed,
to determine that there is no error, we have to compare it to "<p><br></p>"
(more precisely &lt;p&gt;&lt;br&gt;&lt;/p&gt;) which is not handy and may
change in the future. This is because when we write False on field error and
read it after, we get "<p><br></p>". Instead, we centralize this weird
comparison in the model in the compute method of has_error.

The ActivityListPopover still displays the activity of the record on which it
has been triggered but the button to schedule activity will launch a wizard
that create activities in batch for the selected records if more than one was
selected. For that, the ActivityListPopover component receives now an
additional prop: resIds (selected records) on top of the resId prop (record on
which the popup has been triggered). Note that when the line that trigger the
popup is not selected, the batch mode is disabled to avoid confusion.

Test are updated because the wizard is opened instead of the activity form to
schedule a new activity and as the form view is only used to edit already
existing activities, default_res_id and default_res_model are no longer passed.

We defines date_deadline and date_plan_deadline in the schedule wizard because
those date are managed differently (default value, required or not, ...).

Task-3390865

Part-of: odoo/odoo#137969
2023-10-12 16:12:09 +00:00
Pierre-Yves Dufays ed4f6d3dbe [MOV] web, mail: move filterable selection
We move the filterable widget from loyalty to web to make it more widely
accessible to other applications. It will soon be used in the new activities
plan feature.

Following the move of the filterable selection widget to the web module, we do
some light cleanup.

Task-3390865

Part-of: odoo/odoo#137969
2023-10-12 16:12:09 +00:00
Julien Carion (juca) 18819bdb4b [IMP] web: remove jquery from database_manager
This commit removes usages of jquery in database_manager and adapts the
code accordingly. Also improve the alert messages.

task-3508327

closes odoo/odoo#137670

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-12 16:12:08 +00:00
Pierre ParidansandAdrien Dieudonné b75a66af1a [IMP] web,crm: remove extend for text colors
task-3546717

closes odoo/odoo#138467

Related: odoo/enterprise#48830
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Co-authored-by: Adrien Dieudonné <adr@odoo.com>
2023-10-12 14:44:57 +00:00
FrancoisGe 9211a6f33f [FIX] web: calculate specialData when record is updated
The goal of this commit is to cause a recalculation of specialData when
this depends on a record value.
Currently, specialData are only calculated during onWillStart and
onWillUpdateProps. But the specialData of certain fields do not depend
only on the props, they can also depend on the values present in the record.
We therefore want to recalculate them when the value of the record changes.

How to reproduce:
- Go to a form view with a field "x" and
  a field with specialData dependent on field "x".
- Edit the field "x"

Before this commit:
    The specialData have not changed

After this commit:
    The specialData have been recalculated.

closes odoo/odoo#138372

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-12 14:44:50 +00:00
Romeo Fragomeli b49a5d1b01 [FIX] web: improve useSortable when no placeholder is not a clone
Sortable uses the "enter" and "leave" events to handle the move of the
placeholder in the container. When the initial drag element is cloned,
the algorithm is more simple as the placeholder takes the same size as
the original one. When we use a custom placeholder (in our case, a small
line) and the placeholder change position, it triggers an "enter" and
"leave" events in loop due to the smaller size of the placeholder.

This commit ensures the placeholder to move only one time per pointer
event move ("enter" and "leave") and avoid flickering when we move one
element on the first/last element.

Note: a better solution to avoid this complexity is to use pointer
"move" event instead of "enter" and "leave".

closes odoo/odoo#138350

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-12 13:16:48 +00:00
FrancoisGe c5b87e130b [FIX] web: update properties field
The purpose of this commit is to resolve two issues relating to the properties field:

Issue 1:
========
In a list view, when you edit a property and then select another field
in the same record, the edition disappears.

How to resolve:
--------------
Do not delete the changes linked to the property in record.update.

How to reproduce:
----------------
- Go to a list view with a properties field containing a property char
- Insert a value in the char property
- Click on another field in the same record

Before this commit:
    The inserted value disappears

After this commit:
    The inserted value is still present

Issue 2:
========
The fields/activeFields only take into account properties received
during the initial web_read and not those added by an update or an onChange.

How to resolve:
--------------
Generate property fields and activeFields during parseServerValue
(web_read and onChange) and during an update.

How to reproduce:
----------------
- Go to a form view with a properties field
- Editing a field with an onChange
- The onChange returns a new property for the properties field

Before this commit:
    A crash is displayed

After this commit:
    The new property is displayed correctly

closes odoo/odoo#137989

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-12 13:16:44 +00:00
Xavier Morel 57984131f7 [REM] web: pwa registration success log
odoo/odoo#136944 removed the log from website_event_track, but despite
noting the discontinuity I missed that *a new instance of the log line
had been added in 16.1* and that is likely why 16.1 was suddently
spammed with that: website_event_track (likely) only installs its PWA
when opening an event on website, but since odoo/enterprise#35322 the
web client tries to install its PWA *every time it's loaded*, which
can be up to once per test for qunit tests (if they need a webclient).

In odoo/odoo#133560 this registration was moved from enterprise to
community, so needs to be nuked here as well.

Follows the removal of this log line in odoo/enterprise#48831.

closes odoo/odoo#138469

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-12 11:20:36 +00:00
MerlinGuillaume af73206892 [FIX] web: add help tooltip from form view on fields
The help defined on a field via Studio is only visible when debug mode
is enabled

Steps to reproduce:
1. Install Contacts and Studio
2. Go to Contacts, open a contact and toggle Studio
3. Add a field in the form view and add a message in the Help Tooltip of
   the field
4. Close Studio
5. Without debug mode, the small question mark is not displayed next to
   the field so we cannot see the help tooltip

Solution:
First use the help defined on the field in the view, then the help
defined on the field in the model

Problem:
The tooltip help can also come from the view

opw-3511121

closes odoo/odoo#138416

X-original-commit: a70639b790471aec781c50274abbda78bf5bea7d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-10-12 11:20:34 +00:00
MerlinGuillaume 3463c48cad [FIX] web: limit width of search bar favorites
With long favorite names, the search menu overflows to the left of the
screen

Steps to reproduce:
1. Install any app with a search bar (e.g. CRM)
2. Open the app and save the current search as a favorite, enter a
   really long name (200 characters or more)
3. The search left side of the search bar is not visible anymore

Solution:
Limit the width of the search bar menu and of the favorite menu. The
purpose of the maximum width on the search bar menu is for a correct
display in mobile view. We also take into account the comparison menu
(that can be displayed if you add a filter on creation date)

opw-3442705

closes odoo/odoo#138415

X-original-commit: 107f496b5e67ca3293e2c63a273cf8c491187fb5
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-10-12 11:20:33 +00:00
Julien Carion (juca) f99efb0173 [IMP] web: domain field: Add condition in folded domain field
This commit adds the recently removed add condition button to the folded
domain field so the user can unfold the domain and add a new rule in one
click.

Task-3525269

closes odoo/odoo#137663

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-12 09:49:45 +00:00
Michael (mcm) 7ebd785764 [IMP] *: rename quick_add into quick_create
This commit renames calendar's attribute quick_add to quick_create
to be more consistent with other views.

closes odoo/odoo#138042

Related: odoo/enterprise#48677
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-11 17:02:07 +00:00
Michael (mcm) 3846472e96 [REF] web,calendar: split calendar quick_add attr
Since the PR [1], quick_add can be both a boolean and an id:
0 = without quick create
1 = with quick create and simple dialog
other number = with quick create and custom form view dialog

This is not great to have both behavior in a same attribute so this
commit split them back in two attributes as it was before [1].
It's easier to understand when we want a quick create and which view
to use in the dialog.

[1]: https://github.com/odoo/odoo/pull/122923

Part-of: odoo/odoo#138042
2023-10-11 17:02:07 +00:00
Adrien Schoffeniels 2d7a49dab1 [IMP] web: move properties field's "add a property" btn in the cog menu
Purpose:
--------
When the property field is added into a form view, the "add a property"
button is shown by default.
However, most of the time the users won't add properties when opening a
form view, making this button take up space for nothing.

To alleviate this issue, commit [1] added an option that allows to hide
this button, and added actions to allow adding properties from the cog
menu instead.

Now that properties are being added into several views, one would like
this "add properties" button to be hidden by default, and show an entry
in the cogmenu allowing add properties by default, without needing to
create an action for every view using a property field.
Therefore, a new static action "Add Properties" has been added in the form
controller that is available if a properties field has been encountered
during the parsing of the form view's arch.

The "hideAddButton" has been changed into "showAddButton" and now allows
to show the "Add a Property" by default.

Task-3458627

[1]: https://github.com/odoo/odoo/commit/1f80810e39f811122a65e11cd8cac99aa39a7960

Part-of: odoo/odoo#137589
2023-10-11 17:02:02 +00:00
Aaron Bohy dc2be03dba [IMP] web,*: lazy load jSignature lib and extension
The jSignature lib is only used by the NameAndSignature component,
which is not accessible on a many screens. This commit thus
removes the lib and its extension from the bundles, and makes the
NameAndSignature component load it on demand.

Part of task~3439226

closes odoo/odoo#138054

Related: odoo/enterprise#48633
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-11 08:18:46 +00:00
Aaron Bohy 4bf1384e8b [REF] web,sale,portal: adapt SignatureForm to owl
This commit converts the SignatureForm widget into a Component.
This allows to remove the last usage of the legacy NameAndSignature
widget, which we thus remove.

Part of task~3439226

Part-of: odoo/odoo#138054
2023-10-11 08:18:46 +00:00
Aaron Bohy 634409188c [IMP] web: url utils: add redirect function
This function must be used to safely redirect to another url. It
ensures that we stay on the same origin, and thus that the url is
safe.

Part-of: odoo/odoo#138054
2023-10-11 08:18:46 +00:00
Pierre Pulinckx (pipu) daecbbac50 [REM] web: redundant escapeHTML function
In a6fea37, escapeHTML was introduced to replace the corresponding
underscore.js function. It is very similar to the widely used escape
function, except it additionally escapes single (') and double (")
quotes.

The additional escaping is not generally harmful, and is necessary to
safely inject values into attributes. As escapeHTML is almost unused,
remove it and update escape to include quotes.

taskId : 3522892

closes odoo/odoo#137216

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-10 14:07:09 +00:00
Rémy Voet (ryv) 0782ec07e7 [FIX] web: display_name "New" fallback should only target new record.
There is a fallback in the control panel
(https://github.com/odoo/odoo/blob/c22cb6bbadd38ecb050f6d4dc14672868beda20b/addons/web/static/src/search/control_panel/control_panel.xml#L137)
if the display_name of the record is empty.
But it is never actually used because there is another
fallback in the form_controller ("New"). This latter fallback
should only be used for new records, not for existing ones.

closes odoo/odoo#138061

Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-10-10 12:35:01 +00:00