Commit Graph
2061 Commits
Author SHA1 Message Date
Benjamin Vray b42ad68c2c [IMP] web: redesign toast
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

closes odoo/odoo#61756

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-16 09:05:34 +00:00
Nicolas Lempereur 795c6723df [FIX] web: use latin number date domain in comparison menu
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 #61354

closes odoo/odoo#61443

X-original-commit: 74ea66a107cfc98cce8e52903ec21e3d752fb4fb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-11-05 17:44:49 +00:00
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Romain Estievenart 9348cca0f2 [FIX] web: DropdownMenu autoclose behavior should match Bootstrap
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

closes odoo/odoo#60928

X-original-commit: 7f1bcc8ceb78729725f65585e923b08f94bf75b5
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-10-28 17:22:48 +00:00
Michael Mattiello (mcm) 3f826e4eaf [FIX] web: keep new widget el in ComponentAdapter
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

closes odoo/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>
2020-10-22 11:06:16 +00:00
Romain Estievenart e1f605bef8 [FIX] web: avoid to display dropdown outside of the screen on mobile
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
2020-10-21 14:45:40 +00:00
Romain Estievenart a35dab5653 [IMP] web: allow to simulate a touch-screen when creating a test's view
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
2020-10-21 14:45:40 +00:00
Nicolas Martinelli c0501bf54c [FIX] web, doc: remaining_days widget
The `remaining_days` widget is intended to be used for informative purpose,
hence it should not be editable.

opw-2362276

X-original-commit: 4c72b1536a19cd517046113a5ad93b5782774664
2020-10-20 06:08:32 +00:00
Martin Trigaux 60134be18d [FIX] web: correct count of day
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)"

closes odoo/odoo#60254

X-original-commit: 5eed28cf927bc504b103cc872712ab0e49830a38
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-19 10:50:39 +00:00
Prakash Prajapati 1edd61c160 [IMP] web: The float_toggle widget button appear in the kanban view
Currently, float_toggle widget is not applied in kanban view because kanban
the view has read-only mode.

So in this commit, enable the button to the kanban view.

closes odoo/odoo#53782

Task-id: 2264613
Related: https://github.com/odoo/enterprise/pull/11497
Related: odoo/enterprise#11497
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-23 09:48:15 +00:00
nie 54e116269c [FIX] web: Find key in stringified JSON
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

closes odoo/odoo#59876

X-original-commit: 422c52a0823b1a53eeb974e76d08a44cacf4ea0a
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-10-15 10:04:59 +00:00
Lucas Perais (lpe) 54260b1dd0 [FIX] web: fetching reference fields' name_get batched in grouped list
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

closes odoo/odoo#59910

X-original-commit: bbb608a1eff638040f0fc7b951fedf1579cc15b2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-10-13 16:21:34 +00:00
Jérémy Hennecart b6f6a0dacd [FIX] web: fix notification design
Fix the design of he notification which is sometimes broken
(if there are lists or buttons display in it for example)

task-2346462

closes odoo/odoo#59776

X-original-commit: 238654ae53582d791154388c827f725c8d136612
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-12 15:18:22 +00:00
db39211b46 [REF] web: owl graph renderer
We convert the GraphRenderer widget to an OWL component.

Task ID: 2090967

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Florimond Husquinet <fhu@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-10-12 07:43:43 +00:00
Julien Mougenot 3041d81135 [IMP] web: Allow asc/desc order in utils.sortBy
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'.
2020-10-12 07:43:43 +00:00
Mathieu Duckerts-Antoine 12ae5ef8e3 [IMP] web: owlCompatibilityExtraNextTick
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.
2020-10-12 07:43:43 +00:00
Nicolas Martinelli 9d36b03cbe [FIX] web: report controller in multi-company
- Create 2 companies A & B
- Set a website on company A
- Switch to company B
- Open a done MO
- Open the cost analysis

An AccessError is displayed.

The error arises in:
https://github.com/odoo/enterprise/blob/923cbffe4e60572a5c17ee962d571c037e9cff44/mrp_account_enterprise/reports/mrp_cost_structure.py#L90

The root cause is coming from the call to `/report/html/`, which is
called without any `data`. In this situation, the following adds an
incorrect `allowed_company_ids` in the context:

https://github.com/odoo/odoo/blob/d1413a2f06bcb44b1fbb6dba8658e698c8da4018/addons/website/models/ir_http.py#L196-L205

Indeed, the `allowed_company_ids` is the one from the website, in this
case company A.

The issue doesn't occur when downloading a PDF from the interface since
in this case the `data` dictionary contains the appropriate context
which is set in:

https://github.com/odoo/odoo/blob/d1413a2f06bcb44b1fbb6dba8658e698c8da4018/addons/web/controllers/main.py#L1958

As a solution, we add the `user_context` in the `/report/html` route.

opw-2341747

closes odoo/odoo#59663

X-original-commit: 932e347a90bfd4bf025e4e8e54ef9c66cc49c5d0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-09 14:31:20 +00:00
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
Martin Trigaux 2683184aa6 [FIX] *: fix all the typos
And other reported English mistakes in source string
Courtesy of Transifex translators

And remove leftover from gengo

closes odoo/odoo#59022

X-original-commit: 26efc84c5cac47a2cc83d7b084f8b71528fec6c7
Related: odoo/enterprise#13781
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-05 09:36:34 +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
Lucas Perais (lpe) 9076c0190c [FIX] web: action_manager_tests: concurrency doAction: relax rpc assert
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.

closes odoo/odoo#58983

X-original-commit: 4344d50a74b04ffed7a7113e8af2b8ad6800693e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-10-02 11:21:45 +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
Aaron Bohy c4bddd6ba2 [IMP] web: qunit: always log name of failing test
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).

closes odoo/odoo#58806

X-original-commit: 598d036b59012af0a95894d759fe3b6276fc8ccb
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-29 12:03:40 +00:00
Alexandre Kühn 7a0aecfca9 [FIX] im_livechat, mail, website_livechat: open chat website visitor
Also fix an issue with livechats not being considered in 'chat'
filter of messaging menu.

Task-Id 2282426

closes odoo/odoo#58468

X-original-commit: 631e52536964763bbfe857305f023e5e67084e95
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-09-24 18:25:12 +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
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
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
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
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
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
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
Mohammed Shekha 954fd0e75e [IMP] web: do not resize quick create form on window resize
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

closes odoo/odoo#56521

X-original-commit: f9c605ea578267de17e6c1dcc69dfd179d5d95fe
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-08-25 13:45:01 +00:00
Hardik PrajapatiandMohammed Shekha 9879f738f5 [FIX] web: open list optional fields dropdown position to right place
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

closes odoo/odoo#56516

X-original-commit: 5a044593ba1f8f08f72de502d77823a8dd5175a0
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-08-25 13:02:29 +00:00