Commit Graph
2808 Commits
Author SHA1 Message Date
abd-msyukyu-odoo 40dda26350 [FIX] core, web: handle read_group ranges for multiple granularities
There was an issue with the computed `read_group` `__range` when grouping on
the same date/datetime field on multiple granularities (i.e. month, week).
Since the range was stored with the field_name as a key, the last evaluated
range would override the previous ones.

Impacted Versions:

  - master
  (- exists since 15.0 but it does not impact the user directly so it has been
  decided to fix this only in master, since the API is modified)

Steps to reproduce:

  1. Open a list view and group by a date field with at least 2 granularities
  2. Open the chrome debugger (network) and check a web_read_group rpc preview
  3. Find the web_read_group for groups related to one of the largest
     granularities and check the `__range`

Current behavior:

  - `__range = {field_name: false}`

Expected behavior:

  - `__range = {field_name: {from: range_start, to: range_end}`

Explanation

Since the smaller granularities are evaluated last, and the condition to update
`__range` is related to the field_name and not the granularity, the range is
always overriden by the smaller granularities (even if their value is False)
when grouping on the same field with multiple granularities.

Furthermore, there is a conceptual problem with the current solution: it does
not allow to store multiple ranges when the read_group is not lazy and when
grouping on the same field with multiple granularities.

Therefore, the proposed solution is to use the full groupby keys in the
`__range` to allow storing multiple ranges depending on granularity. The keys
in `__range` would thus match the group value keys and allow more flexibility
if a domain must be forged from the group(s) range(s).

Task-2894519

closes odoo/odoo#95193

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-14 18:03:50 +02:00
Matthieu Stockbauer 3ae11c87e8 [IMP] mail, *: adapt bus service to wowl env.
*: bus, calendar, iap_mail, im_livechat, project, web.

In order to ease the PR introducing the websockets in Odoo, the bus service
has to be updated to be a wowl service. This PR takes care of it.

task-2053917

closes odoo/odoo#95824

Related: odoo/enterprise#29361
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-14 11:42:42 +02:00
Michael (mcm) 2faf0ac64d [FIX] web: fallback for domain selector operator
Before this commit, it happened that the domain selector
couldn't find the operator linked to the field.
This commit adds a fallback on the existing operators
to find an operator that matches.

for example the domain `[["name", "like", "M"]]` gave
`Name ? "M"`, now it correctly gives `Name like "M"`.

closes odoo/odoo#95891

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-13 18:49:50 +02:00
Michael (mcm) da8f1d44c9 [IMP] web: add in_dialog option to domain field
In legacy, the domain field had an `in_dialog` option that was
used to display a button that opens a dialog to edit the value.
This commit reimplements the `DomainSelectorDialog` in owl
and adds the option the new domain field.

closes odoo/odoo#95768

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-13 17:40:57 +02:00
Michael (mcm) 88412a2d2b [FIX] web: fix patch descriptor
Before this commit, patching a getter of a class made it enumerable
(`Object.keys({ a: 1 })` -> `["a"]`).
In javascript, getters of a class are not enumerable but
getters of an object are enumerable.

When patching, the system replaced the descriptor of the old class
member by the member of the object.
Now, it replaces some info of the old descriptor by the new descriptor
but not the entire descriptor.

closes odoo/odoo#95921

X-original-commit: fd7c2c0c14bfaac228abacb265278157eec4aad0
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-07-13 16:23:08 +02:00
FrancoisGe 1f4e583ba2 [FIX] web: CP lose init seach value
Before this commit, in the HomeMenu, typing several characters very
quickly could result in some not being present in the command palette
when it was opened.

Exemple:
In the HomeMenu,if I type "a" "b" "c" quickly the command palette will
open with the search value "/a" or "/ac". So we have lost the second
and/or third character.

Why:
All characters typed between the first and the moment the command pallet
is not yet mounted are lost because the search bar of the command pallet
is not yet available.

Solution:
If you use openPalette and the command palette is already open.
The configuration of the command pallet will be overwritten by the one
given to openPalette.
In our case, we can pass new configurations with the correct searchValue
until the command palette is returned.

closes odoo/odoo#95492

Task-id: 2906623
Related: odoo/enterprise#29230
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-12 04:21:33 +02:00
Mathieu Duckerts-Antoine f76205322e [FIX] web: graph,pivot: favorite groupbys
Problem:

