Previously, when evaluating a button's context from its attributes, we
would evaluate it with the record's data as context, this resulted in
x2many fields being evaluated as a datapoint (in particular, as a
StaticList). When we then went to call doAction with that context, the
action service tries to serialize that context with JSON.stringify,
which crashes as the StaticList contains circular references. This is a
mistake, as contexts and domain that are to be evaluated from a
string/attribute should be evaluated using the record's evalContext, not
its data. This commit fixes that.
closesodoo/odoo#98469
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
With the conversion of the kanban view, it was no longer possible to
validate the quick-creation of a column using enter while within the
quick-create input, this is because the hotkey service ignores hotkeys
being pressed while within an editable element by default except for the
escape key.
This commit fixes that by configuring the enter hotkey that
is registered to bypass the editable protection, and also restricts this
hotkey to only be active while focused inside the input.
closesodoo/odoo#98535
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Previously, when registering a hotkey without an area then a hotkey with
area, there would be a crash, as that latest hotkey is the candidate
winner, and we then check that there is no other matching hotkey with an
area that's more specific. In doing this, we assume all other candidates
have an area and call it as a function, but since some hotkey
registrations don't have one, we get a crash.
This commit fixes that by filtering the candidates to only those which
have an area before trying to narrow down to the most specific one.
Part-of: odoo/odoo#98535
Before this commit, when creating a record containing an invisible
x2many, the fields related to this x2many were not asked during the
creation onchange.
Problem:
Some required values were missing when igniting a new record.
Cause:
The arch related to an invisible x2many was ignored.
closesodoo/odoo#98086
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
It happens that some pages are exceeding the click timeout of ten
seconds. Notably the settings, and as the settings are linked to
different menu's, it's difficult to black-list them.
closesodoo/odoo#98525
X-original-commit: 26665a5055842a40f3beb718bd63546758f190f4
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Steps to reproduce:
- Load odoo on a mobile view
- Go to Inventory > Products > Products Variants
- Switch to the list view
- Long press a record to enter the selection mode
-> The selected records should be highlighted in blue
closesodoo/odoo#98186
Related: odoo/enterprise#30465
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
In BS4, the classes utilities order was set from `-1` (first) to
`13` (last). This commit restores the old behaviour.
In BS5, you only have a range from `-1` to `6`.
These classes are used in Odoo to order the `oe_stat_button`
particularly for UTM campaign. The order is set using CSS as there no
simple way to do it using `XPath` as there are many module (installed or
not) targeting the `oe_stat_button`.
closesodoo/odoo#98458
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Previously, the autocomplete's width was set manually to that of the
parent. This is useless because the width is already set by the left: 0
and right: 0 rules in css. These rules are also incorrect, as we don't
want the width of the autocomplete to depend on the size of the input,
it should be able to overflow past the end of the input if necessary to
show the full width of the autocomplete items.
This commit fixes that, and relies on the usePosition hook for position
instead (as the position used to be left: 0 and right: 0)
closesodoo/odoo#98443
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
This commit adds some spacing between the text and the
button in the DomainField. Since the rewrite of the
field, the button was too close to the text that
preceded it. A minor margin have been added to the
button to avoid that.
Part-of: odoo/odoo#98387
# Issue
A Dropdown is not closed when a child ViewButton is clicked.
# Solution
Make the ViewButton close the Dropdown.
# Note
Usually, a dropdown is closed by a DropdownItem component.
This is not the case here, because the clicks on view buttons are stopped
(see the view button template). Letting them bubble would close their
eventual parent dropdown, but it brings other issues (e.g. for a view button
in a list renderer's group row, or view buttons that could get interpreted
as action links under some conditions <a type="action" .../>).
Instead of looking in the env to close the parent dropdown if any,
an alternative solution would be to extend the ViewButton component,
wrap it in a DropdownItem component, and reroute its `onClick` handler
to the DropdownItem's `onSelected` prop.
But this requires some preparation at the form compiler level
(when compiling the status bar buttons), which we thought was overengineering
at the time of writing.
closesodoo/odoo#98399
Signed-off-by: Samuel Degueldre <sad@odoo.com>
In case several xml_ids target the same record, now we show an icon with
other xml_ids (not the first one) as tooltip.
task-2954293
closesodoo/odoo#98139
Signed-off-by: Jérémy Kersten <jke@odoo.com>
*: hr_org_chart,l10n_gcc_invoice_stock_account,mail,point_of_sale,
purchase,website,website_sale,website_sale_autocomplete,
website_slides_survey
Some commit have added old Bootstrap 4 classes after the merge of
Bootstrap 5.
Note that it's not possible anymore as the merge bot is now able to
detect it.
closesodoo/odoo#98349
Related: odoo/enterprise#30551
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
In legacy, when you have a label with a string attribute that is empty,
that label is rendered as empty. In the new form view, when the string
attribute was empty we would fall back to the default label for that
field, which is incorrect.
This commit fixes that by not rendering labels that have an empty string
at all.
closesodoo/odoo#98237
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Before this commit, the state selection field was positioned
on the left of the sheet, just above the title. Now, it is
positioned on the right of sheet.
This commit also fixes the text displayed by this field by
using the value of the fields (normal;blocked;done)_legend.
Finally, this commit removes the last uses of the deprecated
field `kanban_state_selection`.
closesodoo/odoo#97765
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
This commit completes the style of the tags of m2m_tags field.
Tags did not have correct colors and had border.
The commit also fixes the m2m_tags_avatar field for the same reason
as well as a traceback when clicking on the remove tag button.
closesodoo/odoo#96654
Related: odoo/enterprise#30012
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
# Before this commit
Serializing a date would apply the TZ offset of
the luxon's DateTime object in which it is contained.
This sometimes led to output the wrong date.
# After this commit
Serializing a date contained in a luxon's DateTime object
will not apply any TZ offset and will output a serialized version as-is.
# Note
If you still want to apply the TZ offset, you should do it manually:
const toSerialize = date.setZone("utc");
const value = serializeDateTime(toSerialize);
closesodoo/odoo#98194
Related: odoo/enterprise#30469
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
*: website
The goal of this commit is to tweak props on 'FormViewDialog' component
to be able to change dialog size (since 'props.size' is already used
by its 'Dialog' sub component).
Follows the merge of the "website in backend" task at [1].
[1]: 31cc10b
task-2687506
Part-of: odoo/odoo#98180
As we recently changed the structure of the DOM to wrap the content of
kanban card inside of kanban record instead of using the same div, some
of the rules were not properly applied. In fixing a previous bug, the
content was no longer taking up the entire width of the card. This
commit fixes that.
closesodoo/odoo#98235
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
With only the module appointment installed, go to Calendar App,
Online Appointments and click on "Create". In the form view displayed a
stat button "Customer Preview" is visible but is badly styled. This is
due to the fact that "Customer Preview" is no longer wrap by a span since
the rewriting of the form view (see odoo/odoo@48ef812a63).
We fix the problem by making the default slot content of ViewButton be a
span wrapping the prop string (if any).
Part-of: odoo/odoo#98072
There were 2 problems before this commit:
1. When switching view and coming back from the breadcrumbs: the
previous view props (such as the pager props) were lost;
2. When paging to the next record, switching view and coming back from
the breadcrumb, the view was reverted to the first selected record,
effectively ignoring the paging step.
This commit fixes both of these issues by keeping the controller's
props during a "restore" action, and by also updating the current
controller's props when using the pager.
closesodoo/odoo#97395
Signed-off-by: Samuel Degueldre <sad@odoo.com>
This commit fixes the style of the field broken
since the introduction of the "display: contents"
rule in css.
closesodoo/odoo#97906
Related: odoo/enterprise#30073
Signed-off-by: Samuel Degueldre <sad@odoo.com>
The field style was broken in form views since it
uses the display: contents rule. This commit
fixes the style of the field as it is now correctly
displayed inline.
It also changes the css selector to set the
style appropriately inside product views.
closesodoo/odoo#98185
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Steps:
- Go to Employees/Reporting/skills
The first group has a Level Progress of `0.84444` which is not a valid
percentage, it should be `84.44%`
This fix calls the correct format function to display correctly the
aggregate values depending on their widget or type instead of just
displaying the raw aggregate value.
(https://pad.odoo.com/p/wowl_views:
[GMF] Employee : Skills report, group sum should be % https://tinyurl.com/262ec37z)
closesodoo/odoo#98207
Signed-off-by: FrancoisGe <fge@odoo.com>
With the new kanban view, we have altered the structure of the DOM
slightly, and the kanban record is now a wrapper around the kanban
vignette. To restore the previous layout, some css rules need to apply
to the vignette. This commit adds those rules.
closesodoo/odoo#98188
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Inside a res.config.settings form view have a label with a string on it placed
before the field it is linked to.
i.e.:
```
<label for="myField" string="myString" />
<field name="myField" />
````
Before this commit, the string was not taken into account to build the HTML label.
After this commit, it is.
closesodoo/odoo#98109
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
This commit fixes the recently converted color_picker field
widget. It is now always opened in a list as in legacy,
no longer togglable and many style issues have been fixed.
In form views, we still toggle the opened state because
always edit is coming and it would bloat the UI to
keep it always open.
Tests has been added/modified to assert those desired
behaviors.
closesodoo/odoo#97872
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Have a domain declared somewhere in the XML as:
`("&", ("field", "=", "value"), ("field2", "=", "value2"))`
Before this commit, that expression made the Domain algorithm crash, because tuples
were not allowed.
After this commit, only tuples containing at least one other tuple and some optional strings are accepted.
closesodoo/odoo#97850
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
*: mail, web.
The pyEnv used during tests is based on the mock server to provide
server like api. This issue is that when creating multiple environments
during tests, a new mock server is created each time. This is not realistic
since in a real world scenario, multiple tabs would share a single server.
In order to make pyEnv work with multiple tabs tests (e.g. multiple env tests),
let's create a single mock server shared between js environment during a test.
task-2053917
Part-of: odoo/odoo#97975
Pass the options: `{'create': False}` to the a many2many_tags field in some arch
Before this commit, there was a crash because the API of the field's props did not
account for that use case.
After this commit, it does.
closesodoo/odoo#98050
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The list view has recently been rewritten in OWL (see 48ef812).
During the rewriting, it was forgotten to put the class o_renderer on
list renderers, making a no content helper in a list view be positioned
too much on the left and have its style broken when the list has a search
panel.
Part-of: odoo/odoo#97876
Before this commit, in a form view in edition, if you clicked a toggle
boolean in an X2many, the view was saved. A toggle boolean should not do
a save if the main view is in edit mode.
The solution is to save the record only if the view's root datapoint
is in edition.
How to reproduce:
- Go to a form view in edit mode with an X2many that contains a toggle
boolean field.
- Click on the toggle boolean in the x2many
Result before:
The view is saved.
Result after:
The view is not saved and is still in edit mode.
closesodoo/odoo#97673
Signed-off-by: Samuel Degueldre <sad@odoo.com>
The "name" attributes set on the filter nodes in a search arch are now
kept in the search items created from them. This will allow an easier
manipulation of search items (e.g. toggle a filter with a given name).
closesodoo/odoo#97913
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Since the new views, the empty domains on the archs were not be taking
into account.
Now, the empty domains are taken into account, this was the legacy
behaviour
closesodoo/odoo#97791
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Have a legacy field with the noLabel attribute to true (in the actual widget definition).
Put that field in a list view (new OWL framework).
Before this commit, the noLabel attribute was not taken into account.
After this commit, it is.
closesodoo/odoo#97899
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Have a section of a settings view that can be search in.
Have a dynamic invisble modifier (governed by a domain) on it.
Before this commit, the condition were just juxtaposed, which will cause problem
if one of them contains a "OR" operator. So, sections that should have been invisible were visible
because the if looked like: search() or search_other() and isVisible().
After this commit, the t-ifs are correctly combined so that they look like:
(search() or search_other()) and isVisible().
closesodoo/odoo#97811
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Have a field declared in python with a "help" property.
Put that field in a view with a "help" attribute.
Before this commit, the xml declaration was not taken into account.
After this commit, xml declaration has precedence over the python one.
closesodoo/odoo#97782
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Have a one2many in a form view. It displays its records with a kanban.
Add a record, now click on that new record.
Before this commit, there was not "Remove" button, preventing to effectively
remove a new (virtual at this point) record from the one2many.
Aftet this commit, there is a remove button that effectively removes the
record from the one2many.
closesodoo/odoo#97775
Signed-off-by: FrancoisGe <fge@odoo.com>
"website.layout" inherit of "portal.frontend_layout" which inherit of
"web.layout" which contains the creation of the CSRF token.
Add because "website.layout" add a t-cache key, the CSRF token is under
this cache key. But the CSRF token should be always generated,
then add t-nocache on CSRF token t-set.
Part-of: odoo/odoo#95755
The cumulative option on line chart is useful for displaying
cumulative information graphically.
closesodoo/odoo#97394
Task-id: 2146487
Signed-off-by: FrancoisGe <fge@odoo.com>
Steps to reproduce:
- Switch language to french
- Refresh the page
- Create a new payment
- Select a partner
- Enter an amount of 100000,00
- Save the record
-> The following field is incorrect: amount
Cause of the issue:
Since https://github.com/odoo/odoo/pull/97425 ,
`parseMonetary` wrongly assumed that a currency was always passed in
the parameters
opw-2937403
closesodoo/odoo#97861
X-original-commit: 9d518f847d2204fc5159a92bc4e4de655acf88fa
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Fixup for 4caa9596bc, where a rebase went bad.
Have a translatable field in a form view.
Create a new record with that form view.
Click on the button to open translations for that field.
Before this commit, the record was not before opening the translation dialog, hence
changing the translations could not work properly.
After this commit, this feature is back, and we ask to save a new record before
opening the translation dialog.
closesodoo/odoo#97824
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>