Remove the icon of the toast elements. Remove the header and move the
title in the body, as simple text. Move buttons at the bottom instead
of at the right side.
Note: this will be refactored with OWL anyway but this is a first step
towards more consistent tips across backend and frontend.
task-2311554
closesodoo/odoo#61756
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When using eg. arabic locale, the figures inside dates were replaced by
arabic figures which are not supported server side (they are almost
always sent in latin figures).
With this changeset, the we are using english locale to get date in
domains.
Without the change, added test fails with:
Numbers in domain should not use addoneForTest locale
Expected:...[date_field, >=, 2020-06-01], [date_field, <=, 2020-06-30]
Result:...[date_field, >=, 3131-17-12], [date_field, <=, 3131-17-41]
opw-2370392
closes#61354closesodoo/odoo#61443
X-original-commit: 74ea66a107cfc98cce8e52903ec21e3d752fb4fb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, with an opened DropdownMenu component, when the user
clicks on a Bootstrap's dropdown the DropdownMenu doesn't close.
This issue is due to a conflict between the global click listener
registered to close the DropdownMenu and the listener registered by the
Bootstrap dropdown:
the last one prevents the event from bubbling up to the `window` element
and be handled by the first one.
This commit fixes it by enabling the `capture` flag on the DropdownMenu
global click listener, giving it the opportunity to handling it properly
and close the DropdownMenu.
Note: this commit also fixes an issue when a dialog is opened from a
DropdownMenu (like the favorite's delete action) and prevents it from
closing in the background (e.g. when the dialog is still opened).
opw-1879566
closesodoo/odoo#60928
X-original-commit: 7f1bcc8ceb78729725f65585e923b08f94bf75b5
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Before this commit, when sub widget replaced its el, the ComponentAdapter
parent kept the previous el.
This caused some issues as in the ActivityRecordAdapter which lost its
event listeners when re-rendered.
This commit forces the ComponentAdapter to keep the new sub widget el
after being patched.
task id: 2360021
closesodoo/odoo#60521
X-original-commit: 393b5fd4cfba254ad054a526996e82922f9057e2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
When opening a DropdownMenu OWL component (like the favorite menu, filter
menu) positioned to the right of the screen (left on RTL languages) on a
small screen, the content of the dropdown could easily overflow out of
the viewport, making hard to use or even unreachable.
This commit fixes it by using the middle of the screen as a threshold to
align the dropdown menu to the right (or left in RTL) of the triggering
button.
Note: this fix specifically targets mobile-like/small screens as bigger
one like on desktop would require much precise calculations (and are
not an issue at the time of this commit).
Task ID: 1879566
When running the webclient in a regular environment, a 'o_touch_device'
class is set when ran on a touch-screen enabled device.
This commit adds the ability to simulate touch-screen when creating a
view inside a test (independently of the device), allowing tests to
match the reality.
Task ID: 1879566
The `remaining_days` widget is intended to be used for informative purpose,
hence it should not be editable.
opw-2362276
X-original-commit: 4c72b1536a19cd517046113a5ad93b5782774664
Introduced at 2f67881d45
Taken an event with
start_date: 2020-10-01
stop_date: 2020-10-02
allday: True
The date was displayed as "01/10 - 03/10 (2 days)" instead of "01/10 -
02/10 (2 days)"
closesodoo/odoo#60254
X-original-commit: 5eed28cf927bc504b103cc872712ab0e49830a38
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Steps to reproduce the bug:
- In Projects, switch to the calendar view
- Click a task
Bug:
Traceback here: https://github.com/odoo/odoo/blob/7ba47e7215df69b6556a848532e4f33ef4243e83/addons/web/static/src/js/fields/basic_fields.js#L2181
TypeError: Cannot use 'in' operator to search for 'invisible' in {}
Explanation:
We could change the inherited model of CalendarView from AbstractView to BasicView but it would be adding 400 lines of code to every calendar view. So, for now, and to keep it simple, we just parse the modifiers where it's needed to.
opw:2352436
opw:2352890
opw:2354039
closesodoo/odoo#59876
X-original-commit: 422c52a0823b1a53eeb974e76d08a44cacf4ea0a
Signed-off-by: backspac <backspac@users.noreply.github.com>
Commit e10fd34682 introduced batched reference fields name_gets
across groups but was also buggy as follows:
Have a grouped list view showing at least 2 groups
Have a reference field with different values showed in the list for each record
Before this commit, the name_get of those reference fiels were fetched only for the last group
After this commit, the name_get are fetched in a batched fashion (by model) for each group
and display correctly
closesodoo/odoo#59910
X-original-commit: bbb608a1eff638040f0fc7b951fedf1579cc15b2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Fix the design of he notification which is sometimes broken
(if there are lists or buttons display in it for example)
task-2346462
closesodoo/odoo#59776
X-original-commit: 238654ae53582d791154388c827f725c8d136612
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
A string parameter 'order' has been added to the "sortBy" function of
the utils module to decide in which order the array should be sorted.
The default is 'asc'.
Introduced a function that awaits for an additionnal rendering frame
initiated by the Owl compatibility layer processing.
By default a simple "nextTick" will handle the rendering of any widget/
component stuctures having at most 1 switch between the type of
entities (Component > Widget or Widget > Component). However more time
must be spent rendering in case we have additionnal switches. In such
cases this function must be used (1 call for each additionnal switch)
since it will be removed along with the compatiblity layer once the
framework has been entirely converted, and using this helper will make
it easier to wipe it from the code base.
Before this commit, the pager component would only quit the edit mode if
its value changed when hitting Enter.
Now, when pressing Enter while the pager value did not change, it will
leave the edit mode and trigger a "pager-changed" event regardless.
Task 2318738
closesodoo/odoo#59285
X-original-commit: a3197283d52bfda399ce45b7d5a52406885336d0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When manually updating the time on a daterange widget, the value sent to the
server is not converted to UTC and is sent as it appears on the input.
currently daterange widget send datetime value as it is, written in input field
if manually entered, so if user set 10:00:00 so while sending data it will be
send as it is 10:00:00 so when next time record reloaded after save, it will
display 15:30:00 if timezone UTC+5:30.
Instead, change the string date to moment object with current user timezone.
so that datetime send to server is UTC time and when next time it is loaded
it adds user timezone difference, so if timezone is UTC+5:30 and user enters
10:00:00 then while sending data to server it sends 04:30:00 and when displayed
again after reload it adds +5:30 timezone difference.
LINKS
PR #50132
Task 2240378
closesodoo/odoo#59263
X-original-commit: a029fca2d0def06ea3f67270f0e1d654d49a0c57
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit: the action menu registry items were rendered
regardless of their inner state. The problem is that these item
components can choose not to render themselves, leading to a blank
dropdown menu if no other item was present.
To fix this, the "getProps" function of the registry has been altered to
act as validation: the item will not be rendered if the return value is
falsy. The function has also been made asynchronous to allow RPC calls.
This solution is still flawed and hides a bad design choice which is to
register components and not items or item getters; this API is too
complex for its use case(s) and adds pointless depth to the DOM. The
shape of the registry should be simplified in an improvement in master.
closesodoo/odoo#59259
Task: 2325587
X-original-commit: 45c7d881a5d130f6b3222749c8c87b6c6b45e910
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
if readonly attribute is given on priority widget then priority widget should
not be clickable and hover effect should be removed so that user can easily
understand that field is readonly.
task-2339680
closesodoo/odoo#59199
X-original-commit: 53dbfc7a65a8eb2f41d6b2373cf628c4800d1f57
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since fbf347498f, when opening a view in a
dialog, the favorite filters were not loaded.
For example on the runbot:
1. In CRM, open any lead, edit it, and open the Customer dropdown
2. Create a custom filter, save it as favorite, and close the dialog
3. Open the dialog again: you don't see your new filter
With this commit, you will see your filter at step nr. 3
closesodoo/odoo#59186
X-original-commit: 418013e8dbb2aa2d4ffd4f650f080ca5a94183f9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
And other reported English mistakes in source string
Courtesy of Transifex translators
And remove leftover from gengo
closesodoo/odoo#59022
X-original-commit: 26efc84c5cac47a2cc83d7b084f8b71528fec6c7
Related: odoo/enterprise#13781
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Until now, the numpad decimal key was not properly handled for some
keyboard layouts.
This commit will ensure that when this key will get pressed inside a
numeric field, the user's display language decimal separator will get inserted.
closesodoo/odoo#56962
Taskid: 1913999
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
An older commit (50bf8309) had refactor part of the basic field _applyX2ManyOperations.
During this refactor, the reference field was forgotten to be included
in a condition that made the field no longer do the quick create behavior.
The name_create function in the backend was no longer called.
Adds a test for the reference field checking the call to the name_create
function and fixes the problem.
Task id 2322048
closesodoo/odoo#59044
X-original-commit: 1400b0b9f46a86254c166b422a0b23ed3b3c7a24
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, when editing a column in a kanban view, in project
for instance, the translations weren't loaded.
Now, the translations are correctly loaded.
opw-2340125
closesodoo/odoo#58984
X-original-commit: e95ed1253817beccb76d1fbd55b1318b3d65cfe5
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
In general, the last actionManager's operation has priority over hanging previous ones.
This means that the order of the RPC's done by the actionManager is deterministic.
i.e. load_action, load_views
However, when testing the concurrency, some RPC of an hanging actionManager operation
(in this case a switchView to a form triggers a 'read'), may be fired anyway. Those are superfluous
but irrelevant as long as the last displayed item is the one last asked by the user.
This commit fixes the test 'execute a new action while switching to another controller' to not be bothered
with an irrelevant controller's RPC messing with the orders of RPC.
This is admittedly brutal, but justified with the current implementation of actionManager.
closesodoo/odoo#58983
X-original-commit: 4344d50a74b04ffed7a7113e8af2b8ad6800693e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
PR #45400 disabled the export feature for those who were not in
group 'base.group_allow_export'. However, it only considered the
'Export' link in the actions menu. In list view, an export button
was still displayed in the control panel (next to 'Create'),
whether the user was in the group or not.
This commit fixes this issue.
Task 2348571
closesodoo/odoo#58920
X-original-commit: 7925e30482ad0df4b2a004c223c3eb87f3ce725f
Related: odoo/enterprise#13730
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
After each test, a check is done that there is no leftover in the
DOM. If there are, the suite fails, but there is no indication on
the test that left elements in the DOM.
This commit logs that missing information. We also stop dumping
the DOM when this happens, as it was rather creating noise than
providing useful information (the remaining elements are still
logged though).
closesodoo/odoo#58806
X-original-commit: 598d036b59012af0a95894d759fe3b6276fc8ccb
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Also fix an issue with livechats not being considered in 'chat'
filter of messaging menu.
Task-Id 2282426
closesodoo/odoo#58468
X-original-commit: 631e52536964763bbfe857305f023e5e67084e95
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
- avoid updating default position list in place
- ensure computed position takes into account enough margin with border
- fallback to requested position instead of bottom
Part of task-2270731
closesodoo/odoo#58370
X-original-commit: 3fad17421518732db2085c3eec596600cfe34f03
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
When one constucts a custom filter in the search view and clicks
on the "ADD A CONDITION" button, the new condition dropdowns always
start with the top of the lists.
This commit will instead default a new condition to the same field and
operator as the previous one.
Presetting the dropdowns used in the previous condition is a better
guess for what a user tries to filter than starting the dropdowns each
time at the top of their lists.
closesodoo/odoo#56918
Taskid: 2222545
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, selecting the whole content of the custom filter
input and releasing the cursor outside of the dropdown closed the
dropdown.
With this commit, the dropdown is kept open in this situation.
task - 2276544
closesodoo/odoo#57807
X-original-commit: 450e0ec45005c3d6c2e8475e134113a7d8515e9f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Issue was spotted in list views containing the "badge" widget with
decorations (e.g. in the Purchase Order list view). At first, the
decorations were correctly applied, but they weren't anymore after
a reload (e.g. after toggling a filter).
They weren't because the list renderer didn't called
'on_attach_callback' on its subwidgets at reload (thus, 'mounted'
wasn't called on its subcomponents, and the decorations are applied
in the mounted hook).
This commit moves the logic from the FormRenderer to the
BasicRenderer, so that it applies on List, Kanban, and Form views.
This commit also removes the transition scss rule on the badge
field widget as it caused a flickering at reload.
Task 2336440
closesodoo/odoo#57766
X-original-commit: 713bce22e8f412f2c26e663b9e30fdd64933ff0c
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Currently, dialog is generic for all x2many tree and there is no
option to prevent the dialog in readonly for x2many tree.
So in this commit, we add new option 'no_open' for x2many tree to
prevent the dialog.
closes odoo/odoo#55255
Taskid: 2295969
Closes: #55255
Related: odoo/enterprise#11994
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Let's assume a list that is multi editable and contains a m2m field
displayed with widget many2many_tags. Moreover, there are enough
values in the comodel s.t. the 'Search More' option is available
in the many2many_tags dropdown, and field 'display_name' isn't
in the list view that opens in dialog.
Enter multi-edition, edit the many2one field to add a value
(click on 'Search More', and pick a value from the list): the
picked value isn't correctly displayed in the confirmation dialog.
The issue occurred because we didn't wait for the display_name to
be fetched before opening the dialog.
Task : 2150384
closesodoo/odoo#57483
X-original-commit: ccf5834045d8b4fff9af7ddf60814c3a640e8318
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Dhruv Patel <dhp@odoo.com>
Was not super visible, especially without HR as the dialog immediately
closes (limitation of the web client), or when an administrator user
massively disables totp.
Show a toast notification indicating the success of the action.
Also fix the logging of `totp_disable` so it correctly handles being
called on more than one record, and change the logging data to
<browse_record> (<logins>) across the board.
Also add a way to provide an action to execute after a notification:
by default nothing happens, which leads to dialogs not closing and
forms not reloading, and there is no good way to show a notification
and/then do some other thing, which is inconvenient.
This issue only occurred in community.
Steps to produce:
1) Create/Edit any record.
2) Change the menu using menu switcher
3) You will get the discard dialog at the instance and after some
time it will also display another duplicate discard dialog.
So, we have one extra redundant discard dialog on menu switching.
It is working fine when we have dirty form and then click on the
breadcrumb or click on any internal child menu.
Task : 2312437
closesodoo/odoo#57359
X-original-commit: df37ce50e847e3489eb43d1ef6fc1bac6d6af333
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Let's assume a kanban view using a custom form view to quick
create record:
<kanban on_create="quick_create" quick_create_view="view_ref">
Before this commit, there was a raise condition that could lead
to a crash. For instance, click to quick create a record in a
given column, and while the form view is loading, fold the column.
Issue reported on task 2323196
closesodoo/odoo#57322
X-original-commit: 9fed69b9e0e13652fd17e9a7c7c8dd838e2f22ed
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Have a kanban with a filter
Quick create a record in one column that won't match the domain
Before this commit, the noContent helper was displayed. This was because
the count of the group was reset to zero after the web_read_group call.
After this commit, the noContent helper is not displayed.
Note that in the quick_create situation, the records are not re-fetched
i.e. there is no search_read after the read_group.
Task-id 2251734
closesodoo/odoo#57247
X-original-commit: 0e12fa135882cd5095dbf15fe2f64231c6a84336
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
before this commit, widgets which has specialData attribute
e.g.many2manyattendee were not supported in calendar popover, as widgets with
specialData attribute are meant to be supported in form view.
after this commit, widgets with specialData attribute can be added in calendar
popover, specialData method is called explicitly from calendar_popover to fetch
special data required to render such widgets.
with this commit we also did miscellaneous improvement in many2manyattendee
- many2many_attendee status widget bullet not aligned with attendee name, with
this commit bullet is aligned with attendee name.
- if many2many_attendee does not have status value then do not display status
else blank space is displayed before attendee name.
- in community tentative status color in many2many attendee tags widget has
o-brand-secondary color which is almost light grey, so due to badge light grey
color and tentative status light grey color status is not displayed. To fix
this issue, set tentative status color to simple grey which is bit dark then
badge background color.
task-2058767
closesodoo/odoo#46396
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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>
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>
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>