Have a pivot view in some state. Toggle a favorite with a context in
which a key "pivot_row_groupby" is defined. The pivot view should be
grouped (on rows) by that pivot_row_groupby but it is not always the
case. The basic problem is that the key "pivot_row_groupby" is never
considered after the first load (see method load in pivot_model.js).

Solution:

We make the search model used by the pivot view send as groupby for the
favorite its pivot_row_groupby instead of its groupBy (which can be
different). We do something similar for the graph view that presents a
similar problem.

closes odoo/odoo#95688

Opw: 2837428
X-original-commit: ea9f66f99caaa6136912c467e5b80fe605586845
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-11 07:58:55 +02:00
Jorge Pinna Puissant 2a44537c7c [FIX] web: missing class on monetary field
Before this commit, a class was missing when the monetary field was on
edit mode. This results in a non-alignment between the monetary symbol
and the value.

closes odoo/odoo#95620

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-08 14:34:16 +02:00
Michael (mcm) d85609501d [REF] web: change field.extractProps API
Before this commit, the record was given to `field.extractProps`
so it could return props based on the record.
Now, only the attrs and field is given so it can be called
only once when parsing the arch (except for kanban).

closes odoo/odoo#95389

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-08 14:33:52 +02:00
Jorge Pinna Puissant cd9ba6b06a [FIX] web: take into account orientation classes on radio button field
Before this commit, all radio buttons were on horizontal style,
the o_vertical class was not taken into account.

closes odoo/odoo#95553

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-08 13:21:53 +02:00
Xavier BOL (xbo) 45780793dd [FIX] web: create string ast for PyDate(time) object
Before this commit, when a new domain is created with a list of rules
and in one of those rules contains a PyDate/PyDatetime object in a
right leaf, this leaf will be converted into a plain object instead of
keeping the initial object.
For instance:
```js
a = new Domain([['date', '=', PyDate.create({day: 1, month: 1, year: 1970})]])
a.toList() // result: `[['date', '=', {day: 1, month: 1, year: 1970}]]`
```
Since it is a plain object, when the result will be passed to the
server, the final result will be an object in a string instead of giving
the utc date formatted.

This commit fixes this issue by checking if the object instances of the
`PyDate` or `PyDatetime`. If it is the case, then the ast type will be a
string and the value will stay the same instead of creating a plain
object and the ast type which determines a JSON.

closes odoo/odoo#95570

X-original-commit: be5c8d0fc340b3e2ad9721d21ef1133870d8a774
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-07-07 17:31:19 +02:00
Mathieu Duckerts-Antoine c59eac2fcb [FIX] web: kanban: dragged record cannot be saved
In a grouped kanban view, drag a record to another column can modify the
record validity. In that case, the group changes should not be validated
and the drag and drop canceled.

closes odoo/odoo#95437

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-07 14:44:14 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 3e7c13c97d [REF] *: BS5: Migrate data attributes
> Data attributes for all JavaScript plugins are now namespaced to help
> distinguish Bootstrap functionality from third parties and your own code.
> For example, we use data-bs-toggle instead of data-toggle.

https://getbootstrap.com/docs/5.1/migration/#javascript

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:21 +02:00
Romeo Fragomeli f936513466 [REF] *: BS5: avoid multiple usage of BS handler
In BS5 there is a check to avoid having multiple handler for one
element and we can't add two components' instance on an element.

So, before disposing a tooltip we check if there is an instance of a
tooltip and we avoid instantiation of tooltip if not already done.

e.g.:
> Bootstrap doesn't allow more than one instance per element. Bound
> instance: bs.collapse.

e.g.:
> Bootstrap doesn't allow more than one instance per element. Bound
> instance: bs.carousel.

> Bootstrap doesn't allow more than one instance per element.
> Bound instance: bs.tooltip.

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:20 +02:00
Romeo Fragomeli e1ea58c941 [REF] *: BS5: Migrate dropdowns
- BS5 JS use the `data-bs-toggle="dropdown"` attribute to
automatically enable the BS Component.
But in this case as the `.dropdown-menu` is only rendered when the
`.dropdown-toggle` is clicked we can't initialize the Dropdown at the
first render. So we do it manually.

- change .dropdown-menu by .o-dropdown-menu (owl)
  -> to handle keyboard navigation we can't use BS dropdowns

- use currentTarget of event
  As the event can bubble we use currentTarget to be sure to be at the
  higher level in the DOM.

> All the events for the dropdown are now triggered on the dropdown
> toggle button and then bubbled up to the parent element.

