Go to Project -> Reporting -> Timesheets and Planning Analysis and
select other measures in the pivot view via the "Measures" menu.
After that create a new favorite.
Result: the favorite is saved with the correct measures but the
pivot view will never use those measures. This is due to the presence
of the key "pivot_measures" in the action context.
(Note that the same problems occurs with other keys and other views)
We fix that problem by giving less precedence to keys in action contexts
with respect to those found in the search item contexts as it was
originaly the case in legacy views (cfr. __get method in action_model.js).
opw-2945969
closesodoo/odoo#99631
X-original-commit: 4528f562923cd0524f257f3a9c1ecd0002fd49b7
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- Name of the test
"utils > dates > parse smart date input"
- Before this commit
The test makes a comparison between the result of parse utils,
which yields luxon's DateTime objects in the user's local TZ
(patched by default to UTC+1 in the testing env), and locally
created DateTime objects in UTC.
This has no sense to compare a date in UTC with another in UTC+1.
The test was thus failing when ran between 11pm and 0am.
- After this commit
The test has been refactored.
Also, even if it has no impact on the parsing result, the local function
parseSmartDateInput now use a DateTime object in local TZ.
This has been done in order to avoid future confusion.
If you're wondering why it has no impact, it is because this function is
used in parseDate(Time), which always sets the local TZ at the end:
```
const a = {
foo: luxon.DateTime.local(),
bar: luxon.DateTime.utc(),
};
a.foo.equals(a.bar.setZone("default")); // true
```
closesodoo/odoo#99616
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the "+" icon was displayed in kanban columns
even if the attribute "quick_create" was set to false in the arch.
With this commit, we correctly takes that attribute into account.
closesodoo/odoo#99626
Signed-off-by: Samuel Degueldre <sad@odoo.com>
In kanban arch, one can set the attribute "on_create" on the root
node to an action xmlid. In this case, when the user clicks on
"Create", the action is executed. When this action is in target
new, it opens a dialog (typically to create a record...). Before
this commit, we didn't reload the kanban after closing the dialog.
As a consequence, the newly created record wasn't displayed. For
instance, it was the case in the Recruitement dashboard.
closesodoo/odoo#99589
Signed-off-by: Géry Debongnie <ged@odoo.com>
Go to a (OWL) list view with sample data, click "Create" to open a (OWL)
form view and go back to the list view using the breacrumbs: the sample
data has disappeared.
This is due to the fact that the form view set useSampleModel=false in
the globalState when it is left while it does not use at all sample data
mode.
Here we make it simply pass the value that it received initially.
closesodoo/odoo#99587
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
One can edit the color of a tag in a Many2ManyTags field only in form view.
This commit refactors that field so that the standard field Component doesn't allow for it,
and conversely implements a specialization of the field that can, and should be
selected by the form view.
closesodoo/odoo#99499
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
- Install Inventory
- Open any product
- Switch to RTL language
- Edit the product
- Try to translate field "Internal Note"
Issue:
Button is not displayed correctly (nearly hidden).
Issue also present with wysiwyg or codeview editors.
Cause:
Applying style `right: 5px` to the button without taking into account
if layout direction.
Solution:
On translate button:
- Apply direction left for side-space if RTL, else right.
- If wysiwyg is enabled, add it after the buttons in the sidebar.
opw-2962790
closesodoo/odoo#99567
X-original-commit: 56f620ff65ca9c1e5d9a64f5280ea16fd469c87d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit fixes the StateSelection field, which
displayed the wrong value on hover. In legacy, the title
attribute was set to display that value. Now, it has been
replaced by a tooltip, since it can be used with touch
and is more convenient to use. A test has been modified
to assert the presence of the data-tooltip attribute.
closesodoo/odoo#99561
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Steps to reproduce:
- Go to reconciliation models
- Click on Line with Bank Fees
- Click on a x2many line
-> The popup is missing some padding
closesodoo/odoo#99539
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The "beforeExecuteAction" of view buttons in the form view is set to
automatically save, so that when the user clicks a button which wil
change their current view, we ask them if they want to save their
changes.
In the case of the discard button, we don't want to ask the user if
they want to save their changes, but we don't want to save either. This
commit fixes that.
closesodoo/odoo#99530
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before, the input of the daterange field exceeded the size of its
parent, which caused an overflow and thus a visual bug in the form
and kanban view.
Now the daterange field is displayed as expected.
Step to reproduce the bug:
- Event > Quick create : the daterange is overflowing the parent
- Event > Create : the daterange is not displayed as expected
task-2967165
closesodoo/odoo#99495
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
The `daterangepicker` was in version 3.0.5, since then the library is
now in version 3.1.
This version introduce a new feature that allows to automatically
(depending on the space left) position the picker above or below
the HTML element it's attached.
This commit updates the library but also take advantage of this update:
Before when clicking on a daterange field, even if there was no space
left below, the picker was still displayed below the field.
Now, the picker is displayed above the field if there is less space
below the field
Part-of: odoo/odoo#99495
Have a many2one in an editable list view. Type something in the input and click
on "Create and edit".
Confirm the record creation in the modal.
Before this commit, the input of the field disappears.
After this commit, the input stays.
closesodoo/odoo#99480
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Time comparison can always be slightly random (this is why this test
is a nightly one). The 20% margin left by the 12 ratio is not enough
in all cases. This test was sometime breaking with a
12.944994188420822 not less than or equal to 12
This is one of the max value found by quickly checking the builds.
A ratio of 14 should be hopefully enough.
closesodoo/odoo#99156
X-original-commit: cc86b80342d38913f7af79474c41f8764c8b2dd2
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This commit improves cards and toggles designs and part of the overall
v16 SCSS optimization/restyle, task-2704984.
The default values of the cards wasn't consistant with the rest of odoo
(ie. default background color value was grey instead of the BS default
which is white) and to avoid these inconsistencies, the card classes
were not used (even though we do have card-like visual elements).
Before this commit, if we wanted to use them, we had to add utility
classes all over the place (ie. the 'bg-white' class) which is not
optimal.
This commit also simplifies toggle's visual rendering by removing
unnecessary graphical elements that were not readable in regular & small
font-size,
In some case the toggle design was even irrelevant with the content and
required unnecessary overrides in css to hide it (ie. it's ok in
Recruitment but not in Payroll).
task-2924487
closesodoo/odoo#98770
Related: odoo/enterprise#29829
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
With this commit, we use the new (owl) FormViewDialog instead of
the legacy one in the "View Metadata" debug item.
closesodoo/odoo#99532
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Since commit fbfc0dc63c that reworked the scss of the KanbanView,
the favorite icon in dashboards was no longer aligned with the
text (for instance, in the Project dashboard). This commit fixes
the issue.
closesodoo/odoo#99503
Related: odoo/enterprise#31033
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
In form views, we want the fields displayed in the "oe_title" div
to take full width. It worked before because we have a rule in
webclient that applies on all almost all kinds of inputs (text,
number,phone...). However, since we wrap fields in a div, those
rules no longer have the wanted effect in our particular usecase.
This commit is a heuristic, but it should solve most of the cases.
It applies on all char fields displayed as title.
Part-of: odoo/odoo#99503
This class is added automatically on large screens, to better
style the form view to benefit form the available space. However,
the width of dialogs is limited, so it makes no sense to apply
this classname in this case. If we do, those form views may display
an horizontal scrollbar. For instance: in project with worksheets
enabled, create and edit a worksheet many2one.
Part-of: odoo/odoo#99503
Before this commit, if the user multi-edited a field in a list
view, and the widget on that field was legacy, this widget was
displayed in edition in the confirmation dialog. This was because
the "mode" argument wasn't correctly computed in the legacy
compatibility layer. This fix comes with no test as this layer
will be removed in the next week or two.
Part-of: odoo/odoo#99503
Since the fields were rewritten in owl, they all have a width of 100% by
default, which is what we want when displaying a field on their own.
In some places, fields are used as part of a longer block of content (eg
unit of measure behind a number). In those cases, we want to display the
field inline, which requires the addition of the oe_inline class in the
arch.
There was also a missing piece of css for the monetary field, as the
previous rule no longer applied because of the slight changes to the DOM
structure.
closesodoo/odoo#99529
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Part of the overall v16 SCSS optimization/restyle, task-2704984
- Converts dropdown into "nav ul li" structure.
- Removing of '.o_burger_menu_user'
- Removing of '.o_burger_menu_app'
- Removing of '.o_menu_sections'
- Removing of '.o_burger_menu_section'
- Some 't-key' not necessary anymore (thx to OWL2)
task-2812594
Part-of: odoo/odoo#88073
Co-authored-by: Adrien Dieudonné <adr@odoo.com>
Before this commit, the `/web/static/tests/views/helpers.js` was only
imported in the "desktop" qunit test suite but unavalaible for the
mobile one.
This commit adds it in the `web.test_assets` bundle to be available in
all tests suites.
closesodoo/odoo#99498
X-original-commit: 2875f43da28d01f837c1ee53f8cadd21e169b612
Related: odoo/enterprise#31029
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Before this commit, `BooleanToggleField` and `BooleanField` are 2
distincts components. However, they are some attributes in common.
Also, there is an inconsistency between the both components, in the
boolean field, a `onChange` method is defined but not in the other one.
This commit changes the `BooleanToggleField`, this one will inherit to
`BooleanField` to have the attributes in common and override the ones
which are different. Also, the `onChange` method will exist in the
both components.
closesodoo/odoo#99492
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before in BS4, the table used the `$table-head-color` SCSS variable to
color the header of table. This variable doesn't exist anymore on BS5.
In the commit of the BS5's merge, we have replaced the old value by
a value calculated with the color contrast in the case of the list view
it wasn't the right fix, so in this commit we restore the original value
like it was before the merge of BS5.
Note:
In BS4 branch the result is `#212529`:
```scss
$o-gray-900: #212529 !default;
$o-main-headings-color: $o-gray-900 !default;
$table-head-color: $o-main-headings-color !default;
.o_list_view .o_list_table thead {
color: $table-head-color;
}
```
In BS5 branch the result is `#00000`:
```scss
.o_list_view .o_list_table thead {
color: color-contrast(opaque($body-bg, $light));
}
```
closesodoo/odoo#99488
Related: odoo/enterprise#31026
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Connect in your browser to a db on runbot with mail installed and wait
until the runbot put to sleep the db. After a while, a new request to
get im_status will be sent and nginx responds to it with an error 404
and an invalid JSON response. A traceback with a particularly bad
message is then shown. Here we improve the traceback message.
closesodoo/odoo#99430
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit converts the report code to the new framework.
Since the module stock still has code that extends the old
"ReportClientAction", the old report code is put inside this module.
It can be then naturally removed once the module is fully converted.
closesodoo/odoo#97390
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
On non-legacy views (like Pivot) the vertical alignement of the
searchbar wasn't properly centered. Also there wasn't enough spacing
between the actual search input and the bottom line.
This commit fixes it by certically center it and normalize the bottom
padding accross legacy/non-legacy and mobile/desktop.
closesodoo/odoo#99476
X-original-commit: cdee502c05cfacdefd2e656001c6f9ae7d3146af
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Have a list view (new RelationalModel inside a WOWL list view) that has
a legacy many2many tags field in its arch.
Try to add or remove some records from that many2many.
Before this commit, there was a crash, because the legacy field wrapper
doesn't use the model the right way for that case.
After this commit, there is no crash.
closesodoo/odoo#99431
Signed-off-by: Georis François (fge) <fge@odoo.com>
Before this commit, if a text-muted on a setting (a description of the
setting) contains fields or HTML tags, the highlight generated wrong
texts.
Now, we highlight the text in an iterative way, taking care to only
highlight the text.
closesodoo/odoo#99205
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When searching a text of a hidden field (for example, "gate"), the
setting itself will not be shown, but the group title, and the app
Search Header will be shown.
This issue arise because, we use an if condition with all the label of
all the fields (hidden or not) in the group (or app) to decide if the
group title or the app header will be showed.
Now, we modify this to hide (d-none) the group title or the app header
if there is not a settings below them.
Part-of: odoo/odoo#99205
Passwords are something we know that need to be exact. So, the regular
behaviour where double spaces are changed to single ones and spaces are
trimmed at the start and end of the string is not a good idea for
passwords in general. Not that a lot of people put double spaces or
space in the start or end of their passwords, but it happened and it is
possible. So, if password is True on the field, it does not make any
sense to trim it and let's support that in the web client (as the web
client does the trimming) instead of putting trim=False on all password
fields in the Python, risking to forget it for the next password field.
closesodoo/odoo#99088
Signed-off-by: Josse Colpaert <jco@odoo.com>
This commit aims to make the BinaryField and PdfViewerField appear and
act the same way as they did before their conversion to Owl.
This mostly consists of a few tweaks in the conditional rendering of
certain elements in the template, and the rest of the changes are meant
to clean and simplify the values the component is working with.
closesodoo/odoo#98251
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
This commit allows the 'editInput' test handler to also handle inputs of
type "file". To do so, the value must be a file (or a list of files),
and the handler has been refactored to accept a certain given value only
if its type allows it.
Part-of: odoo/odoo#98251
This commits fixes the behavior of the confirmation dialog.
When a user dismiss a dialog using the close button or the
ESCAPE key, it should expect to execute the cancel action,
if any had been given to the dialog.
The behavior was missing, and the dialog was simply closed.
Tests have also been added, since this core component didn't
have any test since its introduction.
closesodoo/odoo#99418
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The dropdown is positionned from the left, with comming from bootstrap:
- left: 0; # from CSS [OVERRIDEN]
- right: auto; # from CSS
- left: 0px; # from JS
- transform: translate3d(123px, 0px, 0px); # from JS
the 123 pixels is the offset to the left border of the parent component.
This is working in left-to-right, but in right-to-left, only the CSS
style is reversed and we get:
- right: 0; # from CSS
- left: auto; # from CSS [OVERRIDEN]
- left: 0px;
- transform: translate3d(123px, 0px, 0px);
Since the result is `right: 0; left: 0px` the size of the dropdown is
set to 100%, but this is not taken into account by Popper.computeStyle
which will have a 100% parent width Popper set at the position of the
small width Popper.
Graphical example:
```
[----------------------] # width of the page
[---] # popper in LTR
[---] # popper in RTL with fix
[-------------] # popper parent size
[-------------] # popper in RTL without fix
```
as shown, without the fix, the popper content might overflow outside of
the page, and the content aligned to the right unseen).
opw-2926863
closesodoo/odoo#99355
X-original-commit: a883d0de0336c85ebab411ec42ae0e9936b5195f
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
On Chrome, have a field that supports autofill (you have to have set up an adress in Chrome first).
Click on that field, and apply the autofill proposition.
Before this commit, there was multiple crashes, roughly one for every handler of event `keydown`.
This was caused by the fact that the autofill feature triggers keydown events without the field `key`.
(https://bugs.chromium.org/p/chromium/issues/detail?id=581537, I could not find a better ticket).
This seems to be a bug on Chrome's side, since the spec doesn't mention that field may be unset (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key).
After this commit, there is no crash.
closesodoo/odoo#99348
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
The purpose of this commit is to prevent saving to a form view
if you have created and edited a new invalid record in an x2many.
How to reproduce
- go to a form view with an x2m
- create a new record with at least one required field empty in the x2m
- edit another field than the required one
- click on the save button
Before this commit:
- The view is switched to readonly mode and the new record is deleted.
After this commit:
- The view stays in edit mode, the new record is not deleted and
a notification indicating invalid fields is displayed.
closesodoo/odoo#99288
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit will make date(time) raw_value an ISO string
instead of a native JS Date.
- Before this commit
In kanban templates:
- the raw_value property of a record's date/datetime field is
a native JS Date object.
The problem with raw_value is that JS Dates toString
method depends on the system locale and timezone.
In the code base, the usage of raw_value for date/datetime fields
usually parse the raw_value into a luxon DateTime object
in order generally to display it in a specific format, or in order
to compare it to another luxon DateTime object (e.g. the now instant).
- After this commit
The raw_value property of a record's date/datetime field
has become an ISO8601 string, instead of native JSDate toString
format (which I recall depends on system's locale and timezone).
The ISO8601 format is easier to work with.
Part-of: odoo/odoo#98980
The goal is to improve the dates utility functions (parse/format) by removing the timezone option, which is difficult to understand and has proven to be error prone.
- Rationale
When manipulating DateTime objects on the JS side, associated timezones
must be always coherent.
Until now, there were several code parts that had to check the DateTime
timezone and handle things differently in a case or another.
This sometimes lead to wrong code.
E.g. there was a bug in the DatePicker component because the DateTime
object it receives in props is in local timezone, but once it updates it
through the parse utility, the new object is in UTC.
- After this commit
The DateTime objects you'll get through deserialization or parsing are
always set in the user's local timezone.
The formatted strings you'll get through formatDate and formatDateTime
utils will always be expressed in the user's local timezone.
The formatted strings you'll get through serialization utils will always
be expressed in UTC.
- serializeDate and serializeDateTime
- expected input: a DateTime object (its timezone does not matter)
- outputs: a string formatted for the server expressed in UTC
- formatDate and formatDateTime
- expected input: a DateTime object (its timezone does not matter)
- outputs: a string formatted for the user, expressed in the user's TZ
- deserializeDate and deserializeDateTime
- expected input: a date(time) string provided by the server, in UTC
- outputs: a DateTime object in user's TZ
- parseDate and parseDateTime
- expected input: a date(time) string provided by the user, in its TZ
- outputs: a DateTime object in user's TZ
- Other changes in this commit
As the timezone option has been removed from parsing/formatting utils,
all their usage had been adapted in the codebase.
The large diff in dates_tests.js is because some tests were reorganized,
others were removed/adapted/joined.
A test has been removed from daterange_field_tests.js, because it has
no sense: it displays a date field as a datetime, but a date field does
not have any time information.
Part-of: odoo/odoo#98980
Co-authored-by: Julien Mougenot <jum@odoo.com>
Reproduction:
1. Install Timesheet, and load demo data
2. Mimic a timezone in browser (Chrome): Right click->Inspect->Sensors,
in the Location-> choose Other…, type “America/Puerto_Rico” in Timezone
ID, refresh the page
3. Go to Timesheets->Timesheets->All timesheets, choose pivot view
4. Add custom filter, Date is between 1st/Aug/2022 and 5th/Aug/2022,
apply
5. The filter result is correct but the tag in the search bar is “Date
is between 31/07/2022 and 04/08/2022”
This also happens to other fields with type Date, but not Datetime. For
example, in Accounting->Reporting->Invoices Analysis->Pivot view, the
same issue happens with Due Date filter. For Datetime field, it doesn’t
have the issue, for example in CRM->Sales->My pipeline, change to pivot
view, the custom filter for Assignment Date doesn’t have the time zone
issue.
Note: reproduction usually works during the daytime in Brussels.
Reason: miswriting when rewrote custom_filter_item from V14 to V15. The
value pushed to descriptionArray should not be changed on time zone.
Fix: in parseField and formatField, use default formatters/parsers options. Add test for the Date filters.
Related PR: odoo-dev@aeb8e49?diff=unified#diff-6d9230cfcd007b087b2851cbf0b4a33b26dc3c91087853da6fe7ce8c2b60e42f
Reference code in V14: https://github.com/odoo/odoo/blob/14.0/addons/web/static/src/js/control_panel/custom_filter_item.js#L170-L173
opw-2941231
Part-of: odoo/odoo#98980
Co-authored-by: Liu Jinjiu <jili@odoo.com>
The FormView can autofocus a `default_field` if it exists, or, the first usable
field.
This commit moves the logic to the FormRenderer, has we need this feature in the KanbanRecordQuickCreate.
Besides, it makes sense for the FormRenderer to have that responsibility.
closesodoo/odoo#99297
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the dom ID of a field was not put onto the legacy fields'
focusable dom node. It prevented a form view containing legacy field to properly focus
the default_field.
After this commit, a legacy field's focusable element can be focused at the init of the FormView
Part-of: odoo/odoo#99297