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
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
This commit fixes a race condition that makes several tours crash.
The reason is that the underlying record is removed from the model
which produces a re-rendering. At the end of that re-rendering,
a component is unmounted. At that point, we remove an handler
relying on the existence of the record. As a consequence, there
was a short time window during which the handler would crash if it
was called.
Part-of: odoo/odoo#92475
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>
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
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
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
The call to web_read_group done in _loadGroups was incorrect when the first groupby
was of the form date_field:granularity (e.g. "create_date:day"). The groupby was
sent as a mesure and interpreded as such, leading to an error of the form
"Invalid aggregation function ...".
This was not detected before by lack of manual testing: the mock server used in tests
checks the read group parameters in a different way from what is done server side.
So the error was not visible in the testing environment.
In this commit, we remove the error in web_read_group and improve the mock server
(a bit) so as to make such errors be detected.
Part-of: odoo/odoo#92475
The kanban view is not supposed to be grouped by more than one groupby.
In this commit, we make sure that the param groupBy is correctly process at
the first level to only keep the first groupby (if any)
Part-of: odoo/odoo#92475
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
With this commit, if the user types something in a numeric field
input that doesn't match its localization, we try to parse it with
the english localization. If it works, we considerer that value.
Otherwise, we throw an error.
al request
Part-of: odoo/odoo#92475
This commit rewrites the board action in owl. Legacy actions are
still supported inside this new board thanks to a compatibility
layer.
Part-of: odoo/odoo#92475
This commit refactors the way actions restore their scrolling
positions (when coming back). By default, in desktop, we want the
o_content div of the action to scroll. In mobile, we want the
whole action to scroll (including the ControlPanel). With this
commit, the logic is handled at the concerned level: in the
action hook for the desktop case, and in the action service for
the mobile case.
Part-of: odoo/odoo#92475
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).
It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...
Part-of: odoo/odoo#92475
This commit contains several adaptations of the Layout, WithSearch,
ControlPanel and its children components with respect to the
conversion of kanban, list and form views in owl.
In a nutshell:
- ActionMenus: we didn't have an implementation yet, as already
converted views do not need it.
- ControlPanel: allow to move the focus from the search bar to
the view and vice-versa + slight rework of the template to
properly handle hidden areas.
- CustomFilterItems: adapt to formatter/parser changes.
- Layout: hide breadcrumbs in dialogs and allow to move control
panel buttons in the footer (in dialogs as well)
- WithSearch: only pass search props to the underlying view +
take its content in a default slot
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>
This commit adapts the (form) view debug items to make them work
with the new owl kanban, list and form views, and to make them
use the new owl SelectCreateDialog.
Part-of: odoo/odoo#92475
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>
This commit is threefold:
1) it improves the style of tooltips (mostly, a larger font size)
2) it adds an option, `data-tooltip-delay` that allows to specify
the delay before the tooltip opens
3) it handles the case where the tooltip is empty (no tooltip
displayed)
Part-of: odoo/odoo#92475
This commit adds two options to the hotkey service to improve its
usability in some cases:
- `area` which is a function that returns an HTMLElement that restricts
the operating area for an hotkey registration
- `validate` which is a function that returns a boolean that tells if
the hotkey registration's callback should be called or not
Some typings adaptations were made in:
- @web/core/commands/command_palette
- @web/core/commands/command_service
- @web/core/utils/ui
Part-of: odoo/odoo#92475
1) Force the cursor: pointer for dropdown items containing a
checkbox (e.g. optional field dropdown in list views)
2) Always stop click events in dropdown togglers as they are
handled
3) Add a test for the "tooltip" props
Part-of: odoo/odoo#92475
This commit introduces a ColorList component which allows to
choose a color from a list. There are several usecases for such
a component in Odoo (e.g. ColorPicker, Many2ManyTags, KanbanRecord).
Part-of: odoo/odoo#92475
This commit introduces the DomainSelector and ModelFieldSelector
components. They will especially be used by the owl DomainField.
Part-of: odoo/odoo#92475
This commit introduces a Notebook component, which displays tabs
and an active page. The component is configurable to display the
notebook vertically (e.g. form views) or horizontally (e.g. kanban
examples dialog).
Part-of: odoo/odoo#92475
This commit introduces an AutoComplete component, which displays
an input and reacts to input events to display a list of suggestions
in a dropdown. The main usecase for this component is the Many2One
field.
Part-of: odoo/odoo#92475
This hook offers an alternative to jQuery UI sortable and
draggable. It's a step in the way to removing jQuery UI. This
hook will be used by the new owl list and kanban views.
Part-of: odoo/odoo#92475
By passing "animationFrame" as delay value, the debounced function
will be called just before the next animation frame following the
moment if has been effectively called.
Part-of: odoo/odoo#92475
This commit is two-fold:
1) events triggered with jQuery do not go through the native
layer, so if an handler has been bound natively, it won't be
called. Since our new code no longer uses jQuery, this caused
issue in some tours.
2) this commit explicitely logs the failing step when a tour
crashes, which helps debugging.
Part-of: odoo/odoo#92475
Before this commit, opening a notification with the className
option would result in a notification being displayed without the
given className. That className was overriden by the transition
className. This commit ensures we keep all classNames.
Part-of: odoo/odoo#92475
In the wowl codebase, we use luxon instead of moment to manipulate
dates. Moment was able to parse dates with short notations (e.g.
08/15/22 for the format MM/DD/YYYY). Luxon is more strict and does
not support those cases (the format must be perfectly respected).
As a consequence, moving from moment to luxon would introduce a
regression in our date and datetime fields. This commit implements
the same kind of logic as what is done in moment, in our date
parsers, such that those cases are handled.
Part-of: odoo/odoo#92475
This commit ensures that keys in the hash or querystring in the url
is URI encoded. Moreover, it properly handles the case where a
value in the hash is falsy. Before this commit, if a value, say "x",
was falsy, it resulted in the url in "x", which produces a crash
when decoding. With this commit, it generates "x=" in that case.
Part-of: odoo/odoo#92475
Steps to reproduce:
- Create an accural plan with two levels, the first should have
its action_with_unused_accruals set as lost. The second should
start one year after the first level.
- Use this plan on a employee and make it start the first day of
the previous year.
Current behavior:
The number of allocated day is wrong and can even be negative
Expected behavior:
The days of the first level are lost and there is the right amount
of allocated days,
Eplanation:
The _end_of_the_year function was first designed to be only called
on the first day of the year but the it changed since then without
updating it's content and it can calle any day of the year now. In
this case the use of today() does not make sense and it should be
replaced by the first day of the current year.
opw-2868297
closesodoo/odoo#94897
X-original-commit: 476818972e93b32df6f25cf299f631a8f7eb3af4
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
It could happen that there are other objects than stock.move linked to
the manufacture order. This is currently creating an error when
concatenating the objects. As we are only keeping stock.move objects to
log the exception on those, we should filter them before the concatenate
operation to avoid the error.
closesodoo/odoo#94893
X-original-commit: 1cdb682163e24fc01677cdcd0e1b83592443fffc
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
Co-authored-by: vancleeff <mvw@odoo.com>
PR #75535 introduced trusted devices, but only made them visible in the
main user form (for admins) and in the portal.
It's quite useful for users to be able to view and manage their trusted
devices in their own user preferences as well.
This commit add them in the "Account Security" of the user profile.
In addition:
- improve the layout of the trusted devices by wrapping them in a
<group> to have them stand out from the surrounding prefs
- move the "Account is protected" label about the trusted devices, and
under main the 2FA toggle button, where it's supposed to be.
- removed the custom form view for trusted devices inside the one2many.
The point was to hide the extra `scope` field, but it's not worth it,
and the Cancel button wasn't even working, the default form view is
better.
- improve the confirmation message of the "Revoke All" button when it's
located on the user management form (for admins) to clarify that it's
not the admin's devices that will be revoked.
- change the 2FA label from "Your Account is protected" to "This account is
protected" when located on the user management form for admins.
Note: this is a manual partial fwd-port of #94111, as this part was
mistakenly dropped in the fwd-port chain at #94193closesodoo/odoo#94869
X-original-commit: d3a7910788ceff856fc6a843876579d379ce9caf
Signed-off-by: Olivier Dony <odo@odoo.com>
*: sms, snailmail.
The createThreadViewComponent helper was used during tests to mount
a thread view component and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient so that the thread view
component can be mounted in its real environment.
task-2871066
closesodoo/odoo#94691
Related: odoo/enterprise#28954
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit
When the user hit ctrl+k on a mass mailing, no command palette nor link
dialog was opening.
This was due to the fact that the hotkey service would not react
to hotkeys being pressed from inside of an iframe element.
After this commit
One can now register an iframe to the hotkey service to let it react
to hotkeys being pressed from within the registered iframes.
task-2738457
closes odoo/odoo#91102
Forward-port-of: #89940
Forward-port-of: #82994
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Whenever the user hit ctrl+k when being on an html field, both the
link dialog and the command palette opened.
In order to resolve the conflict, now ctrl+k open the command palette
with the first entry being the command to open the linktool and
a subsequent hit to ctrl+k when the command palette is open to open
the link dialog.
Task-2738457
Forward-port-of: #89940
Forward-port-of: #82994
Part-of: odoo/odoo#91102