- BS5 don't add .show on parent group anymore
  -> dropdown show class not on the same node on BS5

- avoid dropdown warning using margin in CSS
  BS5 show a warning if we use margin statically in CSS for a dropdown.

> Popper: CSS "margin" styles cannot be used to apply padding between
> the popper and its reference element or boundary. To replicate margin,
> use the `offset` modifier, as well as the `padding` option in the
> `preventOverflow` and `flip` modifiers.

- adapt the systray activity dropdown for mobile
  On desktop positions are now dynamic and on mobile it's static

- In BS5 the CSS `bottom: 100%;` is not more applied to the
  `.dropup .dropdown-menu` selector.

- Change right -> end and add data-bs-popper="none" to avoid
  Popper interaction

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +02:00
Romeo Fragomeli 9ea1351334 [REF] *: BS5: Migrate forms and inputs
- BS5 uses native inputs instead of pseudo-element for some
  input like checkbox, radio, ...
  in BS5 input checkbox don't have "virtual visual" checkbox anymore
  (::before), so we remove the relative's rules

- removed `.custom-control` class

- `form-switch` use a new layout system in BS5 we adapt the code to
  match the Bootstrap approach (inline SVG).

- In tests, we don't check the exact value of the background as it
  change in community/enterprise, and it's difficult to check the value
  of an SVG.

- Overflow in progressbar is now hidden.
  -> we had to restore it.

- In BS5 margins in forms/inputs has been changed
  -> we had to restore it (e.g. 'mb-3')

- .form-group, .form-row, .form-inline
> Dropped form-specific layout classes for our grid system.
> Use our grid and utilities instead of .form-group, .form-row,
> or .form-inline.

- .input-group-append and .input-group-prepend
> Dropped .input-group-append and .input-group-prepend.
> You can now just add buttons and .input-group-text as direct
> children of the input groups.

Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#forms

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:18 +02:00
Romeo Fragomeli b82ba2a8fd [REF] *: BS5: Migrate modals and .btn-close for modals and alerts
- modal 'show' option doesn't exist anymore
  -> We need to call .show()

- by default, show is not the default
  -> we need to call .show() explicitly.

- generic close button for dismissing content like modals and alerts.

- BS5 modals needs `modal-dialog` class to work

- normally we need also to add `modal-content` class but as the original
XML don't have this nested level of div we don't use it, but instead
we add `pointer-events: auto` for all children `DIV` of `modal-dialog`
-> See DocumentViewer

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:18 +02:00
Romeo Fragomeli 23facbfb76 [REF] *: BS5: migrate popovers/Tooltip
* data('bs.popover') is not a jQuery data anymore
  -> fetch data from the instance instead.

* use the new class name 'popover-arrow' instead of 'arrow'

* website_forum: offset is not a number anymore
  -> Convert to string instead.

* BS5 event listener: 'focus' -> 'focusin'

* use `mouseover` event to show and `mouseout` to hide.

* disable at some point the animation to avoid remaining listener
  in the DOM.

Ref:
https://getbootstrap.com/docs/5.1/migration/#popovers

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:17 +02:00
Samuel Degueldre 162b42e4cd [FIX] web: form: correctly handle empty buttonbox
Before this commit, a form view with an empty button box would
produce a crash, in the ButtonBox component, because it assumed to
have slots. This commit prevents this from happening as we no
longer put a ButtonBox component in the template if there's nothing
in it.

closes odoo/odoo#95427

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-07-06 17:10:38 +02:00
Mathieu Duckerts-Antoine f3543be406 [FIX] web: process context.form_view_initial_mode
Before this commit, the context parameter "form_view_initial_mode" was
ignored by the form views, so that the form view would not be always
initialized in the appropriate mode.

closes odoo/odoo#95413

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-06 17:10:28 +02:00
Mathieu Duckerts-Antoine 3d6f0c200d [FIX] web: compile a button with id
Before this commit, button ids (if any) were absent from the templates
generated by a view compiler.

Part-of: odoo/odoo#95413
2022-07-06 17:10:28 +02:00
Mathieu Duckerts-Antoine 825fa5b9f0 [FIX] web: kanban: transaction error on record dragged twice
Problem:

Have
 - a slow network
 - a kanban view grouped

then move a given record from a column to another twice quickly.
An error occurs.

This is due to the way the transaction system in kanban model works:
the first move done in the first transaction being not yet finished,
no other transaction can begin and an error is thrown.

