Commit Graph
10737 Commits
Author SHA1 Message Date
Julien Mougenot 07a0a0f5bc [FIX] web: Disables pager on enter
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

closes odoo/odoo#59285

X-original-commit: a3197283d52bfda399ce45b7d5a52406885336d0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-10-06 13:29:28 +00:00
Priyanka Kakadiya 5d7165d4f2 [FIX] web: send utc date to server from daterange widget
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

closes odoo/odoo#59263

X-original-commit: a029fca2d0def06ea3f67270f0e1d654d49a0c57
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-10-06 12:27:26 +00:00
817ce7ae5a [FIX] web: hide action button when no action
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.

closes odoo/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>
2020-10-06 11:38:27 +00:00
Mohammed Shekha 6dd4aca6b4 [FIX] web: do not allow to edit priority field if readonly
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

closes odoo/odoo#59199

X-original-commit: 53dbfc7a65a8eb2f41d6b2373cf628c4800d1f57
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-10-06 08:18:22 +00:00
Paul Morelle def4f727b7 [FIX] web: load_filters in search dialogs
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

closes odoo/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>
2020-10-06 07:43:04 +00:00
Mohammed Shekha 657ef8ad7f [FIX] web: show no content helper message in center
no content helper message is displayed in bottom in modal when there is sample
data, when no content helper message is displayed in modal and there is sample
data the ndisplay no content message in center which is not the case for modal.

To produce this issue: go to Expense -> Create Expense -> Create expense line
and if there is not expense line then sample data is displayed and no content
helper message is displayed at bottom of sample data, it should be displayed
in center of sample data with blurry effect.

With this commit this issue has been fixed.

Task-2311408

closes odoo/odoo#59175

X-original-commit: 5461efc9620a6ff6f0d61cd2a15676c6b9c58fd7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-10-06 07:06:19 +00:00
Bruno Boi e654b32bc1 [IMP] web: use user's decimal separator for numeric fields
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.

closes odoo/odoo#56962

Taskid: 1913999
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-10-05 08:21:00 +00:00
Simon Genin (ges) 2cb2e9c2a2 [FIX] web: reference field calls name_create
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

closes odoo/odoo#59044

X-original-commit: 1400b0b9f46a86254c166b422a0b23ed3b3c7a24
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-10-03 11:08:35 +00:00
Jorge Pinna Puissant d27b07e565 [FIX] kanban: adding context when editing column
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

closes odoo/odoo#58984

X-original-commit: e95ed1253817beccb76d1fbd55b1318b3d65cfe5
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-10-02 11:35:26 +00:00
Aaron Bohy 6d99a50012 [FIX] web: no export button if user not in export group
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

closes odoo/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>
2020-10-01 07:20:56 +00:00
Christophe Monniez e6eac65e4a [FIX] web: skip map views and increase timeout in click_all
During the click_everywhere test, the map views are tested but leads to
random failures when the view takes too long to load.

Moreover, the map resources are queried on external nominatim.org
servers. This could lead in the test runner being black-listed by
nominatim and more indeterminism as those servers are not under our
control.

For those reasons, this commit will skip the map views in the
click_everywhere test.

Also, the general time limit is increased. Five seconds was sometimes
too short, depending on external conditions (e.g.: server load or
screencast enabled).

Finally, on a database with all apps installed, the `Settings` menu of
some apps loads the full settings and it can takes a huge amount of time
to load on a clean browser (as in the tests). For that reason, the time
limit for the test of those menus was also increased.

closes odoo/odoo#58750

X-original-commit: 2f3ea94a46fde9870db6b6b1d6a4233aaff805ce
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-09-28 21:57:07 +00:00
Benjamin Vray 963f0ed02e [FIX] web, web_editor: fix scroll to hidden dropped snippets
Fix the scroll when the snippet is the dynamic one because it did not
work as we tried to get the offset of an element with the d-none class.

Remove the scrollValue variable because we don't need it anymore.
It was used before the code was reviewed in a previous commit.

task-2312878

closes odoo/odoo#58486

closes odoo/odoo#58530

X-original-commit: e6d32bc4bfa7f0c3c2f82c2eb99a562c1cb93d83
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-25 13:43:26 +00:00
qsm-odoo 9cf8b97fe4 [FIX] website, *: review modal behaviors with right-panelization
*: web, web_editor

