Commit Graph
13951 Commits
Author SHA1 Message Date
Adrien Dieudonne df1d279cbc [IMP] web: form: checkbox with optional field on mobile
This commit adds a class to be able to show/hide
other fields depending on a checkbox status.

This class is needed to have this behavior on desktop but also
on mobile.

Related task-ID: 1929043
2021-02-16 09:41:12 +00:00
Benoit SociasandSamuel Degueldre caaaaa0785 [FIX] web, web_editor: avoid rendering color palettes more than once
Before this commit the palette was rendered each time it was opened.

After this commit if the palette has already been rendered only the
selected color is being updated in the palette (and its colorpicker).

task-2439295
https://github.com/odoo/odoo/pull/65223

X-original-commit: 7f19f63b18bc7d17a393b3535492c7f90595ca39
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-02-15 18:30:09 +00:00
Mohammed Shekha 2d2019d4d2 [FIX] web: keep focus on searchbar when Tab pressed
before this commit: when searchbar has autocomplete and user press Tab key then
focus goes out of searchbar input while it should keep focus on searchbar so that
user can do search on other term.

after this commit: when searching on searchbar and pressing Tab key will keep focus
on searchbar input so that user can search again.

task-2393772

closes odoo/odoo#66239

X-original-commit: ae90842be8a87999e0cdbbf00b86b1bbf92992ce
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-16 07:53:44 +00:00
Mohammed Shekha 9f870f83b2 [FIX] web: fix horizontal scroll position not preserved
before this commit: when there is a horizontal scroll in view say for example
kanban view where there are too many columns and user scrolls horizontally and
go to form view by clicking on any record and then come back to kanban view
horizontal scroll is not preserved and user is moved to scroll position 0
this is due to commit: https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242

after this commit: scrolling horizontally and then go to form view and come
back to previous view will preserve scroll position, we also consider case for
kanban view where there are too many columns and user click on 'Add Column'
user will be scrolled to new column element.

task-2418275

closes odoo/odoo#66230

X-original-commit: 171036aefe21799f7a791cc3cd73a7d249aa0b00
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-15 20:06:09 +00:00
Nicolas Lempereur e539f3307a [FIX] calendar: currency in popover fullcalendar V4
The update of fullcalendar (ebce7719b) in 14.0 made #45881 not working
(they both happened in same month).

opw-2214445

closes odoo/odoo#65503

X-original-commit: 3ad005a49e44ce35800edcb8a178fc3544d99633
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-04 07:48:30 +00:00
Lucas Perais (lpe) 717112f28d [FIX] web: multiedit in a grouped list view: enable fetchBatchedM2O and References
Have grouped list with reference a m2o or a reference field

Select some records, edit them

Before this commit: the names of the reference fields and m2o disappeared

That was because the saveRecords function did not take into account a grouped list

manual forward port of #65999

After this commit: it works as expected

closes odoo/odoo#66043

closes odoo/odoo#66175

X-original-commit: 8b6e86927941dce2018ea93f191b59856ea67e4b
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-02-15 13:46:45 +00:00
Lucas Perais (lpe) f31c34356e [FIX] web: list multi edit: prevent force save
Have a list with multi_edit enabled
Have a widget boolean_toggle displayed on some field
Select some records to be in multi edit mode

Before this commit, the record on which the boolean toggle button was clicked was written
and then the multi edit feature was triggered and wrote on all the records
The first write is unnecessary and counter intuitive

After this commit, only the write with all the multi edited records is done

X-original-commit: 23fcaeda6830f2dc0de17337f9c3da8faf0338ce
2021-02-15 13:46:44 +00:00
Lucas Perais (lpe) 97756072bb [FIX] web: list_test: an assert was not triggered, now it is
follows #59830

X-original-commit: e1fc6707ed4ddfe7c62e6beead8617e5fbe6ea9b
2021-02-15 13:46:43 +00:00
Mohammed Shekha a036f5ccf4 [FIX] web: horizontal scrollbar in form without sheet
before this commit: when form view have buttonbox or notebook tag and form does
not have sheet tag then form will have horizontal scrollbar in screen, this is
because we added scss mixin which always add negative margin of 32px because we
added mixin by considering form will have sheet tag and because of that when
form does not have sheet tag it shows useless horizontal scrollbar.

