This commit fixes the display of files in list and in the BinaryField,
which was displaying the complete file value instead of a human readable
size.
A new formatter has been added, and the isBinSize utils has been added
to its own utils file instead of depending from the field.
A test has been added to verify the correct visibility of a file in a
list view instead of showing the file content.
closesodoo/odoo#101673
X-original-commit: ff8485b2289a1157cdae608bd4223012fc67b77c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This field has been forgotten in the PR converting all web fields
to wowl.
closesodoo/odoo#101661
X-original-commit: 2e1c78b3818cdcb97afe4cd1496e0da6f8bac1b7
Related: odoo/enterprise#32041
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, if there was a kanban view with a field with
widget="many2one" explicitely set, the legacy KanbanMany2oneField
was used. That field simply displays the name of the related
record, with no link.
In the wowl kanban view, we only use a FieldComponent if the
field is explicitely set, and we use a formatter otherwise. For
that reason, this commit simply removes the kanban special case
instead of re-introducing it. So by default, a many2one will be
displayed in a span, and if someone wants the link in the kanban
card, he has to set widget="many2one" (this wasn't possible before).
Temporarily, until we remove the fallback on the legacy field
registry, we need to add a "fake" entry in the wowl registry, to
prevent from fallbacking on legacy.
X-original-commit: a3cd97c5c81422e33a5715ecc4dd017cf5172ea8
Part-of: odoo/odoo#101661
This field type has been forgotten in the PR that converts web
fields to wowl, probably because it wasn't tested. This commit
defines a Component and a formatter to use for that field type,
in wowl views, s.t. we no longer rely on the legacy implementation.
X-original-commit: 540e113d107b59af23dc9726a55f5b8376248247
Part-of: odoo/odoo#101661
There are several versions of the CopyClipboard field (char, text,
url). There's also the version where the field's value isn't
displayed (only the copy button is), aka `CopyClipboardButton`.
This one has been forgotten during the owl conversion. This commit
restores it.
X-original-commit: 3dfbfb5b9568b72ebbe7c376cd56ebf056a86c75
Part-of: odoo/odoo#101661
This commit replaces the FormView group tables with css grids.
Part of the overall v16 SCSS optimization/restyle, task-2704984
task-2918464
X-original-commit: a2b894989ea33364dd29a7d412e4bd4260c1f5ef
Part-of: odoo/odoo#101655
This commit extends the `display` class with a new value to fine-tune
the layout in several circumstances. Classes added:
- 'd-[device]-contents'
task-2918464
X-original-commit: 1c871cc847f305649a4329b653540109596fa149
Part-of: odoo/odoo#101655
By pressing the date in the calendar's date picker, a function computes
a new scale to be used depending on the previous focused date and scale,
for example clicking on the focused date in month scale will switch to
week and so on.
However it bypasses the scales that are available on the calendar's
definition.
It is now prevented.
X-original-commit: a9059b0bee02f635d563b45ee94f04bab5532fe4
Part-of: odoo/odoo#101603
Before this commit, in a grouped list view, if a date field is between
two fields with an operator_group then the view crashes.
Why is this?
The view will try to format the aggregated date value but the date does not have one.
Solution:
Use the value false if there is no aggregated value for a field.
closesodoo/odoo#101573
X-original-commit: c9485ea3dd377f486fb7543fc1092175006fc987
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, clicking on the translate button of a web_editor
html field throw an error.
closesodoo/odoo#101551
X-original-commit: c5199c8e21abd90e2904e31240e427fa2e920803
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, empty lines on non-editable form's list are 1 column
too long and breaks the list's layout (ie. squish other columns and
empty space on non-empty columns).
This commit fixes it by properly calculating the number of columns and
their application on the empty lines' colspan. It also fixes an assert
in the list view's tests which mistakenly required that list's records
should be editable in a non-editable form.
Steps to reproduce:
- Open a Contact
- In the notebook, choose the Accounting tab
=> The Bank Accounts list has broken layout
closesodoo/odoo#101550
X-original-commit: 543134e215200bafd89edc1303032a210a4206cf
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Have a many2one field in a form view, and try to quick create a
record. If the name_create returns an error (e.g. ValidationError
in the model), the many2one field opens a form in a dialog (aka the
slow create). It thus properly handle the error.
However, before this commit, the error returned by the RPC was also
displayed in its own dialog (behind the form dialog).
This was due to a mistake in the Mutex, which forks the promise
returned by the registered action. When that promise was rejected,
the forked one was thus rejected as well, and it wasn't caught.
That later promise is only used to unlock the mutex, so we can
safely catch it.
closesodoo/odoo#101549
X-original-commit: fe9e044b9e03ac7fff5d314e6e207921a15c8965
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the BasicRelationModel, and thus the new form
view, still relied on the existence of legacy field Widgets for
their `specialData` and `fieldsToFetch` attributes. This commit
removes that dependency, s.t. we always look in the converted
Field component. To make this work, we needed to defined those
attributes on several Field components that need them:
`fieldsToFetch`: this was a mistake, it must be defined on new
Field components
`specialData`: the introduction of `legacySpecialData` is
temporary, until we stop using the BasicModel
closesodoo/odoo#101548
X-original-commit: d2a2fd94bfcef8360805b46a1692ba7eb84fbe1c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when you clicked on a link which was supposed to
reach the top or the bottom of the page, the animation looked strange.
This was because the scrollTo util cannot handle fixed-positioned
elements correctly, which the header and footer can both be.
While the animation did look strange, it was still working. So the time
was never took to investigate. However, if [1] was to be reverted (as
it will partially be in master to restore the scrollbar at its rightful
place now that it can be done (see [2])), using scrollTo on those
elements simply did not work at all anymore.
This commit fixes the problem by making an exception for those elements
specifically. Notice that there is another "bug": if the header or
footer is removed (as there are options to do so), not only scrolling to
"top" or "bottom" cannot work properly but the option also does not
show up in the editor panel. This will be considered as a limitation for
stable versions and be fixed later in master.
[1]: https://github.com/odoo/odoo/commit/4e7be69825163c0a0ff41c882a196fc7f3158fb3
[2]: https://github.com/odoo/odoo/pull/98429closesodoo/odoo#101517
X-original-commit: 4883ae872c57f8c8db60ea5f9f4fd9df8bba4948
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
With [1], the frontend main scrollbar was moved to the #wrapwrap element
and with that change came many scroll utils and code adaptation. The
goal was for the code to be generic but after multiple bug fixes, only
the case of #wrapwrap being the element which scrolls (this stable
version's standard case) was actually working. As the scroll is being
moved back out the #wrapwrap in master (see [2]), those non-properly
working generic features were found. This commit solves the stable utils
in preparation for that master merge. Indeed even if the standard 14.0
case was not impacted by those faulty utils, they were still wrong and
could impact users migrated from 13.0 and earlier.
Note: some adaptation actually handles the case of multi-documents in
the page (like triggering a scroll in an iframe from out-of-the-iframe
JS code). This is not needed here in 14.0 but will be in the forward-
ported version in master for the 'website-in-backend' features merged
at [3].
This actually includes some (parts of) fixes that were done in the wrong
version, like [4].
[1]: https://github.com/odoo/odoo/commit/4e7be69825163c0a0ff41c882a196fc7f3158fb3
[2]: https://github.com/odoo/odoo/pull/98429
[3]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[4]: https://github.com/odoo/odoo/commit/f240a42ab501fe37b52f92957c144536a9faf09d
X-original-commit: ffc19547c8da2ef7fee8e2ac743ab99a607dcf90
Part-of: odoo/odoo#101517
Use system fonts for backend and web-editor's UI.
This commit removes references to proprietary fonts and allows the OS
to use the system ones. The aim is to reduce http request and the
general footprint (see enterprise counter-part).
The new font-stack:
- apple-system (San Francisco): iOS Safari, macOS Safari, macOS Firefox
- BlinkMacSystemFont (San Francisco): macOS Chrome
- Segoe UI: Windows
- Roboto: Android, Chrome OS
- Helvetica Neue: old OSX versions
- Ubuntu: Ubuntu
- Liberation Sans: Linux (others)
- Arial: Any
- sans-serif: General fallback
This was actually already introduced for the website default theme and
as a general option with [1] but it was not complete: if reaching the
need to use Roboto of the font stack, the repo Roboto was used instead
of the potential system one. It was not shown during testing with the
previous font stack. With the new one, on Ubuntu, it was revealed as
the Ubuntu font comes after Roboto.
[1]: https://github.com/odoo/odoo/commit/c0f2f670eb087991cc9a6a67f4beea5f12bd15f2
task-2995248
closesodoo/odoo#101533
X-original-commit: 9f8f8f2ef88aee746819469c918b2d31ec29d031
Related: odoo/enterprise#31985
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before, in mobile, the placeholder for `many2many_tags_field` when in mobile
was the text "props.placeholder".
Now the placeholder text is dynamically set.
closesodoo/odoo#101513
X-original-commit: b7fe9f2cf2b04b1172ec2ecbb3998328976f4960
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit simply enables a custom prop for the Dialog component so that it
can have a hand-picked background instead of the default 'white'.
Will notably be useful for the social images carousel where we need a dark
background.
Task-2855647
closesodoo/odoo#101505
X-original-commit: 8da44acadbd4ad4c03dba496daf317f1f2ab8371
Related: odoo/enterprise#31973
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit defines new rules to disable elements in views using sample
data.
Previously, this was done by setting a 'o_view_sample_data' class on the
view and then setting another class 'o_sample_data_disabled' on elements
which had to be disabled.
Now, the logic determining which elements are disabled has been moved to
each view's SCSS file to avoid polluting the templates with redundant
class assignations. A mixin (o-sample-data-disabled) has been defined in
the SCSS utils to have the same rules on these elements.
closesodoo/odoo#101485
X-original-commit: 3e413c96ff2dff60de22e1d5e1fed7070ac2943d
Related: odoo/enterprise#31960
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit renames the 'o_view_sample_data' class to
'o_legacy_view_sample_data' in legacy views to allow new views to use
different sets of rules.
X-original-commit: 05ae053dc94f9ce91c099d74f6740604e3e376c3
Part-of: odoo/odoo#101485
If the day fields are missing from the fields in the view the labels are
not loaded.
This commit adds default labels to the fields to avoid them being empty.
TaskId-2999194
X-original-commit: c6f8a229e9a8bcb798dc2944185fc48c3c871025
Part-of: odoo/odoo#101492
Make it easier to override component's sub templates by making them
overridable on the component.
TaskId-2999194
X-original-commit: 4f4e91ebb14d563dd3ec6d305b9984db25e06cbf
Part-of: odoo/odoo#101492
In Bootstrap 5, the `container` class was updated to use variables for
its left/right paddings. This seems to conflict with wkhtmltopdf, and no
paddings are added, shifting all reports.
This introduces the set paddings defined in Bootstrap 4 for the reports.
Steps to reproduce:
Go to Inventory -> Products -> Products -> Any consumable/storable
product -> Print labels -> Dymo
Also with Bootstrap 5, the `table-borderless` class wasn't working
properly on the PDFs either, as the borders were still visible. This
removes all borders within a `table-borderless`.
Steps to reproduce:
Go to Inventory -> Products -> Products -> Any consumable/storable
product -> Print labels -> 2x7 with price
Part of task-2985735
closesodoo/odoo#101490
X-original-commit: 0b9acefb18ad8b4a0df72789c853ed8d113a495b
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Purpose
=======
Always reset the autocomplete value when creating a new tag,
even if the tag already exists.
Technical
=========
The input value is reset when the tag is created because the props
of the autocomplete component change, but if we do not change the props
of the autocomplete component (e.g. because the tag already exist and
nothing should be done), the text value is not reset.
Add a new option for that purpose.
Task-2965523
X-original-commit: 352e811e821ef7c1fc075c32dda7272145749526
Part-of: odoo/odoo#101487
Bug
===
When a popover is inside an other popover (e.g. tags color popover
inside the properties definition popover), when clicking on the other
popover, the first one is never closed.
Task-2965523
X-original-commit: d782dbf5cfbeb31f98ca39935db4f6ab046a9f43
Part-of: odoo/odoo#101487
Purpose
=======
Improve the behavior / visual of the properties field when the user does
not have access to some relational properties (many2many, many2one).
When the user does not have access to one many2many value,
show the others record in the list.
Fix a traceback when the model is not set on the definition.
Task-2965523
X-original-commit: cb8b751a335b01192aab185cd0230fa0f036b974
Part-of: odoo/odoo#101487
Purpose
=======
Allow to display an avatar image for the relational properties
(many2one and many2many). This is hardcoded for res.users and res.partner,
because we don't want an option in the property definition, and we can't
read ir.model because of access right...
Automatically select the default property label when we create a new
property, so the user can just enter the new property name without
removing manually the default label.
Hide the up / down arrow used to move the property, if it's already
the first or the last property in the list.
Close the popover when pressing enter in the label
Fix a traceback when we try to delete a property after changing the type.
Fix a traceback with Falsy default datetime.
Task-2965523
X-original-commit: 316f5462d438306899c53eb625d1d573f1a93d8d
Part-of: odoo/odoo#101487
Purpose
=======
Shorten the property name to take less space in database (while keeping
a very low probability of collision).
E.G.: "aa34746a6851ee4ea1f8d95746e45788" -> "aa34746a6851ee4e"
Automatically generate property name in python if they are missing.
Task-2965523
X-original-commit: d597083ff5e0a4abde67a450a61e04e6bf119c26
Part-of: odoo/odoo#101487
Purpose
=======
When changing the type or the model of a property, the name is
re-generated, so the others record values are reset. If we change back
to the original model / type, the original property name is restored.
This is a super important behavior of the properties component and
it should be fully tested.
Reset the model and model description when changing the type.
Now that the form view is always in edit mode, even if we changed the
model / type of a properties, then save, we are able to restore the old
properties as long as we don't refresh the page.
Task-2965523
X-original-commit: 54ae82974b836a0badab3c4c767916a1daf88f76
Part-of: odoo/odoo#101487
Purpose
=======
Move the the properties formatters from legacy
to the new formatters file.
Task-2965523
X-original-commit: 6e8b49ba8a213bc2dd600fd91b7acd4a38147926
Part-of: odoo/odoo#101487
Purpose
=======
The many2many properties have "res.users" as model, but the model and
records were missing in the test data.
Task-2965523
X-original-commit: 974999d32e14fcfca94b327fb8d6efa06d6bf06e
Part-of: odoo/odoo#101487
An event was not called on uploading files in a media dialog.
This meant the parent of html field didn't know of the new attachments
which resulted in attachments being linked to no record at all
and not being garbage collected later.
This adds a reference inside the media dialog file input so that it can
trigger that event on behalf of the html field.
The attachments newly uploaded in media dialog are uneditable
to prevent users from unlinking attachments
that are still used in the body of the composer (causing the same issue)
Task-2860761
closesodoo/odoo#101405
X-original-commit: f4dd1eb3f25672e7309759c347e2b552c5652b2f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, when we used a domain on many to many relational
fields, the `dataContext()` returned the context of the field, which
contained a command tuple.
This causes an error server side, when a domain [('id', 'in', [[6,
False, [3,4]]])] is provided to search available records to fill the x2m
field.
Now, it returns the `currentIds`, which correctly gives the id(s) of the
records.
Approved by SAD
X-original-commit: 5653e23a333262683257575d071575a63981ca33
Part-of: odoo/odoo#101352
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
used in product configurator logic
X-original-commit: 40cfbf35985422a9415e6ab225d037f7393d3842
Part-of: odoo/odoo#101352
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Not only on hover - otherwise it makes it very difficult for users
to find what field is missing content.
closesodoo/odoo#101349
X-original-commit: b674e81b7ca7e553f593cef1bc1a9f94cd58e3d3
Signed-off-by: Luca Vitali <luvi@odoo.com>
Before this commit, if an invalid field was completed when editing
another field using an onchange, the field was always considered invalid.
It was not possible to save the record.
Why:
Fields modified by an onchange were not removed from the list of
invalid fields.
Solution:
Remove all fields modified by an onchange from the list of invalid fields.
How to reproduce:
- Create a new record in a form view with a required field
- Click on save (the required field appears as invalid)
- Edit another field that causes a change to the invalid field (onchange)
- Click on save
Before this commit:
The record is not saved and the required field is still invalid.
After this commit
The record is saved.
closesodoo/odoo#101343
X-original-commit: 46074244798d2e447f4e5cf174244ea263563b1d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Make it possible to override both before and after execute actions on
all view controllers using `useViewButtons`.
This avoids having to change a value in the env to override the function
being called when clicking on a button.
closesodoo/odoo#101310
X-original-commit: 9f6c2b8e969635f35786d58ee89ca767ff57144d
Related: odoo/enterprise#31860
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Before this commit, in a form view, discarding a record with an invalid
field containing an input does not restore the original value.
How to reproduce
- go to a form view with an integer field
- edit the integer field with an invalid value ("blabla")
- click outside the field (the field is displayed as invalid)
- click on the discard button
Before this commit:
The integer field always displays the invalid value.
After this commit:
The integer field displays the value before the edit.
closesodoo/odoo#101316
X-original-commit: f81e4019ca00953d9624557c98033aef46efc47a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
If a view with groups and pager, going next then previous (back to the 0
offset) doesn't work.
The pager offset and limit were used in an conditional expression.
If the value was 0, it was considered falsy and set to a default value
while the 0 was actually a valid and expected value.
closesodoo/odoo#101314
X-original-commit: 5c9173241dbe55007c3a84fe078d21ea733e9046
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
When an action was retrieved from session storage, the no content helper
content was not markuped. It would therefore display hmtl text on the
user screen.
closesodoo/odoo#101306
X-original-commit: 592b8016b8a44dc1775918e4ffbf572e9b02c50f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
This commit does multiple things:
- The readonly mode of form view is removed but not for the fields.
it means that the fields in the view are always in edit mode except
if we force them to be readonly.
- The control panel is revamped to take less vertical space and shows now
the record editing (dirtiness)/validity status after editing the record.
- The record is saved only when leaving the view or by clicking the save
button when hovering the record status in the control panel.
- The record can still be discarded by clicking the discard button when
hovering the status text in control panel.
task id: 2822553
X-original-commit: 77824ad44b6945a9811120380747f87ef6362ae2
Part-of: odoo/odoo#101118
Co-authored-by: luvi <luvi@odoo.com>
This commit changes the layout of the form view to move the
control panel next to the chatter instead of being on top.
The chatter now takes all the place on the right side of the view.
task id: 2822553
X-original-commit: 7f36dd05b3238c3d27aab6e5af12233df27067e4
Part-of: odoo/odoo#101118
This commit adds an option to many2one field to open the record either
in target new (dialog) or target current (replace view) which is now
the default.
task id: 2822553
X-original-commit: abe26f6eebb450512b35c25094329f85b98c15d9
Part-of: odoo/odoo#101118
Correctly set the border-color in case of invalid cell
task-2984169
closesodoo/odoo#101151
X-original-commit: fd355cc609cddc20e7c01a7ca12f93d6cd05c7ac
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>