Since the right-panelization made with [1], the modals were not
compensating the body scrollbar when opened anymore and the backdrop
was misplaced. This commit fixes the problems generically, to support
modals with non-body scrolling.

[1]: https://github.com/odoo/odoo/pull/57975

closes odoo/odoo#58442

X-original-commit: ebd0c90a146145079061e79c2d4c37fa182a2975
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-25 08:56:52 +00:00
Julien Mougenot 3a164fb884 [FIX] web: Props validation
Established the proper props validation on the search panel component.

closes odoo/odoo#58484

X-original-commit: d1ccc2a57c0adddecad2725831be7ab18f20f522
Related: odoo/enterprise#13541
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-09-25 07:56:34 +00:00
qsm-odoo 586a5ce3a9 [FIX] web: remove 'overlay' overflow on modals
The o-scrollbar-overlay mixin was introduced for a fix on the enterprise
home menu (see related commit in enterprise that comes with this PR).
It was used on modal elements at the same time for no apparent reason:
the modal in the backend do not even scroll as this is their modal-body
that does.

This now introduced a bug in the frontend: some code which allows to
scroll to an element in a modal was not working on chrome because the
related code was checking for the element with 'overflow: auto'... which
it could not find since that element uses 'overflow: overlay'. As
overlay is a deprecated value, it seemed better to remove its use rather
than adapt the frontend code expecting the 'auto' value. This also solve
a design inconsistency between Chrome and Firefox (where the overlay
value is simply ignored).

closes odoo/odoo#58462

X-original-commit: 5ffb7bb2f461de2b3cf95ef0df6a24b668bf9bd3
Related: odoo/enterprise#13532
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-24 16:33:57 +00:00
Luis González ebe118fc60 [FIX] web: Get correctly focusable elements on selection widgets
When navigating fields using the keyboard, it's not possible to reach
most of widgets for selection fields. That is because most of them
consist of one main element containing several other ones, one per
possible selectable value (e.g. buttons). When their focusable element
is computed, the main element is taken, instead of its sub-elements,
which causes the field to be skipped when navigating.

This commit fixes the above, as well as some missing aria attributes and
keyboard events, for the following widgets:
- `priority`
- `state_selection`
- `statusbar`
- `radio`

opw-231112
closes #58302

closes odoo/odoo#58421

X-original-commit: 2471e7c176c5df0f310f2939f8a6cf6948c0ac0c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-09-24 12:17:31 +00:00
std-odoo 03222094a0 [FIX] web: fix the width of the color picker widget
Purpose
=======
Since cb55b30293 we set a fixed
width for the color picker widget in readonly mode. This value
is quite huge and cause issue in saas-13.5 in the event track
form view.

Task-2320370

closes odoo/odoo#58379

X-original-commit: f24e7739d4c40c041bd768515f47d545e78ea522
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-09-24 07:33:21 +00:00
Sébastien Theys b519205ca0 [FIX] web: properly compute popover position
- 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

closes odoo/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>
2020-09-23 17:32:35 +00:00
Sébastien Theys 0ff9eb7307 [FIX] web, mail: recompute popover on content change
Because the position of the popover depends on the size of its content.

Part of task-2270731

X-original-commit: 3066a946ef1ca0973503207d0486515798168fa2
2020-09-23 17:32:33 +00:00
qsm-odoo 9f048625e1 [IMP] website, *: move page scrollbar to #wrapwrap
*: web, web_editor, portal, account, website_blog, website_forum

This is probably not ideal to move the scrolling behavior out of the
html element but this will be needed for the editor to not have a double
scrollbar on the right. This is actually also useful for the scrollbar
to appear under the purple odoo menu instead of its right.

This commit, if to be reverted in the future, however contains many
improvements to make the transition easier that should be kept: jQuery
and Odoo functions to be able to scrollTo a specific element, get the
top scrollable element, check if an element is scrollable, etc. Also,
some magic was done: if some code tries to scroll to a specific scroll
position via jQuery's scrollTop or animate functions on the html/body
element, those will still work as intended (obviously, using the new
utils to do that is however recommended).

This commit also reviews our scroll behaviors to make them more robust
and share the code.

Part of https://github.com/odoo/odoo/pull/57975
task-2344227

X-original-commit: 4e7be69825163c0a0ff41c882a196fc7f3158fb3
2020-09-22 10:09:36 +00:00
Bruno Boi cd8686f5f8 [IMP] web: default custom OR filter to previous
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.