after this commit: if formview does not have sheet tag and form contains button
box or notebook tag then form will be displayed properly without unnecessary
horizontal scrollbar.

task-2411627

closes odoo/odoo#63961

Related: odoo/enterprise#15519
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-15 11:43:32 +00:00
Odoo's Mergebot 24e11acf22 [MERGE] *: Add support for native JS modules and sourcemaps
Because of the way Odoo works at its core, we do not know before hand
which files will be loaded as an asset in the browser, because it
depends on the installed Odoo addons.  This is why it is historically
difficult to integrate Odoo with standard JS tooling, and this is why
Odoo needs to use a custom javascript module system.

However, there is a way to use native JS modules (and gain all the
benefits from it: IDE autocompletion, ease of refactoring, intellisense,
...): we can write JS as native JS modules, but convert them at runtime
into Odoo custom modules. This is exactly the strategy applied by this
PR.

This has a lot of benefits, but there is a downside: we can no longer
serve statically JS files in debug=assets.  This would be a dealbreaker,
if we did not have sourcemaps.

So, this PR introduces

- support for native JS modules
- add a specific asset controller `/web/assets/`
- generate sourcemaps (for debug=assets mode)

Note that part of the complexity of this work is cause by the debug=assets mode, where we need to have a fixed route for the debug asset bundle (so we do not lose breakpoints when debugging), but we still need to safely regenerate the bundles whenever the JS code is modified.

closes odoo/odoo#63177

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-15 13:30:18 +01:00
Francois (fge) 402740f73e [ADD] web: add /web/assets for assets bundle
Part of PR 63177
2021-02-15 10:55:00 +01:00
Francois (fge)andSimon Genin d29666c04c [IMP] web, *: adapt some JS files to new module system
The previous work on adding support for native JS modules needs to adapt
some existing files, which have an incompatible name (with a '/').

Also, we convert a few JS file in /web to the native JS module system,
to show that it can work.

Part of PR 63177

Co-authored-by: Simon Genin (ges) <ges@odoo.com>
2021-02-15 10:18:11 +01:00
Mohammed Shekha 68ccf3bec5 [IMP] web: fix UI glitch on image widget when too smal image
with this commit, we fixes UI glitch on image widget when image is too small,
when hovering over too small image Edit and Delete icon will ne displayed but
it is displayed with glitch, so to avoid that glitch we added min-width to
icons div.

task-2376452

closes odoo/odoo#66077

X-original-commit: 7aaad8480dde97b2d04b4148e4e54beb57b7f141
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-12 13:56:35 +00:00
Mathieu Duckerts-Antoine 862b21f156 [FIX] web: boolean field autocompletion with 'No'
Before this commit, select the "No" option of a boolean field in the
search bar autocompletion menu would crash.

closes odoo/odoo#66058

X-original-commit: ad5d642c455d3215857f25e0d69c593324178d29
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-12 12:02:43 +00:00
Laurent Stukkens (LTU) b32e4b7141 [FIX] web: ensure o_status is well displayed
Before this commit:

* When a o_status class is set on a label element it is not well displayed
  in project.task_type_edit, event.event_stage_view_form and helpdesk.helpdesk_stage_view_form
  since this commit has been introduced 288b24cbdf

After this commit:

* o_status labels are correctly displayed.

task-2453268
Related PR: odoo/enterprise#16173

closes odoo/odoo#66048

X-original-commit: 6bb64722a11fb6c7ba216aff5ae1c11159c92559
Related: odoo/enterprise#16300
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-12 11:15:34 +00:00
Michael Mattiello (mcm) e403729572 [FIX] web: fix quick edit on CopyClipboard fields
Before this commit, clicking on the copy button on a
CopyClipboard field triggered the quick edit.
Now, clicking on the copy button won't trigger the quick edit
but clicking on the field's value will.

task 2455358

closes odoo/odoo#66035

X-original-commit: 050efe415ba7821305390be125ab3a9b059f3273
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-12 10:19:28 +00:00
Younn Olivier f9695ecf8f [FIX] web : use same border on focused color palette inputs as others
The hex and rgba inputs styles were not matching other inputs ones when
focused.

