In legacy, hide_model attribut on FieldReference was used to hide
the model input, but it was not implemented in ReferenceField
(new version).
closesodoo/odoo#99819
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
For now, the graph view completely ignores the order attribute set on
its arch root node if written in the correct way, i.e. with "asc" or
"desc" (lower case). We fix that.
closesodoo/odoo#100302
X-original-commit: 0fb64bef16914937cf4a1d1618fb58ade6d16f14
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Before this commit, a record quick created in kanban would have values
left from the quick create form view in its `data` object, that would
then be used by the model of the parent view to perform onchange
actions.
This would cause a crash if said values were set on a field not included
in the parent view's active fields.
In this commit, records data are cleared at each load, ensuring that
they only contain values for their current active fields.
closesodoo/odoo#100182
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the groups returned by `web_read_group` were
unpacked using the current 'group by' field name, and not the entire
'group by' value (potentially including a granularity for date/datetime
fields). This caused mismatches in some cases and the value couldn't be
retrieved.
Also, a needless 'sum_field' parameter was passed to the
'read_progres_bar' calls, which does not exist in the request API.
This commit fixes the first issue and removed the excess parameter.
closesodoo/odoo#100149
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit aims to make the behavior of the mocked 'read_progress_bar'
requests closer to their server implementation.
Namely, the returned dictionnary is supposed to contains the display
names of the current groups in its keys. This was not the case and has
been fixed.
Part-of: odoo/odoo#100149
Now that web_studio no longer uses the legacy graph and pivot views and
that all their extensions have been converted, we can finally remove
them from the code base.
closesodoo/odoo#99734
Related: odoo/enterprise#31112
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, an empty many2one field in readonly rendered
an empty `<a href"...">` node. Even though that link was no visible,
it had a non null width, and was thus clickable (the cursor changed
when hovering it). When clicked, it opened the form view of the
comodel, in create mode.
This commit fixes the issue by not rendering anything if the value
is false.
closesodoo/odoo#100158
Signed-off-by: Géry Debongnie <ged@odoo.com>
"Notebook" component had to be adapted to make the use of tabs
more consistent trough the app. The component now allows a use of
default tabs style in a vertical display
task-2950591
Part-of: odoo/odoo#98706
Before this commit there is a widget `many2one_barcode` that allows
to scan a barcode.
After this commit, we have converted it to OWL, but it's more than a new
component. From now, the logic is in the basic Many2One as a
property/option (`canScanBarcode`) and we also have the equivalent
Component (`widget="many2one_barcode"`). This choice has been made to
support multiple use cases (e.g. having the product_configurator and the
barcode on the same product field).
Note:
now we use the `browser` class to allow to patch the browser feature
during testing.
Part-of: odoo/odoo#100082
Move all file related to Barcode scanner (JS/XML/CSS)
Note: also the CSS class is renamed as it's not related to mobile
exclusively
Part-of: odoo/odoo#100082
Cookies should be used internally by the web UI. The server-side is not supposed to be aware of it at all.
Reverts:
odoo#88745
Based on odoo#93812
discussion. It has been decided to revert the fix to avoid further unattended behaviours.
closesodoo/odoo#100178
X-original-commit: bdde7dda7356744d459e3991a7f382fee42bf8c5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
Before: the command service was used inside components instead of the
hook. It introduced problems as the commands were not unregistered.
The commands were added multiple time to the registry.
closesodoo/odoo#100135
After: It uses the hook, "it just works".
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
We don't want any padding in those dialogs. The presence of the
padding was a consequence of the rewritte of that dialog in owl.
It is a frequent usecase to remove the padding from the body of
dialogs. We thus introduce a new props on Dialog and when this
props is set to `true`, we do not set any padding on the body.
This commit refactors other usecases to make them use the added
props.
closesodoo/odoo#100045
Signed-off-by: Géry Debongnie <ged@odoo.com>
In the PDF reports, the general spacing is too narrow, for
example in tables, in the address lines etc. This commit
upsizes a bit the line-height for the majority of text/digits-based
content.
taskID 2977261
closesodoo/odoo#99837
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In this commit, we simply set 'position' to 'sticky' on 'o_header_affixed'
to avoid to manage it's position with 'padding-top' and 'right'.
- 'padding-top' css property was used to compensate the navbar height
at the moment where the stacking context change because of the
fixed position.
- 'right' css property was used to prevent the menu to overlapp
the scroll bar.
Part-of: odoo/odoo#99338
XML files are now declared in python module manifests. During the qweb
't-call-asset' directive, assetbundle will fetch the declared xml files,
apply the inheritance (t-inherit) and create a javascript service (for
eg: 'web.assets_backend.bundle.xml') which is added at the end of the
*.js mimifier file.
When the debug mode is activated, comments are added in the template
indicating which file the template comes from as well as the
inheritances applied to it.
****
JavaScript:
assets.js (module @web/core/assets) takes care of loading libraries,
javascripts and styles.
`loadJS(url)` (loads the javascript and returns a resolved promise when
the templates are also loaded via the '*.bundle.xml' service)
`loadCSS(url)` (loads the style a resolved promise when the file is
loaded)
`loadXML(xml, app=assets.defaultApp)` (load template into
application/owl, used by the `*.bundle.xml` services)
`getBundle(bundleName)` (get the bundle descriptor)
`loadBundle(desc)` (load the files and bundle from a descriptor)
templates (XML element content all owl templates)
A new `ready(serviceName)` method on boot.js lets you know when a
service is loaded are the require.
The xmlDependencies attribute no longer exists.
Python:
The xmls taken into account by assetbundle.py, applying `t-inherit`
inheritances and adding an `name_of_the_bundle.bundle.xml` service in
the generated JavaScript file.
****
Every manifest changes is into the next commit, except 'web_tour' in
this current commit as example.
Part-of: odoo/odoo#95500
A typo fix is added.
Fix error from loading xml while widget is destroyed. Now that the xml
templates are loaded in the bundle, the error appears more frequently.
Part-of: odoo/odoo#95500
When a file is immutable the different network layers can cache it.
Services receiving this header should never invalidate these files.
Part-of: odoo/odoo#95500
This commit addresses 2 issues in kanban views with progress bars:
1) When updating the field on which the progress bars are computed in a
record, an inert "Load more" button would appear
2) After updating said value, the progress bars would not be recomputed
Both of these problems have been fixed.
Part-of: odoo/odoo#99748
This commit is three-fold:
1) we now honnor attributes `create` and `import` which can be
set to a falsy value in archs (and in these cases, we disable
the import feature)
2) we converted the base_import test suite to use the owl views
3) we whitelisted the base_import addon for the lint/prettier
script
closesodoo/odoo#100026
Signed-off-by: Géry Debongnie <ged@odoo.com>
Tooltips (and aria-label) should be used when the content of the element
is not self explanatory; but in the case of the create/save/edit buttons
available in several view control panels (kanban,list,form), tooltips
with dubious usefulness were added (e.g. "Create record" when you hover
on a button labeled "CREATE" is not really an information bomb).
Since these buttons tend to be used in tours, and the "coucouilles"
of the tours will also be some sort of tooltips, it means that you
can have frequent weird visual interactions between nunuts and stupid
tooltips.
This commit removes these stupid tooltips.
Feedback-2973374
closesodoo/odoo#100078
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Imagine a form view with a one2many editable list, containing a
required field. Open an existing record, s.t. in the one2many
there's already a sub record. Modify that subrecord, s.t. the
required field is unset (e.g. empty it, or it can be unset from
the beginning, but then modify another field). Then save the main
record. Before this commit, the record could be saved.
In this situation, the modified one2many record isn't valid, so
we shouldn't be allowed to save. The view should remain in edition
and the invalid field should be indicated.
This commit fixes this issue.
closesodoo/odoo#100059
Signed-off-by: Géry Debongnie <ged@odoo.com>
On mobile, in list view's selection mode, both the left & right bottom
parts of the ControlPanel are displayed but only the left one
(containing the selection banner and actions menu) should be displayed
(and take the full width).
Also, small alignment adjustments.
closesodoo/odoo#99483
Related: odoo/enterprise#31269
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit, if the Layout's `display` props is a dynamic value
coming from the parent Component (ie. a getter on the component that
controls which parts of the ControlPanel should be displayed), this
value isn't applied after the first initialization.
This commit fixes it by extracting the `display` logic applied in the
constructor to a getter (moving from initialization only to once
called).
Part-of: odoo/odoo#99483
The purpose of this commit is to add a quick create button at the bottom
of each column in order to facilitate the user when he wants to quickly
create a record.
It was already possible to quick create a record in the kanban view.
To do so, the user needed to click on the quick create button placed
on top of the kanban view, forcing the user to scroll to the top of
the view if he consults records at the bottom.
task-2823605
closesodoo/odoo#98703
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
In a form view, modify a record s.t. a required field is unset,
and then click on the pager to navigate to the next or previous
record. Before this commit, a notification was displayed (because
a required field is unset), but we switched to the other record
anyway.
This commit restores the desired behavior, which is to stay on the
current record to let the user fix it or discard it.
closesodoo/odoo#100050
Signed-off-by: Géry Debongnie <ged@odoo.com>
From a (e.g.) list view, click on "Create". In the form view, fill
in some fields, but leave a required field empty. Click on the
breadcrumbs to come back to the list. Before this commit, a
notification was displayed (because some required fields are
unset), but we left the form to come back to the list anyway.
The desired behavior is to stay on the form view, and display a
notification indicating that some fields are invalid.
In legacy views, we rejected promises to indicate that we couldn't
leave. This is a pattern we tried not to use anymore in new code.
Instead, we return a promise (if the method is async obviously)
which resolves to a boolean value, indicating if it works or not.
As a consequence, the action service wasn't properly dealing with
new views, as the promises they return always resolve.
This commit fixes the issue by adapting the code in the action
service.
Part-of: odoo/odoo#100050
Before this commit, the title of the SelectCreateDialog opened
when clicking on "Add a line" in a Many2ManyField was always
"Select Records" (the default value), whereas in this case, we
want to see "Add: something", where `something` is the `string`
attribute of the field (which can be overriden by an attrs on the
field node in the arch). This commit restores the desired behavior.
closesodoo/odoo#100046
Signed-off-by: Géry Debongnie <ged@odoo.com>
Have a x2ManyField displayed as a (non-editable) list view, and
with a context defined on the x2m field node in the arch. Before
this commit, this context wasn't propagated to the dialog opened,
for instance, when adding a new record. It is now the case.
To make the tests pass, we also needed to make a slight change in
the BasicModel, as it didn't correctly process the context when
adding a new record with additional contexts (e.g. in x2many list
views with custom `<creates>`.
closesodoo/odoo#100000
Signed-off-by: Géry Debongnie <ged@odoo.com>
This commit improves and fixes the styles used by
CopyClipboard[...] fields. Before this commit, the
char type was not truncated when the text was too
long, and the Copy button appeared centered but not
stretched to the edges of the container. Now, a grid
layout replaces the flex layout, which bring a more
consistent UI.
Text: the text is not cropped but goes to next line
Char/URL: the text is cropped to fit in the space
closesodoo/odoo#99991
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, quick creating a column in a kanban view would not
necessarily put it at the right index.
Now, after creating a new kanban column, the columns are immediatly
resequenced to have a consistent order.
closesodoo/odoo#99347
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This allows easier parsing of the logs for indeterministic errors, so
that when the same error happens in different build, it has the same
error message, as the stack trace contains the file name of the assets
which get generated with a different hash every time, while also
preserving the existence of potentially useful tracebacks to debug
indeterministic issues.
closesodoo/odoo#100028
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Before this commit, `false` was displayed as column title in kanban
views grouped by date(time) fields, for the column containing
records with unset value. When grouped by relational and date(time)
fields, we expect `None` to be displayed. This commit restores the
legacy behavior.
closesodoo/odoo#100020
Signed-off-by: Géry Debongnie <ged@odoo.com>
The no content helper logic (determining when it is displayed) in
kanban is quite complicated. Apparently, in a kanban view grouped
on a field that isn't a many2one, with no groups (and thus no
records), and where we don't have the "group_create" permission,
we want the no content helper to be displayed. At least, this is
how it used to work in the legacy kanban view. This commit restores
the previous behavior and encodes this situation in a test. In the
future, it would probably be a good idea to sit down and challenge
the corner cases of this feature.
closesodoo/odoo#99914
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This views has multiple custom features such as file upload, attachment
viewer and download.
A lot of files have been rendered obsolete and have been deleted,
notably `file_upload_mixin` which has been replaced by the
file_upload service and hooks.
closesodoo/odoo#99769
Related: odoo/enterprise#31145
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit improve the design and simplify the implementation.
Popovers have been removed and the overall integration with boostrap is
increased allowing customization with the default boostrap variables.
Variables for (multi-)range input have been exposed at "theme-level"
allowing to customize these components when creating a new theme.
task-2907955
Part-of: odoo/odoo#98558
Improve checkbox/radio design and the overall consistency, removing
'website_sales' overrides and defining `:hover` behaviors globally.
The odoo 'css_attribute_color' field has been adapted too in order to
match user's fields customization.
task-2907955
Part-of: odoo/odoo#98558
If the source field widget emitting a field_changed event is a m2o,
the field changes of the event will all be considered
as changes targeting a m2o and converted accordingly, resulting in
server errors because the `onchange` call received a [None, None] value
for a standard field (e.g. float).
closesodoo/odoo#100007
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, we didn't apply the default favorite (if any),
when there was an active_id or active_ids in the context. This was
a mistake. Note that it only impacted owl views.
closesodoo/odoo#99989
X-original-commit: 1e13e6cd073e57b3744caefc4b8f3795c35a4c10
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In a form view, have a o2m field (A), with a nested o2m field (B).
The A field should have multiple pages, with each record having at least one record
in their B field.
Have a (C) field that will modify a record in the nested o2m when changed.
Change the C field, and save.
Before this commit, the record's nested o2m from the other page had a wrong value
(a mere 4 command).
After this commit, their value is a command 4 and a command 1, with the right values.
closesodoo/odoo#99986
X-original-commit: e45e3b83f0f3116cc983c6bd8a9212e815b4d4f5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>