closes odoo/odoo#56918

Taskid: 2222545
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-17 07:51:18 +00:00
Aaron Bohy c065178e16 [FIX] web: handle concurrent actions at startup
This commit aims at fixing a random bug on the runbot.

When loading the webclient, if there is no hash, a rpc is done to
read the default action of the user. When this rpc comes back, we
execute the given action (if any), or the first action (typically
Discuss). The navbar is displayed as soon as possible, it doesn't
wait for the first action to be executed. This means that the
user can open the user menu and click on 'My Profile' before the
first action is executed.

Before this commit, if the user clicked before the read rpc on
'res.users' returned, the default action (or the first) one, was
executed, even though the user clicked on 'My Profile' and thus
asked for a specific action. So basically, the user form view was
briefly shown, and then replaced by the default or first action.

Whereas this is a very rare usecase in practice (the timing is
really short), this sometimes made the totp tour fail. However,
even if it is unlikely, the client must be robust and correctly
react to concurrent requests.

This commit fixes the issue by executing the 'My Profile' action
in the DropPrevious. That way, if any 'doAction' is performed,
other pending operations (also done in DropPrevious) are dropped.

This commit also ensures that the "brand name" part in the navbar
(containing the name of the current app) is hidden when there is
no current app, as in the scenario described above, we land in
a webclient with no current app. Note that not being in an app was
something that was already handled, but not at startup.

closes odoo/odoo#57913

X-original-commit: 9ad4a3d4b735e9666034a60f4349e3fea46fed61
Related: odoo/enterprise#13314
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-17 08:09:00 +00:00
Hardik PrajapatiandMohammed Shekha ed53db792a [FIX] web: prevent dropdown closing on mouseup
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

closes odoo/odoo#57807

X-original-commit: 450e0ec45005c3d6c2e8475e134113a7d8515e9f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-09-16 09:38:43 +00:00
Aaron Bohy 36da1799b5 [FIX] web: list: call mounted on subcomponents at reload
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

closes odoo/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>
2020-09-16 05:59:27 +00:00
hku-odoo 799619182b [FIX] web: fix picture glitch
currently, whenever the view is change the picture zoomed in
and still displayed, only disappears after having refreshed the page

so, in this commit the employee picture should no longer to be
zoomed in whenever change the view

closes odoo/odoo#57576

Taskid: 2311308
X-original-commit: 8214332ccd86e52c4f18de8d5428a1a22f2ad21c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-11 16:57:02 +00:00
Laurent Stukkens (LTU) 4ad779b07f [IMP] web, website: prevent auto scroll from left panel
* Prior to this commit, when starting to drag a new snippet from
  the left panel, the auto scroll feature was triggered if the
  snippet was one of the top or bottom ones.

* After this commit, the auto scroll feature will be disabled from
  the left panel.

task-2307404

closes odoo/odoo#57449

X-original-commit: f1f48cdaab3dd7847e8546ad9887f24a9e2ed4c1
Related: odoo/enterprise#13139
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-10 15:04:00 +00:00
Nisha patel 22c52e8edf [IMP] web: Prevent the dialog for x2many readonly list view
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>
2020-08-27 11:00:19 +00:00
Aymane (ayt) f61a123ece [FIX]Web:background parm independent of zoom param
Setting the Zoom parameter for the image widget is no longer required to be able to use the background parameter.
This has been done to accomodate changes required for Task#2296173 as setting the zoom value to false was preventing proper display of the employee image.

closes odoo/odoo#55966

Related: odoo/enterprise#12437
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-01 09:40:38 +00:00
Mohammed ShekhaandDhruv Patel 8c2eda42f9 [FIX] web: blank value in many2many_tags for multi_edit popup
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

closes odoo/odoo#57483

X-original-commit: ccf5834045d8b4fff9af7ddf60814c3a640e8318
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Dhruv Patel <dhp@odoo.com>
2020-09-11 08:56:11 +00:00
wan 421acfcbb2 [IMP] web: add the raw value of selection fields
Task 2327599

It is used in the selector of a tour to know the type of a document.
2020-09-10 12:32:21 +00:00
Xavier Morel 6f4f8f0265 [IMP] auth_totp: notify user on activation and deactivation of OTP
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.
2020-09-10 12:49:00 +00:00
f12751aee3 [FIX] web: no more double discard dialog
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