closes odoo/odoo#66057

X-original-commit: 850581c49c84042bd5b40b632798c56789a1c60e
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2021-02-12 12:01:14 +00:00
Julien Mougenot 78e44a23c9 [FIX] web,mail: Call on_attach_callback when appending content
Before this commit, the form renderer would call "on_attach_callback"
only when the whole _render process was over. The problem was that this
process is asynchronous and this callback should be invoked as soon as
the widgets are appended.

As such, any asynchronous operation is performed before appending the
content in a new function "__renderView".

Task 2346540

closes odoo/odoo#65991

X-original-commit: 953fb092636b9919aaa6c6a6cfaffd003ba951d5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-12 06:36:41 +00:00
Martin Trigaux 284daf7f68 [FIX] web: remove formating from event title
When copy-pasting text from rich text, the content may contain
unwanted formating instructions. Unsure it's escaped to avoid
propagating the content.

X-original-commit: 42f596a5b50e530fd5dc3f8c2939bc5b4e5921af
2021-02-11 14:26:10 +00:00
nie 87334736d4 [FIX] web: fields info for a specific view can be undefined
Steps:
- Install mrp
- Go to Manufacturing > Master Data > Bills of Materials
- Create a BoM
  - Components:
    - Add a component
- Save
- Click the component
- Close the modal window
- Click the component once more

Bug:
Traceback here:
https://github.com/odoo/odoo/blob/55a6642a9621fa9683895d5d45a015bb04c3017b/addons/web/static/src/js/views/basic/basic_view.js#L147
Error: can't convert undefined to object

Explanation:
As seen on the line just above:
https://github.com/odoo/odoo/blob/55a6642a9621fa9683895d5d45a015bb04c3017b/addons/web/static/src/js/views/basic/basic_view.js#L146
`fieldsInfo` might not have the view we are looking for.

opw:2452142

closes odoo/odoo#65998

X-original-commit: a8680ac8815575762b702917940c0b2d4dc0c4ea
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-11 16:01:17 +00:00
Michael Mattiello (mcm) 3b0b448408 [FIX] web: prevent quick edit in non-editable forms
Before this commit, non-editable forms could switch to edit mode
when clicking on a field or a label.
Now, the edit right is checked when the quick edit is triggered.

task 2456324

closes odoo/odoo#65964

X-original-commit: 298746a3cce3d241417bcf62f4deeeb8f3d3ca92
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-11 12:53:30 +00:00
Aaron Bohy a890b0bf03 [FIX] web: keep null/false/true strings in domains
Before this commit, occurences of 'null', 'true' and 'false'
strings as autocomplete values in the search view were replaced
respectively by None, True and False.

Fixes #65743

closes odoo/odoo#65958

X-original-commit: 885932ae8e31905e08b79141a445933b6afc9f15
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-11 12:18:25 +00:00
Mohammed Shekha c56b6f6e78 [FIX] web: badge widget vertical alignment
before this commit: badge widget was not displayed vertically aligned

after this commit: badge widget will display vertically align

task-2351554

closes odoo/odoo#65940

X-original-commit: 1f99f5df22b3d36775a7386af170c126a481279b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-11 10:34:31 +00:00
Mohammed Shekha 4b122de129 [FIX] web: date options are not displayed in dropdown
before this commit: when groupby dropdown is opened and hover over date/datetime
field then it does not show options like Day, Month, Quarter, Year instead it
adds horizontal scrollbar, this issue is raised after commit: https://github.com/odoo/odoo/commit/cf351ae49875ec7d28a18747b65ed2a61f55262b
So this commit simply reverts that commit and fix the issue solved by above commit
different way.

with this commit: reverts https://github.com/odoo/odoo/commit/cf351ae49875ec7d28a18747b65ed2a61f55262b
and fix the issue solved in above commit different way.

task-2452033

closes odoo/odoo#65905

