Before this commit, formatters like `formatMonetary` and `formatFloat`
weren't loaded in the assets front-end.
This commit introduces `formatAmount` ( `formatMonetary` calls
`formatAmount` but makes some prior processing to deduce the currency
from the field) and makes `formatAmount` and `formatFloat` accessible
from any front-end application.
Note: The currencies were added in the front-end session info because
they are needed in `formatAmount`.
closesodoo/odoo#133824
Related: odoo/enterprise#46658
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
When a dialog is closed, the focus is meant to be restored to the
previous focused element.
Before this commit, it did not work for the ConfirmationDialog when the
confirm button was clicked. This was because the focus was lost **before**
the dialog was closed (because the confirm button is disabled when
clicked), and thus the previous focused element was not in the el of the
dialog anymore, and thus the focus was not restored.
closesodoo/odoo#134456
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Commit 80f8281 introduced an unwanted padding on the right in
`o_list_selection_box` on large screen.
This commit adapts the spacing of this element to maintain the same
rendering whatever the screen size.
task-3454841
closesodoo/odoo#134384
X-original-commit: ed29d31ab7bb8d697c6515f3383a8b687f486e8e
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
This commit ensures that when the user opens a calendar view in day or
week mode the view will be scrolled so that 6am is at the top of the view.
task-3460517
closesodoo/odoo#132288
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
The goal of this task is to help user manage their sale_order
by having a summary view of all their next activities.
Sale calendar view is now based on the next activity for each
sale_order.
closesodoo/odoo#132287
Task-id: 3463325
Related: odoo/enterprise#45945
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
This commit change the name of the option noReload to reload, this is to
avoid having negative variables names for boolean. This is a general
known best practice, and in this case it's important to have a better
readability of the code (specially when a negation of a negative
variable occurs).
closesodoo/odoo#134317
Related: odoo/enterprise#46913
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Be in an ungrouped list or kanban view. The "limit" number of
records is displayed (by default 80). Apply a group by. The same
limit is applied for the number of groups, whereas there's a
specific parameter ("groups_limit") for the number of groups to
fetch and display. The same problem occurs the other way around
(going from grouped to ungrouped), as in this case the groups_limit
is kept when the view is no longer grouped.
This commit fixes the issue by forcing a reset of the limit when
we go from grouped to ungrouped and from ungrouped to grouped.
We also add a test to ensure that the "groups_limit" is taken into
account even when there're multiple groupbys, which wasn't the
case in previous versions, but which is working as expected with
the new model.
closesodoo/odoo#134253
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Before this commit, performing a search in a Many2manyTagsAvatarFields
and selecting an element does not remove the search value from the input.
Why not?
The value passed to Autocomplete is the default ''.
As this value never changes, onWillUpdateProps is never called and cannot
empty the input.
Solution:
Use the resetOnSelect option to force the input to be reset at each select
if props.value is the default value.
closesodoo/odoo#134242
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The goal of this commit is to allow relatedFields to be added to a one2many
field using a sub-view.
Before this commit, if an x2many custom contains a sub-view and relatedFields,
we ignore the sub-view and use only the relatedFields.
Now we're going to add the relatedFields to the fields/activeFields
defined in the sub-view.
Use case:
Created a custom x2many field dependent on the 'display_name' of
a many2one field that should not be present in the sub-view. For example,
to simulate a groupBy on this many2one field.
closesodoo/odoo#132351
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
**Before this commit**
In order to add a new entry in the KanbanHeader config dropdown,
one has to extend the xml template.
**After this commit**
A registry has been added, easing the job to add entries in this menu.
Task-3085360
Part-of: odoo/odoo#114352
Current behaviour:
When clicking on a note containing
multi-line text, the textarea shrinks
Expected behaviour:
Note should show whole text
Steps to reproduce:
1. Install sale_management
2. Head to Sales > Quotations
3. Click on any quotation line
4. Click on "Add a note"
5. Input multi-line text
6. Click on the "Save manually" button
7. Click again on the note
8. Note is omly one character tall
opw-3457234
closesodoo/odoo#134231
X-original-commit: 061430f1430723d719230796774cf4efab8aa348
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
=== ISSUE 1 ===
Prior to this commit, there was a missing padding on the
`o_list_selection_box`.
=== ISSUE 2 ===
On mobile, Cog and Print icons had no margin and were stick next to
their label.
This commit fixes these issues.
task-3454841
Part of task-3326263
closesodoo/odoo#134219
X-original-commit: 80f82816b17d32efbf4cbe4a1956b2457eac8ad9
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
In [1], a new python function was introduced that allows to save and
read in one rpc. This commit, adds the possiblitity to read another
record in the same rpc call. This is particularly useful when you want
to save and read the next record (for instance on a pager).
1: ebd538a194
Task-id : 3453184
closesodoo/odoo#134125
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
As the Activity button (clock icon) is the same kind of action
it make sense to apply the text-muted on the quick assign.
To make the hover clearer we apply a text-dark on hover using the
btn-link + contextual classes function. We apply the same to the
`subtask_list_button` and milestones for consistency.
task-3382159
closesodoo/odoo#134196
X-original-commit: 4b8b6e2155eca66652b4a57dfff27b0e81d62573
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Have a form view with a one2many field (e.g. displayed as a list)
containing itself an x2many field (e.g. many2many_tags), with a
dynamic context depending on the parent record (see the test for
a specific situation).
Before this commit, the dynamic context on the inner x2many wasn't
correctly evaluated, because when we evaluated it, the parent
evalContext hadn't been computed yet (they were computed bottom-up)
when the datapoints were created.
With this commit, we wait for all datapoints and evalContext to be
properly set up before evaluating the static list dynamic contexts.
closesodoo/odoo#134160
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
The purpose of this commit is to add the alwaysApply option to useDebounced.
This option is used to force execution of the callBack if the debounced
function has been called and is still not resolved when the component is destroyed.
closesodoo/odoo#134096
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This partially reverts commit da50ce31ae825ef9f4b527553a2e2caec970d290.
Whilst the behavioral changes done in the task are correct, the wording
is not optimal and was better understood by users before this change.
Task-3483936
closesodoo/odoo#133511
Related: odoo/enterprise#46503
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
This commit changes the way we define recurrences from the UI so it's simpler.
Instead of showing the user many options for recurrence like we currently do,
we add a selection field for each rrule (daily, weekly, monthly and yearly)
that sets some default values for the recurrence without the user having to
define each field manually. This change makes the definition of recurrence from
the UI closer to what is done in google calendar. In order to allow users to
define more advanced types of recurrence, we also add a custom option in the
new selection field that will show the old recurrence options to the user.
Additionally, the week days widget defined in web takes too much space, so it
was decided to create an overwrite of this widget for calendar only that looks
cleaner and takes less space. This commit introduces this new widget and
applies it to the calendar event form view.
task-3234677
closesodoo/odoo#116649
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Purpose:
--------
This commit adds QUnit tests for the `useNestedSortable` hook.
This commit also fixes a few issues in the hook that were pointed out by
adding these tests, notably:
- the moves are now triggered based on the position of the top of the
dragged element instead of the position of the cursor (behavior was
unclear when moving long elements)
- when nesting is allowed, moving an element under another one that does
not have nested elements now inserts the placeholder after the element
instead of nesting it inside of it.
It also renames the `listType` parameter to `listTagName` to make its
purpose clearer, and moves the placeholder styling to a custom class so
that it can be customized more easily.
Task-3422012
Part-of: odoo/odoo#131769
Purpose:
--------
The `useSortableList` hook introduced to replace the usage of the jquery
library nestedSortable in knowledge sidebar is suitable for the sidebar
in documents, which currently does not allow to move a folder between
other folders.
The hook is moved to web so that it can be used in both modules
Task-3422012
Part-of: odoo/odoo#131769
Iusse:
======
When you update a chatbot a line and then save the chatbot form it will
throw an error.
Steps to reproduce the error:
=============================
1-Go to Live Chat/configuration/Chatbots and select one
2-update one line in the script (add some letters in one name)
3-save the chatbot form
Problem:
========
Some fieldName doesn't exist in the list of fields.
Solution:
=========
Swapped the values in the assign in duplicateDataPoint.
opw-3454514
closesodoo/odoo#134024
X-original-commit: 4ce57085b302957e2c260183f05f534160fa7ea4
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
**Changelog**
**3.4.2 (2023-08-26)**
- Fixes regression from 3.4.1 (moment/luxon#1493)
**3.4.1 (2023-08-23)**
- Fixes for regressions from 3.4.0
(moment/luxon#1482 and moment/luxon#1488)
**3.4.0 (2023-08-08)**
- Fix type checking on input zones
- Fix Islamic months listing
- Fix normalize() for negative inputs
**3.3.0 (2023-03-03)**
- Fix off-by-one in Interval#count (moment/luxon#1308)
- Support formatting for custom zones (moment/luxon#1377)
- Fix parsing for narrow spaces (moment/luxon#1369)
- Handle leap year issue with AD 100 (moment/luxon#1390)
- Allow parsing of just an offset
**3.2.1 (2023-01-04)**
- Fix for RFC-2822 regex vulnerability
- Better handling of BCP tags with -x- extensions
**3.2.0 (2022-12-29)**
- Allow timeZone to be specified as an intl option
- Fix for diff's handling of end-of-month when crossing leap years
(moment/luxon#1340)
- Add Interval.toLocaleString() (moment/luxon#1320)
**3.1.1 (2022-11-28)**
- Add Settings.twoDigitCutoffYear
**3.1.0 (2022-10-31)**
- Add Duration.rescale
**3.0.4 (2022-09-24)**
- Fix quarters in diffs (moment/luxon#1279)
- Export package.json in package (moment/luxon#1239)
**3.0.2 (2022-08-28)**
- Lots of doc changes
- Added DateTime.expandFormat
- Added support for custom conversion matrices in Durations
closesodoo/odoo#133599
Related: odoo/enterprise#46556
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
As tempusdominus relies on jQuery, we have written our own date(time)
picker in owl. This commit converts the remaining uses of the
tempusdominus date(time) picker and replaces them by our own.
closesodoo/odoo#133349
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
This commit improves the support for time in the datetime picker by
doing two things:
- allow to pick seconds by giving a rounding value of 0
- check minDate and maxDate by accounting for the time when the picker
is in datetime mode instead of only checking the date
Part-of: odoo/odoo#133349
This commit, adds a new python method (`web_save`) to save a record, and
optionally read-it again in one rpc call. This optimizes the current
behavior that is to save a record in one rpc, and read-it in a second
rpc.
web_save, will receive the list of IDs of the records to save (if this
list is empty it will create the records, if not, it will write on the
existing records), the list of changed fields, and the unity
specification as optional argument to read the created/modified records
(if the specification is not set, the function will return a list of IDs
of the created/modified records).
closesodoo/odoo#133021
Task-id: 3453184
Related: odoo/enterprise#46559
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In dashboard configuration, when you click on file of 'Data' section in
debug mode to edit, icons were duplicated.
This commit fixes the issue by getting rid of the same icons in
overridden template `web.ListBinaryField` from `binary_field.xml`
in order to remove icon duplicacy.
Additionaly, this commit removes unnecessary `<i>` tags and alters the
classes of `<button>` tags instead, to maintain the visual appearance
of icons (now they look the same as everywhere else).
Task ID : 3453198
closesodoo/odoo#134005
X-original-commit: 850e16cc415486507d1984ea08a04140ffba7c61
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
The purpose of this commit is to make fieldDependencies are readonly by default.
This avoids making fields unintentionally editable. If the field is editable,
it will be sent during create/write, which is what we want to avoid.
Use case:
Go to a form view with 2 fields "a" which is readonly and "b" which has
"a" as fieldDependencies.
Before this commit:
Record Datapoint thinks that field "a" is editable
After this commit:
Record Datapoint thinks that field "a" is readonly
closesodoo/odoo#132247
Related: odoo/enterprise#46691
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Previously, if you specified a min or max date for the datetime picker
and zoomed out to the month/year/decade view, it would disable some
months/year/decade incorrectly, this was caused by the code checking if
the beginning of the period was in the min-max range instead of checking
if the period had any overlap with the min-max range.
This commit fixes that by checking for overlaps instead.
closesodoo/odoo#133911
X-original-commit: 7cb61dca99be4b0a1c35f0ec762c1bda318ec043
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This utils also exists in /core/utils/strings and the legacy
version was no longer used. Also remove the diacritics map which
is heavy.
closesodoo/odoo#133896
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Before this commit, all python expressions in js were evaluated with
the same evalContext. Unfortunately, this is not possible for expressions
based on an x2many. The value of the x2many depends on whether the
expression will be sent to the server or not.
All expressions that are only used client-side, such as modifiers (readonly,
required, invisible), decorations, etc., must take virtual records into account.
For example, I define a button that must be visible when I have at least
one record in my x2many. So when I create my virtual record, I want
the button to become visible and not have to wait for the record to be
actually created.
For expressions sent to the server, such as domains and contexts,
we don't want them to take virtual records into account, as these are
not known by the server and could cause crashes.
Solution:
We have evalContext for expressions sent to the server
and evalContextWithVirtualIds for client-side expressions.
closesodoo/odoo#133718
Related: odoo/enterprise#46604
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
`waitForCondition` is written in a rather old style with a recursive `setTimeout` to handle the delay / debounce between checks. The code is rather hard to follow, and unnecessarily so: the code can be rewritten as an iterative async function which is a lot simpler.
Important change: `waitForCondition` now immediately checks for the condition instead of waiting `interval` milliseconds before doing so.
This is because the conventional usage is for it to be preceded by an `await triggerClick`, which includes an `await
waitForNextAnimationFrame()`. As a result there are good odds the click has already been processed by the time `waitForCondition` runs.
closesodoo/odoo#133645
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
In this commit, current date is added in control panel breadcrums for calendar
week and calendar month views and this only for mobile screens.
If a week straddles two months then the two months are included in the wording
but in shortcuts (Aug-Sep 2023). In all other cases, the entire month and year
are included in the label (August 2023).
Task-3439201
closesodoo/odoo#133633
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
Versions:
---------
- saas-16.3
- saas-16.4
Steps to reproduce:
-------------------
1. go to a list view which starts with a numerical value;
- e.g. with developer mode enabled:
Settings > Technical > Scheduled Actions
2. group by any element.
Issue:
------
The width of the `o_group_name` elements is around 40px, not enough for
the names to be displayed.
Cause:
------
`list_renderer.js` calculates the `colspan` of `o_group_name` elements
based on the first occurence of a value that can be aggregated, i.e.
any numerical value. If this happens to be the first column, the
`colspan` is set to 1, leading to their width being the same as the
first column containing checkboxes. An update in saas-16.3 had forcibly
set these to 40px by adding the `!important` rule:
```scss
.o_list_record_selector {
width: 40px !important; // Force to 40px regardless by the font-size
}
```
Solution:
---------
After consulting the person who introduced the rule, we agreed that
removing it would be the easiest fix, unlikely to introduce any new issues.
opw-3459598
closesodoo/odoo#133521
X-original-commit: c89c94192685c989b65eb6b483b4120aa312252c
Signed-off-by: Levi Siuzdak (sile) <sile@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
luxon and moment are both used in the solution, but these two libraries
facilitate the manipulation of dates. It was decided to replace all uses of
moment with luxon so we can then remove moment.js from the code and lighten
the assets.
task-3391739
closesodoo/odoo#133144
Related: odoo/enterprise#46447
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
This function became useless at some point, after the views and
actions have been all converted to owl.
closesodoo/odoo#133699
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
*project,spreadsheet
The unity version of web_search_read will soon replace the older
one, so this commit prepares the work by adapting the remaining
calls to web_search_read s.t. they call unity_web_search_read
instead.
Part-of: odoo/odoo#133617
Before this commit, many2one values were still returned as pairs
of id and display_name by unity read, whereas they should be
objects with keys id and display_name.
Part-of: odoo/odoo#133617