Before this commit, the ListRenderer's on_attach_callback hook was
called each time the view was reloaded, even though the renderer
was already in the DOM. As a consequence, sub components were
mounted several times, which could lead to issues.
For instance, go to Inventory > Operations > Transfers, create a
new one. Change the Operation Type to a Receipt, and change again
to a Delivery: it crashed.
Task 2315149
Closes#56701closesodoo/odoo#57101
X-original-commit: 78f361fb5382e4c7aed9a4e705e20f8d8757300d
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when being in a form view without active field
(the field is defined on the model, but not present in the view),
the action "Unarchive" was available in the Actions menu, even
though the record was actually active.
The issue has been introduced by [1]. This commit restores the
previous behavior: when the active field isn't in the view, the
Archive/Unarchive action isn't available in the Actions menu.
[1] 220eb4db39closesodoo/odoo#57041
X-original-commit: 97b70aab69b491443d862847fbff69c4e29274af
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The document layout preview is a complete defferent simplified template
with its own css that replicates at best the different styles.
It does not have the external layout features and lack of fidelity.
The new preview actually use the real documents templates and put the
result in an iframe. It now has a high fidelity, though not perfect.
The goal is for a better onboarding, where clients see easely how
documents will look if they had an app to generate them. Of course, the
data on the document is a false invoice.
Refactor all this from base to web.
Task ID 2304177
closesodoo/odoo#56995
X-original-commit: c121a246f16899735306266a3a12b526e08e7620
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the end users were unable to click on the
kanban image to see document's preview.
To fix this we removed lines from a previous fix which is no
longer useful in 13.0 because we now use kanban views for
many2X fields instead of list views.
See original commit:
https://github.com/odoo/odoo/commit/26c62cbb4401bffb72ce77fee481ca84b77a8143
So for mobile phones it's working fine.
For iPads, this rule is no longuer necessary since iPadOS.
See "Accelerated Scrolling on iOS and iPadOS":
https://webkit.org/blog/9674/new-webkit-features-in-safari-13/
For previous versions it still works because the DOM has changed.
Steps to reproduce:
- Go to Document
- Click on "o_kanban_image"
=> Your're stuck on a grayed page.
opw-2260101
closesodoo/odoo#56977
X-original-commit: 0d41d0daa7220a791bc4df85cca4100e3634e432
Related: odoo/enterprise#12907
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
This new widget allows definition of Images through static urls stored in a Char field.
It was implemented to provide a way to reduce databases footprint by using
static files instead of duplicating them in the databases (& their backups).
Have an action which help field has the value:
```
<p></p>
```
Display an empty list or kanban
Before this commit, the nocontent helper was displayed even though there was
nothing to display.
After this commit, an empty html tag is the same as an empty string,
so the helper is not displayed.
task-2320318
closesodoo/odoo#56883
X-original-commit: 3d6bdc5b01a4a94de9baa9bae230e6b34f38dbc9
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit:
An empty list helper position not centered when search panel sidebar is
there and some issue created while having a droplet on it as the
position will shifting after a few seconds (sign_tour)
After this commit:
Set an empty list helper at a relative position and now it will always be
displayed at the center whenever have a search panel sidebar
LINKS
Task-2323988
closesodoo/odoo#56792
X-original-commit: d50c7f5c88eaef56c757849a64d63f92bd73f2f2
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
- reduce the size of the tooltip box when the tip is short
- display the rainbow message longer on the screen to allow
the user to read it.
closesodoo/odoo#56562
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
For some strange reason, BS is handling small and large input groups
pretty well but not normal ones. Indeed when customizing the paddings
of buttons and inputs individually, the normal-size input groups are
broken. Also, customizing the border width of buttons always breaks
input groups for all sizes. This is now fixed.
Note: the first problem was actually already solved by increasing the
input height to the button height. It makes actually more sense to
shrink the button size to the input height as this commit does (as this
is the input which is the main element in an input group).
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: 7786d27bb42f1846442e37b7b2cba4a7c25131fb
The code in charge of adding inside a dropdown the menu items that would
be forced on a second line was not doing it properly when there were
some display: none items and especially not when there were neighbours
using the m*-*-auto classes.
Part of https://github.com/odoo/odoo/pull/56427
task-2264627
X-original-commit: 87a90f6816c0ce3db7d9d2edbe1b5149fd7bacff
Have a project.task that is archived
Display it in form view and with the chatter on the side (big screen)
(though the issue happens at any viewport size, with slight difference is positioning)
Before this commit, the field kanban_state is under the ribbon, with no way
to interact with it.
It could happen with the title itself, or with any field that we'd put
on the right side of the form.
After this commit, the kanban_state field is visible.
In short, siblings of the ribbon now have some right margin in css.
task-2226237
closesodoo/odoo#56579
X-original-commit: d701317a6c3ba002e935f8b30ce160cc186c239a
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The quick create form view is explicitly given the o_xxs_form_view
class at initialization but resizing the window sometimes changes that
class on form element in enterprise.
To avoid this in the quick create case, the method _applyFormSizeClass
has been overriden in QuickCreateFormRenderer in order to do nothing
when the window is resized, so that the class and the related style stay
the same as expected.
Task ID: 2317807
closesodoo/odoo#56521
X-original-commit: f9c605ea578267de17e6c1dcc69dfd179d5d95fe
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
before this commit,
when there are too many fields on list view and list view has horizontal scroll
opening optional dropdown does not open on right place, instead it opens bit
left side from the right.
this commit fixes the issue by appending dropdown div inside table element, as
scrollbar comes inside table element, so appending dropdown element inside
table just after dropdown toggler.
task-2307248
closesodoo/odoo#56516
X-original-commit: 5a044593ba1f8f08f72de502d77823a8dd5175a0
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
When visiting the Month view of the Calendar App, events titles and
time will be displayed inline, showing first the time of the event and
then, the event title, truncated when needed, at the right of the
container.
Task 2200233
closesodoo/odoo#46078
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
In o_colorpicker popup, the "Hide in Kanban" checkbox label is not
aligned with the checkbox.
With this commit, we have aligned the label with the checkbox.
Task ID: 2277254
closesodoo/odoo#56447
X-original-commit: 72252ff8a6aaae86fae121a7006039a40ba6efe2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Until now, the quick creation dialog of the calendar view assumed that
the underlying model used a 'name' field for quick creation, with a
graceful degradation if it was not the case (redirect to the form view).
This prevented quick creation of models created through customizations
(for example).
This commit adds a `create_name_field` attribute on the view declaration
(similarly to many2one field) that allows to specify the field to use
during quick creation.
Task-2185423
closesodoo/odoo#48122
Related: odoo/enterprise#11242
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Before this commit, the crash manager used a copy of the browser detection isBrowserChrome method
because it was not possible to to register the proper dependency in stable version
This commit makes the crash manager use the module BrowserDetection for that purpose, with the proper
registered dependency before hand
closesodoo/odoo#56364
X-original-commit: 59e0dbab98466a23792af4a10003142614bda676
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Have a piece of code that throws an Error
In browsers not powered by V8, the stack trace won't be formatted and the Error
type won't appear in the crash manager modal report.
This happens because Error.prototype.stack is non-standard, although most
browsers have an implementation of it. Chrome for example automatically formats
the Error.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Errorhttps://v8.dev/docs/stack-trace-api\#compatibility
After this commit, the Error is formatted in the crash manager report, the same
way as Chrome does it.
task-2191727
closesodoo/odoo#56318
X-original-commit: dbf670f2e0ec797aeaf998aa28b32afbdd2c3b4c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Hardik Prajapati <hap@odoo.com>
This commit adapts the BasicModel to combine calls to `default_get` and
(first) `onchange`. When creating a new record, we now only call
`onchange`, which thus return default values and potential onchange
values.
Tests (and the MockServer) have been adapted accordingly.
NOTE 1. If the `default_get` within the `onchange` returns a value for
a field that is not in the view, we ignore it, and it won't be saved.
Before, that value was kept and sent upon save. This change in behavior
may prove problematic, although the overall risk is small. Decision has
been made to keep heavy comments and code snippets if we were to revert
back somehow to the previous situation.
NOTE 2. Putting a context on a many2one field may change the value
returned by `name_get` for that field. By default, the calls to
`name_get` are done by `onchange`. If the context on a field must be
used for `name_get`, one has to set the option `always_reload` to `True`
on the field. In that case, every `onchange` that changes the value
will trigger an extra `name_get`.
NOTE 3. Suppose that a one2many field has a list view with field A, and
a form view without field A. When adding a line, we now send all known
fields (main view and inline views) to the `onchange`, which may return
a default value for A. The value will appear on the list view, but not
in the form view. The former behavior was to call `default_get` with
the fields that occur in the form view only, and therefore field A would
be left to value `False`.
NOTE 4. A test surprisingly adds an extra call to `read`. The test was
actually wrong before. With the changes in MockServer, we now correctly
receive a command `[6, false, [1]]`, whereas before we received `[1]`,
which isn't a valid command, and which was ignored. As a consequence,
an extra `read` is done, whereas the test asserts it shouldn't. But it
already didn't work before (I checked by sending the correct command).
This needs to be bugfixed elsewhere (task-id-2323491): in a o2m with a
onchange and default order records on an other page than the first
should not trigger a `read`.
Task 2261084
Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
When you hover on the "Start Typing" text in autocomplete dropdown,
it will not visible as its CSS overwrite with the rule and change the text color
as white.
With this commit, we have added the css rule for specifically "Start typing"
dropdown item and its looks consistent as other dropdown items.
Task : 2311983
closesodoo/odoo#56233
X-original-commit: ee8739361830981539127b269363a6fcbfcd840c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit: if there are modifiers based on field which hides
one page and show another and if active page get invisible then instead
of first page second page gets focus, consider following example,
`<form>
<field name="boolean"/>
<page name="page1" attrs='{"invisible": [["bar", "=", false]]}'></page>
<page name="page2" attrs='{"invisible": [["bar", "=", true]]}'></page>
<page name="page3"></page>
</form>`
Consider the initial boolean value to be true; initially the first page
will be visible. But when "bar" is unchecked then page1 will be hidden
and page3 will get the focus as page2 is still not visible: it will be
after the computaion/application of all modifiers, which is currently
done after the rendering of a tab page.
Now: the first visible tab is focused on rendering (same as before) but
also after all modifiers have been updated.
closesodoo/odoo#56209
X-original-commit: 10365572aa3629e9b19d2b29726b351275de9f52
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Ipsita Borisagar <ibo@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
This commit will add a bus in the web.config config that allows
to trigger events.
The first use case is the trigger of the size_changed event that
is triggered each time the size of the screen changed of bootstrap
breakpoint.
task-2276740
PR #53175
The "quick create" form now renders the kanban quick_create buttons on
its own. This means that the form handles them as regular form buttons,
hence including them in its keyboard navigation.
Part of task: 2314864
closesodoo/odoo#55787
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
PURPOSE
Be able to remove some measures from graph / pivot views. Currently fields
are automatically added but some of them make no sense.
SPECIFICATIONS
Add the possibility to not display some fields in the measures dropdown for
the graph and pivot views.
When a field is not displayed in the measures of a pivot views we remove them
also from the list of groupable fields.
LINKS
Task ID-2288381
Community PR #54774
Enterprise PR odoo/enterprise#11970
Upgrade PR odoo/upgrade#1519
Currently, only List and Kanban view supports the action helper and
display the folder icon with the helper text.
With this commit we have also provided the action helper support for
other views. The logic for no content helper has been moved in
abstract_renderer.js so that it can be accessed by all views. This was
done mainly to give the action helper to the gantt view.
closesodoo/odoo#53902
Task: 2284779
Related: odoo/enterprise#11563
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Before this commit, the action helper (if any) was not displayed when
archiving all records of the last non empty column of a kanban view
(making empty that view).
With the present commit, the action helper is now correctly displayed in
that situation.
Task ID: 2247788
closesodoo/odoo#50557
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Follow-up on 6edb749534, where default
`autocomplete` values were introduced as default for password fields,
according to the new autofill specs.
This patch allows developers to force the "autocomplete" attribute value
on password fields, in case there really is a need for a value that is
not `new-password` (which BTW now triggers the password generator wizard
in many browsers).
It is useful for example when a backend form really needs to ask the
user for their current password, so the correct `autocomplete`
value is `current-password`, as on the login form.
In pivot view, a cell data is determined by his row/column key which
are the value chain of field values to get to that row/column.
If you had a grouping with value in a cell and then close the grouping,
you could somehow get the old value back wrongly on next grouping
operations.
This happened because:
- the key was computed based on the value (eg. for relational field the
record ID) but without the field name.
- succeeding read_group only fill existing values.
eg. If on pivot view we had a salesperson with same ID as product
category, if we closed salesperson grouping then opened product
category grouping, we could possibly get the cell value to the product
category that has the same ID as the salesperson.
With this changeset, we clear the cell data corresponding to a grouping
that has been closed.
Added test without the fix would fail by displaying data of a previous
read_group that should have been cleared inbetween.
opw-2262306
closes#55129closesodoo/odoo#55936
X-original-commit: f1df73adca4955561814d4b8e90a62d7d50c1c33
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Before this commit, click on the divider in the menu 'Measures' of the
pivot control panel would cause a crash. The present commit fixes that
situation.
We also bring another small correction: the menu won't close if one
clicks on the measure list but not exactly on a menu item or the
divider.
closesodoo/odoo#55902
X-original-commit: aad9f3fd7499ef8b660cc25fea840a34d70f75a6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Before this commit, the field badge could overflow from its boundaries
and have part of its pill/text hidden.
Now, the "overflow" mixin has been applied and the badge is properly
contained.
closesodoo/odoo#55806
X-original-commit: f4b672bfcf21c7c7f0b6071a8dd18bd6e966266b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes in
community to have sample data in dashboard views.
Task ID: 2282196
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in pivot views.
Task ID: 2282196
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in graph views.
Task ID: 2282196
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
The present commit brings the global changes necessary to have sample
data in the reporting views. This includes several modifications/
fixes of the sample server (many of them for better visual results).
Task ID: 2282196
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
This commit changes the API of the SampleServer's mock
registry s.t. one can register a mocked version of a method,
whatever the model. The former API required a specific
model to be specified, and only applied on this model.
However, in order to enable the sample data feature on the
cohort view, the 'get_cohort_data' method needs to be
mocked, whatever the concerned model.
One can now register mocked methods for a specific
model only (with key 'model/method') or for every
models (with key 'method').
Task ID: 2282196
The SampleServer picks a random value for selection fields. As a
consequence, field 'activity_exception_decoration' is always set,
either to 'warning' or 'danger'. When this field is set, widget
'ListActivity' (set on 'activity_ids') displays 'Warning', whatever
the value of 'activity_ids'. This means that with sample data, the
next activity field always displays "Warning", which is not great.
This special case has been handled in web, as it is the first (and
only) one. In the future, if we have to implement several special
cases like that, we'll setup a proper hook to allow external
modules to define them from the outside.
Task 2316726
closesodoo/odoo#55703
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Before this commit, the search panel was subject to some inconsistencies
when dealing with a category having enabled counters and with a filter
defining a "domain" attribute. Indeed, the counters could be in an
incorrect state if the right filters/categories were not loaded first,
with no simple way in doing so.
The search panel being complex enough as it is, we decided to disable
all categories' counters in the presence of a filter having a "domain"
attribute regardless of said domain.
closesodoo/odoo#55734
X-original-commit: e78f777bd8ccb314b85451cbc8d1dd9109997d7a
Related: odoo/enterprise#12341
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit adds smart date inputs for date and datetime fields.
The goal of smart date input is to provide the user some shortcuts
when setting dates.
The rule is [+-]\d+[dwmy]?
So we can enter inputs like:
+3 to have today + 3 days
-2w to have today - 2 weeks
+1y to have today + 1 year
+5m to have today + 5 months
-4d to have today - 4 days
closesodoo/odoo#55602
Task: 2270347
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Form sheet with hidden overflow (added to improve ribbon widget css) prevents
emoji button from showing emoji list when clicked. This commit attempts to
show the complete emoji dropdown by removing overflow from the sheet container.
IMPORTANT : This override won't affect ribbon since the hidden overflow was
added on the widget itself.
Task ID-2224393
PR #49096
This commit adds the parameter `scales` in the calendar view's template.
This parameter can be used to choose which mode(s) is/are allowed.
This commit also refactors the way we manage calendar scales.
Before scales were defined in model and renderer, now it's defined
in the view and given to model, controller and renderer by params.
Task: 2193921
This commit reworks the mini calendar's style to make it look like
the months in year mode.
It also reworks the style of the calendar's popover in modes day,
week and month to reduce the differences with the year popover.
Task: 2193921
This commit adds a new year scale to the calendar view.
It comes with a new view in the calendar, this view displays a
4x3 grid which cells are month views.
Task: 2193921
This commit optimizes calendar view especially for year mode
- remove/add events has replaced by an event source and refetch.
- do not re-render events when navigating date
Task: 2193921