X-original-commit: a622936ab09497086f43715e546a1b33418d0ee3
Related: odoo/enterprise#16272
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-10 17:22:59 +00:00
Géry Debongnie addf9d7eec [FIX] web, point_of_sale: update owl to v1.2.4
This commit update owl from 1.2.3 to 1.2.4, and
introduces a few fixes for code that was broken (because it accesses
private owl values)

Note the fix for the test menu code is interesting. Before this commit,
the handler for the click on the home menu component was not called, so
the click had a side effect: it modified the url to its href, which
caused the action manager to load the next application, even though the
home menu was not mounted.

With the update to Owl, this is no longer true: the handler is called,
and call preventDefault on the event. Because of that, the url is not
changed. However, since the home menu is itself not mounted, it cannot
communicate to the web client that we should load the next app.  This is
why it was broken.  The fix is simple: we actually make sure that the
home menu is displayed before clicking on the app menuitem.

closes odoo/odoo#65906

X-original-commit: 2385e58d76aa5e4bca0fc6d76ecedc7de5fd4267
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-10 17:28:10 +00:00
Aaron Bohy d9880122db [FIX] web: call do_hide/do_show on a destroyed widget
Before this commit, calling do_hide/do_show/do_toggle on a
widget that had been destroyed before being rendered crashed
(because this.$el was undefined).

Obviously, calling those methods in this situation is useless, but
with asynchronous code, it might happen that you call them in an
handler, and they have been destroyed meanwhile.

This commit checks if this.$el is set before accessing it to avoid
the crash.

closes odoo/odoo#65897

X-original-commit: 320c29f5b37d4f02b4d5f7b1b6ff64462b000c92
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-10 15:42:33 +00:00
Ivan Yelizariev d9ff1e6c69 [FIX] web: fix duplication on phone+sms button rerendering
STEPS:

* Add related phone field to a form (e.g. partner_id.phone to sale.order form)
* Use widget "phone" + activate sms feature
* Create a record
* Click edit, select partner that has phone specified (e.g. +1 234), edit
partner's phone (e.g. +1 234 555), save

BEFORE: ``+1 234 []SMS`` is converted to ``+1 234 555 +1 234 555``
AFTER: ``+1 234 555 []SMS``

WHY:
* FieldPhone is inherited from FieldEmail

  https://github.com/odoo/odoo/blob/0de069b8ca9fb005ba5b076984f5677de25889ee/addons/web/static/src/js/fields/basic_fields.js#L1549

* sms module adds SMS button to ``$el``

  https://github.com/odoo/odoo/blob/0de069b8ca9fb005ba5b076984f5677de25889ee/addons/sms/static/src/js/fields_phone_widget.js#L91

* So this commit filters ``$el`` before updating it

This also solves the same issue but this time for the EmailField widget introduced at 2689915e3f

---

opw-2425949

closes odoo/odoo#65879

X-original-commit: b25104bae7f38d4d1de182176d239b1b7c8f803d
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-02-10 13:22:36 +00:00
Michael Mattiello (mcm) 18780e9e5a [FIX] web: fix click on field label
Before this commit, clicking on some field labels threw an error.
This was because we were searching for the associated field by its id
to get the name.
Now, we don't search the associated field anymore, we use
`fieldIdsToNames` to get the name from the id.

task 2456348

closes odoo/odoo#65838

X-original-commit: ad97c32b236d92afd4a0b6d7b39e137448b0a9a5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-09 16:04:36 +00:00
Aaron Bohy 7a51632e39 [FIX] web: nested x2many with non inline views
This commit partially reverts commit [1], and backports commit
[2] from 14.0.

Even though [1] correctly fixes the faulty scenario, there is a
variation of this scenario which isn't handled. It has been
fixed in 14.0 by [2], and that fix also fixes the original
issue of [1]. So we keep the tests of both [1] and [2], and
the fix of [2].

[1] dd97d446ee94a32089f200bb7122139d31e69873
[2] f6c06bd0b8

closes odoo/odoo#65705

X-original-commit: f2b9a5502f5cf0ee51f193177c679889c18130a9
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-08 11:08:06 +00:00
Mithilesh Rao 6cd42e016d [IMP] hr_holidays,web: Improve the mobile view for calendar and times off
Purpose of the task is to improve mobile interface of the Time Off
and calendar view.