Solution:

Subclass Error and catch the specific transaction error at the
appropriate time to cancel the second order.

Note that the problem does not occur in a not grouped kanban view
because the hook useSortable prevent asking again a resequencing via
a proper management of the class o_record_draggable. That class is also
used in the grouped case but a rendering of the kanban view takes place
possibly before the end of the transaction: the record is moved in any
case to the targeted column and moved back if the overall operation
fails for some reason.

closes odoo/odoo#95235

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-06 17:10:20 +02:00
Aaron Bohy e7750dce2a [FIX] web: support force_save attribute on fields
In an x2many sub view, the attribute "force_save" on a field
indicates that the field value must be saved, even if the field is
readonly. Before this commit, this attribute was ignored by the
new views. In the BasicRelationalModal, we only needed to propagate
this attribute to the fieldsInfo given to the BasicModel. In the
RelationalModel, we needed to take the attribute into account.

closes odoo/odoo#95396

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-06 13:11:42 +02:00
FrancoisGe f1856cce24 [FIX] web: Adds missing placeholders to fields with an input
This commit adds the ability to pass a placeholder to all fields
containing an input.

This commit tests the ability to use a placeholder in all fields
containing an input.

closes odoo/odoo#95309

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-06 10:36:28 +02:00
Bruno Boi 8eaddda496 [FIX] web: field translate button unapplied style
Before this commit
There is  an issue about the translatable field button not properly
shown.
A translatable field <input/> or <textarea/> should have a right padding
in order to ensure its text content does not go behind the translate
button.

After this commit
Existing style regarding this is reapplied.

Part-of: odoo/odoo#94952
2022-07-05 17:32:51 +02:00
Bruno Boi 25e1b12f49 [FIX] web: traceback on focus empty kanban from the control panel
Before this commit
On an empty kanban having a record in quick creation, if a user manage
to give the focus somewhere inside the bottom-left zone of the control
panel (or inside the searchview input) WITHOUT closing the form of the
record in quick creation, and then press the ArrowDown key on its
keyboard, a traceback appears.

How to reproduce?
- i.e. go to "Social Marketing > Campaigns"
- change the filter to show no records
- click on create
- make the record dirty BUT invalid (no value for the Responsible field)
- click on the search input
- press arrow down
- => traceback

After this commit
The traceback is not shown anymore because the kanban renderer makes a
safer check before trying to focus a kanban card.

Part-of: odoo/odoo#94952
2022-07-05 17:32:51 +02:00
Bruno Boi ebcecf74c6 [FIX] web: missing t-attf-class part for ViewButtons
Before this commit
When defining a view button in some view arch, the combination of its
class attribute with a `t-attf-class` is not correctly handled.

After this commit
This is fixed.

Part-of: odoo/odoo#94952
2022-07-05 17:32:51 +02:00
Bruno Boi 683c29c43f [FIX] web: kanban in the quick create style issue
Before this commit
The quick create form view uses the new wowl form renderer, but
with the CSS style of the legacy form view.
This led to some issues, i.e. the width of some input fields
were ridiculously small.

After this commit
The quick create form view still uses the new form renderer, but with
the proper class "o_wowl_form_view" to ensure the proper style is
applied.

Part-of: odoo/odoo#94952
2022-07-05 17:32:50 +02:00
Mathieu Duckerts-Antoine 8359337a6c [FIX] web: kanban: "muted" already in progress bar colors
Problem:

In a kanban view with progress bars, have
 - a record with a false value for the progress bar field
 - "muted" be the color of a progress bar field value different from false
a crash occurs.

This happens because no fallback is found for value = false in
findProgressValueFromRecord.

Solution:

Always add a bar for the value false (as it was the case before).

closes odoo/odoo#95215

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-05 12:42:28 +02:00
Aaron Bohy e37a663b52 [FIX] web,*: kanban: support t-set defined outside cards
*base, event, hr_holidays

Before this commit, `<t t-set/>` nodes declared outside the main
div of a kanban card where ignored by the kanban compiler. This
commit fixes that issue. To do so, we refactor a bit the way the
compiler and KanbanRecord handle multiple root cards (typically,
several roots with a t-if/t-elif/t-else, s.t. there's a unique
rendered root), by removing the faulty logic from the compiler
that identified card root nodes (and filtered out t-set nodes),
and introducing a div for the KanbanRecord component on which we
can set classNames, attributes and handlers.