closes odoo/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>
2020-09-09 13:16:39 +00:00
Aaron Bohy 4e61415994 [FIX] web: kanban quick create: fix raise condition
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

closes odoo/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>
2020-09-09 07:59:13 +00:00
Hardik Prajapati a080882fb1 [FIX] web: remove uppercase under Favorites
this commit removes unnecessary uppercase used under the favorites menu

task - 2325684

X-original-commit: 3dcab1845001c4dbf1161fb38c540cb0184d35b8
2020-09-09 07:30:46 +00:00
Lucas Perais (lpe) 68ef4b6eb7 [FIX] web: avoid displaying noContentHelper after kanban quick_create
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

closes odoo/odoo#57247

X-original-commit: 0e12fa135882cd5095dbf15fe2f64231c6a84336
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-08 11:12:03 +00:00
Mohammed Shekha 47b0c0d2d4 [IMP] web,calendar: display attendance status widget in calendar popover
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

closes odoo/odoo#46396

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-07 13:06:41 +00:00
Aaron Bohy 7c7b478220 [FIX] web: list: do not call on_attach_callback at reload
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 #56701

closes odoo/odoo#57101

X-original-commit: 78f361fb5382e4c7aed9a4e705e20f8d8757300d
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-04 13:40:44 +00:00
Aaron Bohy 56be6fa612 [FIX] web: form: Archive action when field not in view
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] 220eb4db39

closes odoo/odoo#57041

X-original-commit: 97b70aab69b491443d862847fbff69c4e29274af
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-03 14:22:23 +00:00
Simon Genin (ges) 618067aa3f [IMP] base: Document layout preview improvements
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

closes odoo/odoo#56995

X-original-commit: c121a246f16899735306266a3a12b526e08e7620
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-09-03 08:44:35 +00:00
Adrien Dieudonne 4a8ff2ab2c [FIX] web: preview PDF file on iOS
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

closes odoo/odoo#56977

X-original-commit: 0d41d0daa7220a791bc4df85cca4100e3634e432
Related: odoo/enterprise#12907
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-09-02 16:24:13 +00:00
Victor Feyens 1aa874aab3 [IMP] web: new widget for static image urls in char fields
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).
2020-09-02 13:57:23 +00:00
Sébastien Theys f5cdc6414c [FIX] web: fix style of form view in modal
task-2302721

closes odoo/odoo#56934

X-original-commit: 7c4787a1431538ddb69bfbc50a27dd033437a6a4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-09-02 10:58:10 +00:00
Mohammed Shekha 75f6dcb8b1 [FIX] web: do not display nocontent help if empty
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

closes odoo/odoo#56883

X-original-commit: 3d6bdc5b01a4a94de9baa9bae230e6b34f38dbc9
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-09-01 12:14:05 +00:00
Kamesh Patel 0e8d2f4f15 [FIX] web: emptylist helper position
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

closes odoo/odoo#56792

X-original-commit: d50c7f5c88eaef56c757849a64d63f92bd73f2f2
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-31 11:14:27 +00:00
Pierre Collinet (pic) 26ada8aea0 [IMP]hr_recruitment: adjustments for the onboarding tour
- 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.

closes odoo/odoo#56562

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-26 09:23:18 +00:00
Cocographiqueandqsm-odoo 9ee35cf23e [IMP] website, *: add style options for navbar links
*: web

Part of https://github.com/odoo/odoo/pull/56427
task-2264627

X-original-commit: 3f7e2949aef56d66b46417206b539f5ca74a1aae
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-28 08:19:35 +00:00
stefanorigano (SRI)andqsm-odoo a65407b9c3 [IMP] website, *: add off-canvas and other hamburger menu options
*: web, portal

Part of https://github.com/odoo/odoo/pull/56427
task-2264627

X-original-commit: 89bf0d4170f42b40cd46915c7d0160c4818f3b8f
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-28 08:19:35 +00:00
qsm-odoo e1beebebef [FIX] web: make BS more robust with customized input groups
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
2020-08-28 08:19:31 +00:00
qsm-odoo 3ee78f1523 [FIX] web: implement more complete menu autohiding feature
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
2020-08-28 08:19:30 +00:00
Mohammed Shekha e89423b2a6 [FIX] web: ribbon in form doesn't overlap kanban state
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

closes odoo/odoo#56579

X-original-commit: d701317a6c3ba002e935f8b30ce160cc186c239a
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-08-26 11:40:57 +00:00