So in this commit, we have improved UI as below:
hr_holidays:
 - Move the leave summary topbar from top to sidebar filter of
calendar for small screen
 - Improve the kanban view of leave for mobile and added the
badge for state.

web:
 - Improve the calendar year mobile view by spliting the month view
in 2 column.

TaskID: 2333778
Related PR: https://github.com/odoo/enterprise/pull/13454

closes odoo/odoo#61474

Related: odoo/enterprise#13454
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-08 08:35:05 +00:00
Martin Trigaux 8015bdeb4c [I18N] *: fix bad placeholder in translations
Modify manually for the languages where the language is not on Transifex

closes odoo/odoo#65564

X-original-commit: 793dc3fc1002aca15f5e0a7c33baf36a4550d180
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-04 16:05:39 +00:00
Michael Mattiello (mcm)andAaron Bohy 54ea956490 [FIX] web,base: save when tab/browser closes
PR [1] introduced the auto save feature (changes in form and list
views are automatically saved when the view is left, e.g. with
the pager, breadcrumbs, stat buttons, menus...).

However, there was one case that had been left aside: when we close
the tab or browser. This commit ensures that we also save the
changes in this case.

The record is saved only if it is valid, otherwise the changes are
simply lost (we don't block the tab/browser from closing itself).

Moreover, the beforeunload handler must be *almost* sync (a few
ms setTimeout seems ok, but definitely not an rpc roundtrip). For
that reason, we cannot wait for onchanges to apply before saving.

part of task 2330101

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

closes odoo/odoo#65561

X-original-commit: 9949ea14e4f27ca8c0fc84d726ad0434e2e216b8
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2021-02-04 15:46:28 +00:00
qsm-odoo 6d6ea9a530 [FIX] web: allow users to zoom on frontend pages
task-2446015

closes odoo/odoo#65536

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04 13:52:03 +00:00
ijas ahammed 2689915e3f [IMP] web,sms: limit the clickable area for email/phone/url widgets
The 'o_text_overflow' class whlie provided on any field, is used to
have classic ellipsis (...) for very long string. However, it is
implemented the way that it occupies the available width for the field
tag it even if the the string is small.

The same class is also utilized in some field widgets like  email, phone,
URL etc. But it has a small side-effect due to full width occupancy.

Because the above widgets rendered an anchor tag, the clickable area is on
the whole available width instead of simply on the content provided in anchor
tag. So even if user clicks on the empty area of that field, the click
action is performed (for example, in email field widget, default mail client
pops-up) which should not happen. It should behave like clickable m2o fields
where the action is performed only when clicking the content and not on the
empty area.

With this commit, we wrap the anchor tag, within a container div tag. Here,
the overflow class will be on the container div which will do it's job to
prevent the long strings from breaking the UI, and the anchor tag being its
child, will not be the full width, thus limiting the clickable area. This
commit also makes the related test cases more robust by checking proper
classes for particular widgets.

TaskId - 2345974

closes odoo/odoo#63735

Related: odoo/enterprise#15777
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-15 13:05:54 +00:00
Odoo's Mergebot 985688c50c [MERGE] generic improvements from UserTesting in Project App
Generic improvements have been made to improve the Project App and its onboarding.

## Web module

- kankan examples modal: change the 'use this for my kanban' button into 'use this for my project'. To do this, a small change is made in the web module to use the options variable called `applyExamplesText` to change the label of the button in project app.
- A private method called `_getFavoriteIcon` is added in `FavoriteWidget` to easily change the icon based on the boolean value when we override this widget in another module.

## Project App

For project.task model:
  - the label of the priority label has been changed from "Priority" to "Starred".
  - the user_id field should not be clickable in form view.

For project.project model:
  - the fa-star icon has been replaced by the fa-bookmark and fa-bookmark-o icons in the kanban view.
  - When the user is the 'Project User', the 'share' button and 'project overview' stat button are hidden in the project form view.
  - the 'sales order' stat button is only visible to users who have at least the `sales > all documents access right level` in project form view.

task-2440564

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#65095

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-03 10:38:43 +01:00
Nidhi Patel 892e3d7d25 [IMP] web: Clean the export file names
The purpose of this task is to clean up and provide clear export
file names.

Currently, When exporting data:
 - From a pivot view, the file name is 'table'
 - From a list view, the file name is technical name of model

so in this commit, Change the export file name as below:

 - For list view quick export and standard record export,
the filename will be 'model_description(model_technical_name)'

 - For pivot view quick export,
the file name will be 'Pivot(string set on view)(model_technical_name)'
and if string is not set then 'PivotUntitled(model_technical_name)'

In all the cases space and forward slash will be removed.

closes odoo/odoo#64123

Taskid: 2237840
Related: odoo/enterprise#15579
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-02-03 07:14:16 +00:00
Nasreddin (bon) 6595e770f0 [FIX] web: Not hide daterange if scrolling on mobile + unit test
Issue

	- Install "Field Service" app
	- Create new task
	- Try to select Planned start/end date and valid

	Daterange picker is hiding when trying to scroll down to valid selection.

Cause

	The daterange picker is closed when ev.target is not inside the picker,
	however ev.target always return the document element.

Solution

	Do not hide daterange picker on scrolling if on mobile.

	Note : It will only apply if scrolling on the daterange picker and
	       will still hide if scrolling outside this last one.

opw-2428099

closes odoo/odoo#65435

X-original-commit: 1d9b6f56e70faee13cda0ccb9893ed49904ab319
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-02-02 21:27:13 +00:00
Xavier BOL (xbo) 1361d0720e [FIX] web: customization of text in button for kanban example never used
Before this commit, the customization of text in button to apply kanban
example is never used because the variable which contains the text is
missspelled and thus is always undefined. That's why, we always have the
default text in this button.

This commit changes the `options.applyExampleText` to
`options.applyExamplesText` to get the text customization in project
module for instance and adds a test in order to check that the text
is well rendered.

Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>

task-2440564
Closes #65095
2021-02-01 13:48:00 +01:00
Achraf (abz) d70e1263f2 [FIX] web: Show create button on multiEdit + unit test
What are the steps to reproduce your issue ?

    1. Install project
    2. Open any project
    3. Switch to list view and display by Stage
    4. Open categoryA and select some records
    5. Open CategoryB

What is currently happening ?

    The button create is not displayed

What are you expecting to happen ?

    Don't hide create button

opw-2423701

closes odoo/odoo#65266

X-original-commit: 813b9fc42f5d0cc4e35afb642291200b90d1f545
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-01-29 11:56:03 +00:00
Mohammed Shekha d9492be108 [FIX] web: popover opened in rtl takes full space
before this commit: smiley box popover in rtl langauge takes full space it is
because of left:0 given on o_popover class by default, which will be converted
to right:0 when in rtl language and popover position will computed by popper
will set left:'some pixels' due to which it takes full space.

after this commit: smiley box will be displayed with expected width,
unnecessary will not be added, as we have removed left:0 css, hence it will not
be converted to right:0 when in RTL mode.

task-2418264

closes odoo/odoo#65419

X-original-commit: 0bd842ad62901499abb703c92b15496cdfa05cc0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-02 14:15:10 +00:00
Michael Mattiello (mcm) 2c3ac6b254 [IMP] web: add quick edit behaviour
This commit adds the quick edit behaviour.
The quick edit allows to click on fields in readonly form view to switch
into edit mode. After switching mode, the clicked field is automatically
focused.
A few fields have a custom quick edit behaviour after mode switched:
  - checkboxes automatically toggle.
  - radio buttons are set to the selected value.
  - one2many list's cell are focused.
One2many list fields now show the "add a line" in readonly mode.

task 2330101
2021-02-02 12:40:23 +00:00
Michael Mattiello (mcm) d1c56ec7c4 [IMP] web, base: auto save
This commit adds the auto save for editable list and form views
but not for settings.

Now with auto save, changing the pager, going back in the breadcrumb,
going to an other action or clicking on a menu item won't ask to
confirm changes if any but will automatically save them.

In settings, the confirm dialog has been revamped.
We can now decide to "Save" or "Discard" the changes or "Stay Here" to
do nothing.

task 2330101
2021-02-02 12:40:22 +00:00
Michael Mattiello (mcm) 288b24cbdf [IMP] web: reduce shift when switching form mode
This commit does 4 things in order to reduce the shift when switching
mode in form view:

1. modifies the render function of many2one and x2many radio
   fields to render them the same in edit mode and read mode.
2. removes margins in inner form groups.
3. sets a minimum height on rows to align them.
4. empty fields are now visible. (as a blank line)

task 2330101
2021-02-02 12:40:22 +00:00
Aaron Bohy 5040a82d58 [FIX] web: FieldRadio: getFocusableElement defined twice
Commit [1] adds an override of the getFocusableElement of
AbstractField in FieldRadio, but this function was already defined.

Even though it doesn't crash, this is obviously not something to
do. This commit removes the first occurence (which was overriden
by the second).

[1] https://github.com/odoo/odoo/commit/ebe118fc607391737adc37e18c3278a3d2c87b5e

closes odoo/odoo#65388

X-original-commit: 8b014a57a1930dfc69f14254564af8a43eff9845
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-02 09:52:09 +00:00
Aaron Bohy ff1c307b59 [FIX] web: Many2ManyTags: no crash when focusing out
Commit [1] improves the focusout case of the Many2One field: if
the user typed something in the input that matches some records
(i.e. if there are records in the suggestion dropdown), the first
one is automatically set.

The Many2ManyTags field internally uses a FieldMany2One. However,
the same scenario inside a Many2ManyTags crashed. The reason is
that we sent the wrong value in this case (an id, instead of an
object).

[1] https://github.com/odoo/odoo/commit/1d4d2a6

closes odoo/odoo#65386

X-original-commit: e3cf207ecaae2785f7d0e8e3afa0fe45c9d6b88d
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-02 09:30:09 +00:00
Mohammed Shekha cf922b7a12 [IMP] web: debounce list buttons on click handler
before this commit: listview buttons on row can be clicked twice due to which
action may trigerred multiple times.

after this commit: listview row button handler is debounce with 500 miliseconds
so that even if user clicks same button multiple time too quickly action is not
trigerred multiple time.

task-2391298

closes odoo/odoo#62217

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-02 06:16:25 +00:00
Romain Estievenart c0bba7e775 [FIX] web: Auto close dropdown is broken
Steps to reproduce:
1. Go to Project App
2. Open and edit a task
3. Click on Customer => search more
5. Click on "Filters"
6. Click on "Group by"
=> The "Filters" and "Group by" dropdown are open at same time => bug

Since odoo/odoo@e4f87710e1, we added a way
to prevent bs and owl dropdown to be open in the same time.

But when the web-editor is present, the CSS selector used to match the
opened modal ("search more" in this case) conflicts with the DOM created
by the web-editor  (modals identified by the classes: .web-editor,
.note-picture-dialog, .note-link-dialog, .note-help-dialog).

To avoid this conflict, this commit uses a more restrictive CSS selector
to match only the first (active) opened modal (as web-editor doesn't
attach its modals at the root of the body).

closes odoo/odoo#65358

X-original-commit: 7cb24db622b231b89558755d9c0e7d899fc994bf
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2021-02-01 16:07:11 +00:00
Martin Trigaux 51d173d42f [FIX] web: translate remaining days
This is the javascript equivalent of `_("Foo %s" % bar)`
https://www.odoo.com/documentation/master/reference/translations.html#variables

Forward port of odoo/odoo#65004

closes odoo/odoo#65245

X-original-commit: a672b37240170b554bdd5993e4049cf5d5b040db
Related: odoo/enterprise#16027
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-29 09:03:59 +00:00
Romeo Fragomeli ef9ecf1388 [IMP] web: allow to change the scale also when changing the date
This commit allow to change the scale at the same time as changing the date.

Task ID: 1891957
2021-01-28 13:55:50 +00:00
Romeo Fragomeli c96e3b96f3 [IMP] web: add support for TAP events in test utils
This commit add the support to simulate a "TAP" (touch) using coordinate.

This utils will be used in a future commit in web_enterprise to be able
to test some specific case for FullCalendar.

Task ID: 1891957
2021-01-28 13:55:50 +00:00