The issue could be observed on the Apps kanban view, as it
displayed the "Install" button, whether the app was already
installed or not.

closes odoo/odoo#95211

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-05 11:35:16 +02:00
luvi 42eb0f6656 [FIX] web: ImageField zoom and preview_image options
This commit fixes the behavior of the tooltip
enabled by the zoom option which displays
the full image when the field is hovered.

Before the commit, the preview_image option was
not used by the field and the full value was used
for both the field image and the tooltip.

A test has been introduced to check that the
field uses the right images sources when both
attributes are present.

closes odoo/odoo#95208

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-04 15:24:11 +02:00
Mathieu Duckerts-Antoine 1d23ebf95e [FIX] web: search model: groupBy not in searchMenuTypes
The search model should always return [] as groupBy if searchMenuTypes
does not contain "groupBy". This allows a kanban view (for instance) to
define easily that it should not never be grouped.

closes odoo/odoo#95179

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-04 14:08:12 +02:00
Romeo Fragomeli f773ba8a51 [FIX] web: missing/linting ending square brackets
Interrestingly enough, those missing ending square bracketsdoesn't have
consequences on the way the browser interprets these attribute
selectors... Anyway, for consistency sake, let's close them properly.

closes odoo/odoo#95070

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-07-04 14:08:04 +02:00
Géry Debongnie 74965b6298 [IMP] web: delay showing loading indicator by 250ms
Before this commit, the loading indicator is shown immediately after
each network request.  But this is distracting, and may cause an
impression of slowness, since it shows that the web client is working.
However, the feedback is very useful.

So, it has been decided that we would only display the loading indicater
after a delay of 250ms. All requests shorter than that duration will
just not show anything.

closes odoo/odoo#95037

Task: 2900450
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-04 14:07:54 +02:00
luvi 1c0c7a30f2 [FIX] web: ProgressBarField behavior and edition in kanban
This commit fixes some inconsistencies of the progressbar
field widget since it was converted to Owl. Some behaviors
were wrongly adapted and edition was not enabled in kanban
views. It was also missing an option to allow editing the
field value in readonly mode.

closes odoo/odoo#95033

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-04 10:19:36 +02:00
Julien Mougenot 3a5f94bff5 [FIX] web: Properly support subtemplates in kanban
Before this commit, subtemplates in kanban did not share the same
ViewCompiler instance, thus losing the aggregation of the dropdowns.

Now, a single ViewCompiler is used for each KanbanRecord, properly
taking into account dropdowns declared in subtemplates.

closes odoo/odoo#94977

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-01 16:35:55 +02:00
FrancoisGe 7bbe1f3caf [FIX] web: fix id BooleanToggleField in KanbanView
In the new Kanban view, clicking on a BooleanToggle field (on any card)
always toggles the field of the first card. We would like to toggle the
field of the card that is clicked on.

This is because the same id (fieldName) is used for all Checkbox
in the BooleanToggle. If you click on a label, its native behaviour is
to click on the input with the same id. In our case, this will always
create a click on the first ToggleBoolean (the first card).

The solution is to make the id passed to the field unique. To do this,
we will add the datapointID to it.

Before:
Card 1: id = fieldName
Card 2: id = fieldName

After
Card 1: id = fieldName_datapoint_1
Card 2: id = fieldName_datapoint_2

closes odoo/odoo#94966

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-01 16:35:52 +02:00
Lucas Lefèvre 579486a034 [FIX] web: consistent capital letters in domain selector
"All" is capitalized but not "records".
It should be consistent: either all capitalized, none, or only the first word

closes odoo/odoo#94963

Related: odoo/enterprise#28990
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-06-30 18:52:37 +02:00
Mathieu Duckerts-Antoine dc6834b216 [FIX] web: list: save list orderBy in favorite
When creating a favorite in a (new) list view, the list orderBy (if any)
was not saved with the favorite. We fix that.

Part-of: odoo/odoo#92475
2022-06-30 09:29:50 +02:00
Mathieu Duckerts-Antoine 8279607488 [FIX] web: list: keep list orderBy when (un)grouping
When (un)grouping a (new) list view, the list orderBy (if any) was not
kept. We fix that.

Part-of: odoo/odoo#92475
2022-06-30 09:29:50 +02:00
Julien Mougenot 2b7f497442 [FIX] web: Support multiple dropdowns in kanban
This commit allows multiple declarations of a dropdown menu in a kanban
card to generate a dropdown component for each definition.

