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>
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-21
Details:
- fix: prevent side effects at template compilation
- fix: props validation: does not crash with t-call-context
- fix: make t-portal work in all cases
- fix: make props validation work through slots
closesodoo/odoo#101207
X-original-commit: a09733b8d60ba36327695657221304ef19eaed42
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Tests adaptations will come in a following PR, but the current focus is set on owl conversion.
task-2936932
closesodoo/odoo#101208
X-original-commit: 22c8e0ec8cd0ffc6a14302fc548bb5fffc5c4e11
Related: odoo/enterprise#31820
Signed-off-by: Xavier <xbo@odoo.com>
This commit adds an option which allows getting the seconds in the
returned formatted hour.
task-2936932
X-original-commit: c7a3a40cadfe5f2db951860173417044e8e365c1
Part-of: odoo/odoo#101208
This commit introduces the new calendar view written in owl.
closesodoo/odoo#101185
X-original-commit: e88988f58582d5b49a32d7102a74a176f40c4c69
Related: odoo/enterprise#31808
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
This commit adapts codebase following the move and integration of the
touch device detection and customization (through the o_touch_device
class) in community.
X-original-commit: f3adc2b0f70feb80292f6c755d53690e49647dbb
Part-of: odoo/odoo#101185
Co-authored-by: Bruno Boi <boi@odoo.com>
This commit adapts codebase following the move and integration of the
touch device detection and customization (through the o_touch_device
class) in community.
X-original-commit: 5ae86ad473dd69559820b1f599ce389484cdebbc
Part-of: odoo/odoo#101185
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Setting width *and* height attributes allows to reserve some space to
avoid layout shift during page loading. Of course, CSS rules set the
height the user chose, while the width is set to 'auto'. But while the
image is loading, it is best to already reserve some width to reduce
layout shift (like making the menu move or even re-render itself into a
"+" menu).
The chosen values for the space reservation are the ones of the default
logo and theme, but it does not really matter as long as they are
coherent. While the image is being loaded, the chosen user height is
still applied and the 'auto' width rule induces a width that respects
the aspect ratio set by the width and height attributes. That could be a
problem if the real logo has a larger height than width, in which case
the layout shift would be increased because of the arbitrary values set
as width and height, but in most cases, this should reduce it.
This also allows to gain some page speed scoring.
Examples:
=# Logo 200 x 100, height set to 50
Before this commit
- while loading: width = 0, height = 50
- once loaded: width = 200 / 100 * 50 = 100, height = 50
-> layout shift of 100 - 0 = 100
After this commit
- while loading: width = 95 / 40 * 50 = 118.75, height = 50
- once loaded: width = 200 / 100 * 50 = 100, height = 50
-> layout shift of 100 - 118.75 = -18.75
=> Shift of 18.75px to the left, way better than shift of 100px to the
right
=# Logo 100 x 100, height set to 50
Before this commit
- while loading: width = 0, height = 50
- once loaded: width = 100 / 100 * 50 = 50, height = 50
-> layout shift of 50 - 0 = 50
After this commit
- while loading: width = 95 / 40 * 50 = 118.75, height = 50
- once loaded: width = 100 / 100 * 50 = 50, height = 50
-> layout shift of 50 - 118.75 = -68.75
=> Shift of 68.75px to the left, kinda the same as a shift of 50px to
the right.
=# Logo 100 x 200, height set to 50
Before this commit
- while loading: width = 0, height = 50
- once loaded: width = 100 / 200 * 50 = 25, height = 50
-> layout shift of 25 - 0 = 25
After this commit
- while loading: width = 95 / 40 * 50 = 118.75, height = 50
- once loaded: width = 100 / 200 * 50 = 25, height = 50
-> layout shift of 25 - 118.75 = -93.75
=> Shift of 93.75px to the left, worse than shift of 25px to the right
but the case of having a 'portrait' logo is considered less common
than having a 'landscape' logo. Ideally, we should choose the
arbitrary values related to the most common aspect ratio.
closesodoo/odoo#101149
X-original-commit: 73786c5c45202914e02325c19a2afaa47d31c341
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
In order to improve the page speed score and avoid layout shift, set
both width and height of the tiny Odoo logo used in the copyright
section of the website footers. This was able to be done with no
drawback:
- Set the width and height attribute of the image being loaded
- Leave the CSS rule `height: 1em;`
- Add the CSS rule `width: auto;` (which was implicit before)
By doing this:
- Once the image is loaded, the behavior is exactly the same as before
- While the image is loading, the height is still using 1em but the
difference is that the "auto width" now know the final aspect ratio
of the image thanks to the width and height attribute -> the width is
thus the same as it will be once the image will be loaded (while it
was 0 before)
X-original-commit: a709a10e0b746242a6bca1af2ce92020ec917464
Part-of: odoo/odoo#101149
Before: On a map view, a bunch of points get loaded one by one. Each of
them triggering a new render of the controller. Currently, the useModel
hook does a deep render no matter what. If you are trying to set a
custom filter un the filter menu in the control panel, the content would
systematically diseapear (rerendered) when a new map point loaded.
After: To prevent this, setting the input node as t-model is a solution.
It allows owl to keep track of the value of the input and correctly
set it back when a render occurs.
closesodoo/odoo#100421
Signed-off-by: Géry Debongnie <ged@odoo.com>
The web tooling to lint/prettify the js codebase was only enabled
for master branches, because we want minimal diffs in stable.
However, v16 just got freezed, and we can afford to lint for a
while, at least until it is released. This commit enables the
script for v16, in addition to master.
closesodoo/odoo#101110
X-original-commit: 47ffd1b9efa933fa37c1b629afeeb4e3df123249
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the no content helper was displayed just
below the control panel in empty list views, whereas it must be
displayed approximately in the middle of the screen.
The `position: relative` has been introduced recently, and doesn't
seem useful, so we simply remove it.
closesodoo/odoo#101108
X-original-commit: ee18aa1f6b85eb420e198775592a9e0772cc8475
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the popover was incorrectly
positionned because of the style of the legacy widget.
The legacy widget added some rules to add margin and an arrow
that the new component does not need.
closesodoo/odoo#101097
X-original-commit: bd4862774264c5169aa2dcf4cd80908c2f4c71bb
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, in a Kanban view, the group representing
a new column did not contain a domain. Its domain should have combined
the view domain and the groupBy domain ([groupByField.name, "=", id]).
How to reproduce:
- Go to a grouped kanban view with a progress bar
- Create a new column
- Create a record in this new column
- Click on the progress bar to filter the records on a state
Before this commit:
All records corresponding to the selected state are displayed in the
column. (even the records that are not part of the column)
After this commit:
Only the new record is displayed in the column.
closesodoo/odoo#101096
X-original-commit: 1022262c6fcd51c8d4fc8024217542bb1f536d2c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when website was not installed, the frontend used
the default bootstrap font. That font was not receiving the unicode
support Odoo provide in the backend or the frontend when website is
installed. This is probably visible on some portal pages in hebrew or
something like that, so this could back-ported in stable if found
necessary (in that case, the fix to the `o-add-unicode-support-font` in
this PR should be back-ported too).
task-2993054
closesodoo/odoo#101068
X-original-commit: f7cfcae0f0169774e0b66b8b8083005a7cd34eaa
Related: odoo/design-themes#593
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
To allow increasing page loading performance, websites can now choose to
use system fonts instead of using a google font. It is also the default
in the default theme of Odoo from now on. The option will automatically
be available for all themes whatever way they defined their available
fonts but will only be used as default if explicitly asked by the theme
(as done in the default theme).
task-2993054
X-original-commit: c0f2f670eb087991cc9a6a67f4beea5f12bd15f2
Part-of: odoo/odoo#101068
Before this commit, the function (which allows adding unicode support
to a font definition) relied on the fact "serif" or "sans-serif" was
defined last in the given font. If that was not the case, you had to
give the position in the given font stack where you want to include
unicode support).
Now, if no position is explicitly given, the function does not suppose
"serif" or "sans-serif" is defined last. It only supposes it is defined
somewhere in the stack, and put unicode support just before.
task-2993054
X-original-commit: 1f34ef2b64aad34ab533e77b1f31e434a5a17af1
Part-of: odoo/odoo#101068
When the kanban is grouped on a readonly fields,
it shouldn't be possible to drag and drop a record from
one column to another.
It was the case when the field was part of the view architecture,
but not when the fields wasn't part of the architecture,
despite we have the information as we have the field description
through the search view / the control panel.
This is a bug which has been introduced during the OWL conversion.
For instance, in 15.0, when grouping CRM leads by sanitized phone,
it wasn't possible to drag and drop records from one column
to another.
In master this is possible.
Besides, in the legacy code, the readonly information
is read from both the field in the architecture and the general
field descriptions:
- https://github.com/odoo/odoo/blob/67191359f2e71be85e6e72d64720bb2748008b3f/addons/web/static/src/legacy/js/views/kanban/kanban_renderer.js#L506-L515
In addition, compared to before,
this revision allows a new possibility compared to before:
Make draggable when grouped by a field which is by default
readonly in the model,
but which is set as `readonly="0"` in the view.
This is to be uniform with what is done in the list and form views.
closesodoo/odoo#101041
X-original-commit: 2a0f8d9ddba754cfc297b2a0de6e2c56990b1e61
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: crm,link_tracker,project,sale,utm
Before this commit, in some form and kanban views, there were
missing whitespaces, typically between icons and texts. This was
due to the transition to owl views, because we simply ignored
`&nbsp;` in archs. This commit also fixes a layout issue in
a project view, where the icon and the field should be displayed
in the same line.
closesodoo/odoo#101040
X-original-commit: f5813e348b6052436a4fabaa5837ecc37b15430e
Related: odoo/enterprise#31746
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>