Part-of: odoo/odoo#92475
2022-06-30 09:29:49 +02:00
Aaron Bohy 6cdd91b614 [FIX] web: kanban: add JSON to the rendering context
In legacy kanban views, one could use JSON in the arch to, e.g.
parse text field values encoding data. This was no longer the case
in the new implementation. This commit fixes the issue by adding
it to the kanban record rendering context. However, we'll consider
adding it in owl directly.

Part-of: odoo/odoo#92475
2022-06-30 09:29:49 +02:00
Mathieu Duckerts-Antoine a5bfa26692 [FIX] web: kanban: attributes of card dropdowns
Some attributes of the elements determining the "ellipsis" dropdown menu
of a kanban card were invalidly reported on the main Dropdown node
created during the compilation. This could cause crashes (during the
props validation) or broke the CSS.

In this commit:
    - we fix the above mentioned problem
    - we put the class o_drowdown_kanban on all "ellipsis" dropdowns
      generated by the kanban compiler in order to get the appropriate CSS
    - we make sure that those dropdowns are visible in kanban dashboards
      by default

Part-of: odoo/odoo#92475
2022-06-30 09:29:49 +02:00
Julien Mougenot 5d0a28d0f5 [FIX] web: Fix KanbanCoverImageDialog
This commit removes the SimpleDialog class and adapts the
KanbanCoverImageDialog to use the Dialog component instead.

It also makes sure that the KanbanCoverImageDialog uses the FileInput
component to use a more centralized way of calling the HTTP
'upload_attachment' route.

Part-of: odoo/odoo#92475
2022-06-30 09:29:49 +02:00
Julien Mougenot 38710465a9 [IMP] web: Update to FileInput API
This commit changes the prop names of the FileInput component to bring
them in line with the current naming conventions. Also the default
route has been changed from '/web/binary/upload' to
'/web/binary/upload_attachment' since the latter is used more often.

Part-of: odoo/odoo#92475
2022-06-30 09:29:48 +02:00
Jorge Pinna PuissantandXavier BOL 7e86933d94 [FIX] web: evaluate string domain in modifiers
Before this commit, in `getModifier` method when a modifier contains a
domain in a string, the domain is not evaluated and just converted into
a boolean value that is if the string is not empty then the method will
return `true` and `false` otherwise.
Also, the `applyInvisible` method does not take into account an invisible
domain in a string. That is if the `invisible` variable contains a domain
in an `Array` then  the domain is evaluated otherwise the domain is
considered as a boolean value.

This commit checks if the modifier contains a boolean value as value to
evaluate it as a boolean and return it otherwise the modifier value is
returned in the `getModifier` method.
In the `applyInvisible`, this commit allows to evaluate the domain if
the domain is containing in a string.

Part-of: odoo/odoo#92475
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
2022-06-30 09:29:48 +02:00
Samuel Degueldre 0e6481f359 [FIX] web: add support for kanban-tooltip in kanban arch
This commit re-adds support for the kanban-tooltip template in kanban
view arch, to do this, it also refactors the tooltip service to give it
a programmatic API, so that we are not constrained to only giving
tooltip info in serialized form, but can instead give the same context
to the tooltip template as to the kanban record's template.

One current limitation is that components that are available in the
kanban record cannot be used in the tooltip, as these are mostly used
for interactive content and one cannot interact with the contents of the
tooltip, we have decided to not work around this issue until needed.

Part-of: odoo/odoo#92475
2022-06-30 09:29:48 +02:00
Samuel Degueldre a7be88cd91 [REF] hr_contract, web: give tooltip info as t-call-context
Previously, we would use t-set to add the tooltip info under the key
"info" in the rendering context, while this works fine, it was mostly
just a workaround for the lack of support in owl for passing a rendering
context to be used by the t-call directly. Since this is now supported
in owl, the commit uses this feature for the tooltips and adapts the
call sites.

Part-of: odoo/odoo#92475
2022-06-30 09:29:47 +02:00
Mathieu Duckerts-Antoine be8472c851 [FIX] kanban: click outside of a quick create record
When on click outside of a quick create record, one wants
    - to remove the quick create record if it is not dirty
    - not to remove it if it is dirty with some exceptions:
        if the click is on a "Create", "Load more" or "+" (quick add) button

This fix makes the external listener of KanbanRecordQuickCreate work as
expected.

Part-of: odoo/odoo#92475
2022-06-30 09:29:47 +02:00