Commit Graph
13860 Commits
Author SHA1 Message Date
Mohammed Shekha 5e6fd455b1 [IMP] web: export: change field sorting icon to fa-sort
task-2413274

closes odoo/odoo#62998

Related: odoo/enterprise#15215
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-12-22 11:21:03 +00:00
Mohammed Shekha e3be9d183f [IMP] web: editable list: change handle icon to fa-sort
task-2413274
2020-12-22 11:21:03 +00:00
Mohammed ShekhaandKamesh Patel 81f2bc7b0a [FIX] web: SampleServer: round float values
before this commit: when field is float type it display too much decimal
precision value, it should be fixed to 2 precision for sample data.

after this commit: float field will display 2 decimal precision value.

task-2318503

closes odoo/odoo#63643

X-original-commit: 61f8ced67992b20edfac139c749ec00939f408a3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Kamesh Patel <kat@odoo.com>
2020-12-21 13:03:22 +00:00
Prakash PrajapatiandAaron Bohy b9c5ae27bb [FIX] web: kanban: reload kanban image
Before this commit, if the image changed from the form view, it
wasn't updated when coming back to the kanban view (one must
refresh the page).

This commit makes this work by automatically adding the field
'__last_update' to the list of fields to read when there is an
image with kanban_image src in the template.

closes odoo/odoo#58313

Taskid: 2341493
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-12-21 12:45:29 +00:00
Mohammed Shekha f7ddf3398c [FIX] base_import,web: remove Import from m2x dialogs
Before this commit, the "Import" button was available in the
favorite menus of dialogs opened from many2one and many2many field
widgets. It makes no sense from those dialogs.

Task 2376279

closes odoo/odoo#62079

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-12-21 08:45:57 +00:00
Achraf (abz) 4cc7c2bf00 [FIX] web: Load odoo script after other scripts
What are the steps to reproduce your issue ?

    1. Install website
    2. Connect on the website
    3. Choose Customize > HTML/CSS/JS Editor
    4. Choose "Web layout" (in "XML (HTML)" )
    5. Modify the HTML code by adding any <script> before the existing <script> (console.log whatever)
    6. Save
    7. Refresh

What is currently happening ?

    Traceback: TypeError: Cannot read property 'user_context' of undefined

How to fix the bug ?

    Target the odoo script by id in the xpath.

opw-2375490

closes odoo/odoo#63360

X-original-commit: 0b7ba571431d694dea7db3ba1da4c7e86d1013e5
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-12-15 07:04:04 +00:00
Achraf (abz) ae3a0dca96 [FIX] web: Select subfields without removing filter text on export
What are the steps to reproduce your issue ?

    1. Install "contacts"
    2. Select list view and select one or more contacts
    3. Select "Export" actions

What is currently happening ?

    When filtering fields with text, the system only displays the corresponding
    fields, but when clicking on sub-field the text written just before
    is deleted, which prevents us to return to all fields without filter

What are you expecting to happen ?

    Filter fields and select sub-field without deleting the filter text

opw-2411928

closes odoo/odoo#63339

X-original-commit: d947ea609b458ddbccabd661c22652d6c86a8167
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-12-14 14:20:12 +00:00
Gorash 9a02c39977 [FIX] web_editor,website_mass_mailing: display the popup preview
closes odoo/odoo#63343

X-original-commit: a0470eed4e57f2df19d4306ab4e894b986971eef
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-14 14:40:22 +00:00
Gorash 720ea747f0 [FIX] web: dialog should not use field value footer items
Issue: display the footer tag from snippet in the modal and replace the
save and cancel button.
Steps to see: Email marketing -> mailing lists -> option icon of a
kanban -> Edit -> Website popups -> add a line

X-original-commit: 073699749401adadeec029de6534b4d205e41067
2020-12-14 14:40:21 +00:00
Aaron Bohy ae7aae7140 [FIX] web: update owl to last version
This commit updates owl from v1.0.13 to v1.2.0

See [1] and [2] for the list of changes.

[1] https://github.com/odoo/owl/commit/abb9d0b364da3a976915c092ab8d2696e5e524e5
[2] https://github.com/odoo/owl/commit/144b323d2bac7384114eb6b63670991f42943e67

closes odoo/odoo#63342

X-original-commit: cc77978c84d988a4b059abce97b46c72a9d3167d
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-12-14 14:35:50 +00:00
Francois (fge) cc67988241 [IMP] web: added option model_field to the reference field.
model_field: name of the FieldMany2One('ir.model') containing the model of the records that can be selected. If its value is different from False, the select will not be displayed.

The purpose of adding this option is to allow the creation of a reference field having its model defined in another field (Many2One).

Task-2195019
2020-12-11 09:11:11 +00:00
Christophe Monniez 0684219d59 [FIX] web: Allow accented uppercase characters in sign
Some characters are filtered out for an unknown reason, leading to
strange behavior when the font supports those characters.

closes odoo/odoo#61199

closes odoo/odoo#63290

X-original-commit: 429febb30bb3f5442cf310e836a5e0e6c4bc3e65
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-12-14 09:07:27 +00:00
Christophe Monniez bc1a017bb8 [FIX] web: replace ttf fonts used to sign with better ones
Some ttf fonts used to sign are shipped does not come with a clear
licensing. Also some of them does not have accented characters.

With this commit, they are replaced with better ones and their
accompanying Open Font License.

Also, before this commit, any file in the font directory was read to be
rendered by the sign widget. With this commit, only `ttf`, `otf` and
'woff[2]' files are read, this allows to store the license file
alongside with the font.

X-original-commit: f4a9aec57b871806fb225bf91a941edb0fde5cbe
2020-12-14 09:05:09 +00:00
dht-odoo c76fa80487 [IMP] web: handle buttons with long strings on quick create kanban card
Right now, the quick create kanban card is having three buttons, Add, Edit
and Discard. In some languages, the translation terms of these buttons may be
quite long. This pushes the last button into second line and leads to an
ugly display.

This commit replaces the 'Discard' button with trash icon and makes sure that
all buttons are always in single line. If the strings are too long, they will
be cropped automatically.

Task ID-2373130

closes odoo/odoo#62326

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-11 13:58:04 +00:00
Martin Trigaux 3f13751e9b [I18N] *: export saas-14.1 source terms
Without demo data

closes odoo/odoo#63238

X-original-commit: 4e6683973b1d1ecc67f1312a8ef98b1272e2d5a5
Related: odoo/enterprise#15268
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-12-11 12:30:42 +00:00
Giacomello Nathan 6cfec48ba4 [FIX] Web: Cannot collapse calendar sidebar
A calendar filter's id is the concatenation of "o_cw_filter_collapse_" and the title of the filter.
When title has space (like "Time Off Type"), the id become "o_cw_filter_collapse_Time Off Type", which is invalid.
So, we can't collapse the filter.
With this fix, it replace space by nothing so if there is space in title (like "Time Off Type"), the id is "o_cw_filter_collapse_TimeOffType".

Task id: 2318645
2020-12-09 15:53:09 +01:00
Giacomello Nathan 2af0a86db8 [IMP] Web: Add field to calendar & resize Year view
- Resize Year view
- Add "is_hatched" field
- Scroll to current month in Year view
- Hide the sidebar if no filter is present

The goal with Year view is to display it in a single page without scroll bar.
Before this commit, a scrollbar was displayed on the right of the screen.
This results in some data wasn't displayed on the screen.
Now, the year view is scaled to the browser.
That means that all information are now on the screen (without scrollbar).

"is_hatched" is used to hatch date under specific conditions
The goal was that it was not possible to display some information differently depending on a variable.
Now, if a variable named "is_hatched" is set to true and passed to the calendar view, the specific date is hatched.

Task id #2318645
2020-12-09 15:53:09 +01:00
Odoo's Mergebot 4c5c3e41c0 [MERGE] calendar: add link to join video call
This commit adds a link to each calendar.event to join a video call
hosted on Jitsi.

TaskID: 2367543

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

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

closes odoo/odoo#61280

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-09 12:05:28 +01:00
Patrick Hoste 317025d3fb [IMP] web: support disable_multiple_selection parameter when opening the o2m dialog
PURPOSE

Sometimes we want to limit selection of 2many fields to a single record at
a time. For example when creating marketing automation activities we want
users to create them one at a time to ease linking between them (parent /
children relationships). Indeed 2many subrecords have to be created before being
selected in other 2many subrecords (i.e. create an activity to set it as
parent of another activity).

SPECIFICATIONS

The open_one2many_record trigger method now accets disable_multiple_selection
option in parameter to pass it to the FormViewDialog constructor.

LINKS

Task ID-2087993
COM PR odoo/odoo#40177
ENT PR odoo/enterprise#6675

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-09 08:27:46 +00:00
Kevin Baptiste e562a22ad2 [IMP] base: add CopyClipboardURL
This commit adds a CopyClipboardURL widget which can be clicked on to open
the link.

TaskID: 2367543
2020-12-09 08:20:22 +01:00
Kevin Baptiste c90bf3f703 [FIX] web: do not overlap calendar popover
The content of the popover was overflowing on the button if they were
too many elements. It will now display a scrollbar when needed.

TaskID: 2367543
2020-12-09 08:20:22 +01:00
Romeo FragomeliandMichaël Mattiello f589fafe63 [FIX] web: don't update the list view if not needed
Before this commit, an event was triggered even when no change occurred.

Steps to reproduces:
* Go to Document
* Change to list view
* Go to app switcher
* Select another app that has enough content to be able to scroll
* Scroll the view => Bug

Task ID: 2347584

closes odoo/odoo#63021

X-original-commit: c6c4b9f0e4bae03b51d232ea920de9587d8e2b73
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2020-12-08 13:17:17 +00:00
Arnaud Baes e4b625b542 [FIX] web: make clean_action() allow extra properties
Some actions use 'non-standard' key in the action dict, to pass extra
parameters. In that situation the filtering of keys in `clean_action()`
strips valuable params, in an attempt to avoid leaking internal action
data.

One example of this is the dynamic action definition returned by
`open_yodlee_action()` in the account_yodlee module, which uses several
non-standard properties.

This commit alters the filtering logic in order to allow extra keys by
default, as long as they're not actual fields of the action model (and
therefore should not cause unintended "internal data" leaks).
A warning is also added to recommend passing those extra parameters in
the `context` and `params` action properties, which are explicitly
designed for this, by convention.

For cases where extra properties are returned and where the warning is
annoying, those properties can be explicitly _allowed_ by making them
virtual action fields, through a `_get_readable_fields()` override.

X-original-commit: 5cc3a6f2307be617c51e8d9c5f167acc60cc6287
2020-12-08 11:32:50 +00:00
Xavier Morel 4c3d90e1d0 [FIX] web: export should ignore requests for xid on views
5c4544fb29 reordered some of the
operations at the export toplevel, and in doing so moved the filtering
of the xid out of the `fields` list *after* that fields list has been
used to know what fields to export.

Meaning the fields list isn't filtered anymore, and requesting the xid
on a view would blow up due to a latter assertion checking against
that.

Fix the filter, although a better solution might be to strip out the
field upstream (in the fields list provided to the export wizard) such
that users wouldn't even attempt to perform this export.

An other possibility (possibly combined with the previous) could be to
only strip out the export of the xid based on the absence of an
``id`` field on the model, though that's somewhat risky: technically
views have no reason to be stable so a "record" could disappear or
move around without the ORM being aware, leading to dangling xids.

Fixes #46674

closes odoo/odoo#62995

X-original-commit: adc25bcf67438675bc9b0d55975ce733d58b4fb5
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-12-08 09:38:13 +00:00
Achraf (abz) 61ae6a6ca1 [FIX] survey, web, web_editor, website, website_form: Prevent invalid date stock.picking
What are the steps to reproduce your issue?

1. Install "stock"
2. Go to Inventory/Inventory Overview/Internal Transfer
3. Create new record and set manually a date with year < 1000 like "0008-10-10 18:35:00"
4. Save
What is currently happening?

An error arises when saving the record, and it is then no longer
possible to reopen the records or any view containing it.
This also prevents us from correcting the date to no longer have the error
Why is this happening?

The root cause is an inconsistency in `strftime` for years < 1000 [1, 2]. To take it into
account, a zero-padding is needed in the DateTime parser.
How to fix the bug?

The missing padding is added.

However, such dates lead to problematic behaviors in Python:

```
DT_FORMAT = "%Y-%m-%d %H:%M:%S"
new_date = "0008-02-05 18:10:10"
datetime.strptime(
    datetime.strptime(
        new_date, DT_FORMAT
    ).strftime(DT_FORMAT),
    DT_FORMAT
)
```

This raises:
```
ValueError: time data '8-02-05 18:10:10' does not match format '%Y-%m-%d %H:%M:%S'
```

As of today there was no reported business cases where dates with year < 1000 would be
necessary. Therefore, we limit the range to years >= 1000.
[1] https://bugs.python.org/issue13305
[2] https://docs.python.org/dev/library/datetime.html#strftime-strptime-behavior

opw-2408260

closes odoo/odoo#62889

X-original-commit: b873bda1e560bc49ab707aa238fdc962f23bc1e4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-12-04 13:35:47 +00:00
Victor Feyens caeda18bec [IMP] base, various: support batch creation
Done for res.partner.bank, res.company and board models. Some override may
have been ignored because heavily linked to business code (like company
in stock).

See merge commit for more details.

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:18:36 +00:00
Aaron Bohy 1d4d2a6831 [IMP] web: FieldMany2One: improve focusout case
Before this commit, when the user entered some text in a many2one
and then focused out (e.g. clicked outside), a dialog was shown to
ask him if he wanted to create such a value, no matter what he
wrote in the input.

After this commit, if the search triggered by the text he entered
returned records, the first one is automatically selected when the
focus is lost. However, if it matches no record, the dialog still
opens. The text in the dialog has been slightly reworded as well.

Task 2372480
Closes #61455

closes odoo/odoo#62677

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-12-02 09:10:24 +00:00
Emilien Durieu (edu) 509a530dd8 [FIX] web: allow saving copyright footer
The copyright part of the footer could be edited but not saved.
Now it can be saved.

closes odoo/odoo#62614

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-01 09:16:14 +00:00
Florent Lejoly c9fc72ee0d [IMP] spreadsheet: allow filtering on all months
search_utils only allows to filter on last 3 months, in
spreadsheet we want to be able to filter on all the months
therfore we construct the datedomain manually and we need
the function constructDateRange to be able to do so.

task-id:2340623

closes odoo/odoo#62580

Related: odoo/enterprise#15042
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2020-11-30 09:08:41 +00:00
Nasreddin (bon) 75aec1ef61 [FIX] web: Unable to create a new record with warning message
Issue

	- Install Sales
	- In Sales > Configuration > Settings -> Enable "Sale Warnings"
	- Go to Sales > Orders > Customers
	- Pick a customer/company
	- Go in Edit mode and go to "Internal Notes" tab
	- Switch "Warning on the Sales Order" from "No Message" to "Warning" and add any warning message then save
	- Press the "$ X Sales" smart button
	- Create a new Quotation
	- Validate the warning message
	- Go back to the previous menu (using the breadcrumb) or save the quotation
	- Create a new quotation

	The quotation form editor does not appear.

Cause

	If we use the breadcrumb (or save then create), it will call the `_reload` function
	(instead of `load` when the form view hasn't been opened yet).
	In this case, creating a new record, it will call `_makeDefaultRecord` without
	setting `allowWarning` param to true (like it is done in the ref. commit bellow).

Solution

	Set `allowWarning` param to true before calling `_makeDefaultRecord`.

related commit : https://github.com/odoo/odoo/commit/a41db9a2cf410bb233b021651a5633180eaddf18

opw-2374857

closes odoo/odoo#62608

X-original-commit: d5b5e7c8490e8de9e56f16cdef640dd733163175
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-11-30 12:05:37 +00:00
Martin Trigaux 1658473bf2 [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#62564

X-original-commit: 9b3b2e8d711e3be75b1faffaf6f4f8f4ec90186e
Related: odoo/enterprise#15038
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-30 07:07:58 +00:00
Aurélien Warnon 994085acf8 [FIX] web: prevent kanban quick create from closing when modal is opened
The kanban quick create is meant to stay open if a click event is triggered
within a modal, which was working for most cases before this commit.

However, there are some specific tricky cases when the behavior is incorrect.
Issues were mainly observed when using the many2one widget inside a quick
create card.

When typing something into a many2one widget and then focusing out of it, the
widget has a built in feature that asks the user if he wants to create the
record (based on options and necessary create rights).
This implies to open a modal asking the user to create or discard his input.

When you combine a many2one widget IN a kanban quick create card, then type
something in the many2one and click outside of the quick create, it triggers
BOTH the focus out event of the many2one and the click event of the kanban
quick create that verifies if it should be closed.

This click event creates a race condition but the following behavior happens
most of the times:
- The many2one 'focusout' is triggered first, creating the modal to confirm
  record creation (see FieldMany2One#_onInputFocusout) ;
- The click event is registered second, triggering the quick create check to
  see if it should be discarded (see RecordQuickCreate#_onWindowClicked) ;
- The click is technically registered outside of the modal since the modal was
  not created yet. This behavior differs a bit between browsers:
  - On Firefox the click event correctly targets the actual element that was
    clicked (ex: another kanban card) ;
  - On Chrome it varies between the actual element (same as Firefox) and
    sometimes the raw 'body' element.
- The quick create card will then incorrectly consider the click as outside of
  any condition to keep itself open and will close and destroy itself ;
- Which in turn destroys the FieldMany2One and the record creation modal ;
- (If you look carefully on the screen you can see a slight flicker when that
  happens).

During all my testing, only one condition will stay consistent when focusing
out of the FieldMany2One by clicking somewhere else: the body element will
always have the "modal-open" class by the time the click event is triggered in
the RecordQuickCreate.

This is why relying on the condition that an element exists with the
"modal-open" class to avoid closing the quick create card provides reliable
results and seems to suit all necessary conditions and behaviors.

Task 2388450

closes odoo/odoo#62561

X-original-commit: 4930871701da2e2792e73ae3941f336046876f0e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-11-27 17:11:08 +00:00
Samuel Degueldre 6efe469941 [REF] web_editor, web: remove unused getRecordInfo event and methods
In the 12.3 editor revert, the handler for the getRecordInfo event was
removed, but the code that triggered this event was forgotten and now
doesn't do anything. This commit removes this dead code.

closes odoo/odoo#49126

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-28 09:32:34 +00:00
Aaron Bohy 608d3d87b2 [FIX] web: BasicModel: nested x2many and unknown fields
Consider the following situation:
 - have a form view with an x2many field displayed as a list
 - the x2many field has a form view that contains an x2many field,
   which isn't in the list
 - for that x2many field, we can also open a form view to see/edit
   the related records.

As the x2many field isn't in the list, when we open a subrecord, we
modify the fieldsInfo to add the information about the x2many field
we didn't know before. Doing so automatically applies raw changes
that we might have stored earlier (from onchanges) for that field,
 because we couldn't apply them before knowing the type of that
field.

Before this commit, the function that applies the raw changes was
called recursively on the dataPoint and all its children (thus on
the x2many list datapoint), which produced a crash as this function
is designed to work on dataPoints of type record.

Actually, calling it on sub datapoints is useless, as it properly
works recursively, and applies raw changes on x2many fields itself
when necessary.

This commit ensures that we don't call this function on list
datapoints anymore.

Closes #62334
OPW 2389991

closes odoo/odoo#62511

X-original-commit: 2b7670e6d709cd311c630c99cb9da7d3d6ae90f4
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-11-27 11:13:08 +00:00
Lucas Lefèvre 058ba7b907 [FIX] web: mock all name_get behaviors
The mock implementation of `name_get` does not fully reflect
the real server implementation.

The real implementation is described in tests added in
this commit.

Note: in my wildest dreams, the mock server tests would be run
against the real *and* the mock implementation to ensure they
do not diverge.

closes odoo/odoo#62430

X-original-commit: c8f59bfd5c8ddb7c7abf1108111507e667393208
Related: odoo/enterprise#15017
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2020-11-26 15:29:52 +00:00
Sébastien Theys 9c4df33e20 [FIX] web: fix discuss click all test
task-2292595

closes odoo/odoo#62473

X-original-commit: ea2d1484fcd91efe89306d6106c01fcdde1c20c3
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-11-27 07:03:52 +00:00
Benoit Socias 20141a0b91 [FIX] various: not translate the close icon of notifications
Same change in several areas where translations existed:
- website editor notification popup
- elearning share popup
- forum remediation filter popup
- event registration attendees popup
- portal rating popup
- stripe payment error popup
And many other locations where there were no translations yet
"&times;" has been replaced by its UTF8 character.
Also introduced aria-label where missing.

Before this commit the close icon was included in translated resources.
For example, in Spanish the "&times;" had been turned into "&veces;"
thus not rendering an icon anymore

After this commit the close icon is not a translated text anymore and
remains an icon across all languages

https://github.com/odoo/odoo/pull/60186
task-2312878

closes odoo/odoo#62250

X-original-commit: 9896af94ebc887d98ccf44e6568ef7eeb5a27172
Related: odoo/enterprise#14937
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-24 15:59:43 +00:00
Nicolas Martinelli 4dcbb1e62f [FIX] web: grouped export
- Create a product with:
  Cost: 60.80
  Quantity On Hand: 999.0
- Go to Inventory / Reporting / Inventory Report
- Export as XLS

The header values have too many decimals: 60739.2000000007

The root cause is `convert_to_cache` returns this value:

https://github.com/odoo/odoo/blob/042298f8c949fba470eda6ad90f94c95ca291030/odoo/fields.py#L1333

In this case, `currency.round()` keeps the extra digits. Since the field
is not stored, the useless digits are kept.

A simple solution is to use `float_repr` on the non-stored float fields
to make sure that doesn't happen. Another solution could be to not
convert the floats to strings, but that doesn't seem intended.

opw-2378895

closes odoo/odoo#62265

X-original-commit: 2ebcbb16f113dee1416097b7a52f8068a40a34cf
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-24 16:02:46 +00:00
Christophe Monniez f92b5b738f [FIX] web: skip adyen account menu entry
The `Adyen Account` menu entry leads to an external page.
This cannot be tested by the click_all test.

closes odoo/odoo#62269

X-original-commit: bcbbe3dd80bfe50bf897ce620da0bd7ddb3c3094
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-11-24 16:46:14 +00:00
Christophe Monniez c6190a1b31 [FIX] web: ignore menu add bank account in click all
Since odoo/enterprise@93ac6e5116 a the `Add Bank Account` menu is using
an new proxy server. As it's an external service, it's not desirable to
click on this menu during the test.

closes odoo/odoo#62157

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2020-11-23 10:31:59 +00:00
Aaron Bohy 28762b79e3 [FIX] web: race condition with x2many control panel
The ControlPanel has been converted in Owl [1], and the code using
it has been adapted accordingly. However, in the FieldX2Many, we
didn't properly wait for the ControlPanel to be updated (an update
of the ControlPanel was synchronous before owl, and is now async,
like every Owl renderings, as it waits for the nextAnimationFrame).

As a consequence, we might have tricky issues because the mounted
hook of the control panel might be called multiple times for a
single call to willUnmount later on. In mobile, we bind a global
event handler (on scroll) in mounted, and unbind it in willUnmount,
so we had leftover event handlers, that crashed when called after
the ControlPanel was destroyed. Note that even if the issue popped
in mobile, calling mounted on already mounted Components isn't a
good idea, and this should be fixed anyway.

The issue could be reproduced for instance in FieldService (with
collaborative pads activated in Project), in mobile, by opening
a task in Edit mode. Then, you might get a traceback by scrolling
after having discarded the edition

Here is a description of what technically happened:
 - when clicking on Edit, all widgets (including the FieldX2Many
   are destroyed and re-instantiated in 'edit' mode).
 - the pad widget directly triggers a field_changed event which
   causes a reset of the FieldX2Many (i.e. 'render' is called
   again)
 - the FieldX2Many detects that it already has a renderer (and a
   ControlPanel) so it updates them
 - it first updates the renderer, and when it's done, it updates
   the ControlPanel BUT doesn't wait for its promise, so the
   promise returned by that call to 'render' in FieldX2Many is
   resolved before the ControlPanel is actually updated
 - note that at this point, all thoses new widgets are not in the
   DOM yet
 - when all widgets are ready, the renderer patches the view (i.e.
   the former content is removed from the DOM, and the new one is
   attached into the DOM). As soon as this is done, the renderer
   calls 'on_attach_callback' on its children, including the
   FieldX2Many, which leads to a call to 'mounted' on the CP.
 - then, just before the nextAnimationFrame, Owl complete the
   rendering of the CP, and detects that it is now in the DOM (it
   wasn't at the beginning), so 'mounted' is called a second time,
   will cause the issue described above.

This commit fixes the issue by properly waiting for the CP to be
rendered in the FieldX2Many. However, this required on cascade
changes:
 - Form view renderings with a FieldX2Many are now *really* async
   (+- 16ms), meaning that the user can easily trigger concurrent
   renderings by, e.g. clicking quickly several times on 'Edit',
   'Save' or 'Discard'. Concurrent renderings are properly handled
   so to prevent this from happening, we disable the buttons and
   re-enable them when the rendering is done (like already done in
   [2])
 - in the FieldX2Many, '_updateControlPanel' was called at several
   placed, but we never waited for it. As this method was
   originally sync, its calls have probably been naively adapted,
   whereas their should have been deeply rethought (for instance,
   as it is async, and we need to wait for it, we don't want it
   to be called multiple times sequentially when something happens).
   This commit does that work, i.e. we clean the places where this
   function is called such that it is (hopefully) never called
   sequentially twice. To do so, we changed a bit the spec of the
   pager in multi page, and we also fixed a paging-related  bug.
   In a few words, here is what we did/do when adding a new row
   in the bottom of a full page:
     - before: tweak the count in the data to fool the pager and
       make it think that no new record has been added (so
       basically, let it display something wrong)
     - now: temporarily increase the pager limit so that the new
       record is displayed on the current pager, and the pager
       values are correct w.r.t. the displayed records.
    Some tests needed to be adapted accordingly.
 - By waiting for the ControlPanel when updating the FieldX2Many,
   a bunch of QUnit tests failed. Those tests have something in
   common: they spawn an X2Many (list or kanban theoretically,
   but always list in practice) containing a FieldBoolean (only
   field widget of /web converted in owl). When the FieldX2Many
   is updated, we update the renderer (i.e. re-renderer the
   FieldBoolean, so we have to wait for the nextAnimationFrame),
   and when this is done, we update the page (again, we have
   to wait for the nextAnimationFrame). So basically, we have
   to wait for two nextAnimationFrames to see the result in the
   DOM. For this, we added a new test util which basically does
   a nextTick ('owlCompatibilityNextTick'), and called it
   everywhere it was necessary. When everything will be written
   in Owl, we could get rid of this util and its calls.

[1] https://github.com/odoo/odoo/commit/fbf347498f1cc7b74ef373179b7bcae201715c24
[2] https://github.com/odoo/odoo/commit/39f08950d6e20460e3a20a5b9c33e4ddf66dce78

closes odoo/odoo#61926

X-original-commit: e8e64f75606f1501a8be7b0bb418a296cfd8be61
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-11-18 12:18:30 +00:00
Bruno Boi 43d312d1ee [IMP] web: enhance kanban progressbars filtering
When a progressbar filter is activated, it will only show records
matching the filter and nothing else.

"Load more" link will update its counter accordingly.

closes odoo/odoo#55466

Taskid: 2196661
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-11-18 07:52:19 +00:00
Bruno Boi 99fb043668 [FIX] web: sorting in mock_server's search_read
The mock server was slicing the records before sorting.

Now mocking a search read would sort the records before slicing them.

This will ensure the records to be loaded with the correct sorting order
when e.g. a load more is applied on a subset.

Taskid: 2196661
2020-11-18 07:52:03 +00:00
Bruno Boi 0391c0f7b8 [REF] web: add extension points in basic model
_getUngroupedListDomain
    can be used to extend the domain of a search_read for a list resource

_getGroupedListPropsToKeep
    can be used to extend props to keep from a previously existing list resource when a read_group occurs

Taskid: 2196661
2020-11-18 07:52:03 +00:00
Hardik Prajapati 625fb86abe [FIX] web: Fix the height of svg when signature is empty
Currently, in the user setting, hovering on the live chat input will
focus on the signature div due to long height of the empty svg.

So in this commit fixes the issue by adding the css property in the
svg element of signature widget due to that svg element contains the
proper width and height.

closes odoo/odoo#61897

Taskid: 2361880
X-original-commit: 6fe2a0b8b6f8dadb2eb7008019f2d7266dcf6fb1
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-17 19:26:05 +00:00
Hiral Bhavsar 90546e4aaa [FIX] web: handle mail delivery exception
Before this commit:

When trying to send the notification for the user form, it shows a traceback.
This is happening after https://github.com/odoo/odoo/commit/ab4000fb3cf8fa54ba714ceceec391b78d73755e

After this commit:

Send the notification without any traceback as handle
the MailDeliveryException inside CrashManager

Task-2333121

closes odoo/odoo#61832

X-original-commit: 3aadcf1ad42e704c369910628a1549d1e777c959
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-11-17 10:40:46 +00:00
Aurélien Warnon 46cc27cc6e [FIX] web: improve the hit box of the kanban quick_create
When the user clicks outside of the kanban quick create element, it's closing
itself automatically.

However, the "hit box" of this behavior is not entirely accurate and clicking
on the very edge of the box would also close the element.

This commit fixes the click behavior and allows clicking anywhere inside the
quick create element.

Task 2373095

closes odoo/odoo#61763

X-original-commit: 72ed82489daa2b82628dfdefeb06262e17e6548e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-11-16 09:58:10 +00:00
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
Adrien Dieudonne 55a458ae9b [IMP] web: change status bar dropdown stage color when disabled
Before this commit we didn't notice when the dropdown buttons were
disabled or not.
Now, we do the same as on desktop:
the text color is gray when you aren't able to change the stage.

Note that the previous css selector didn't worked because
we are in a dropdown on mobile.

Task ID: 2348528
2020-11-16 09:01:53 +00:00
Adrien Dieudonne 09e1028944 [FIX] web: statusbar: border color for disabled buttons
Before this commit, the intent was to change the border color
of the first button that appears when the status bar is disabled.

The problem was that this added a border for all buttons and
not only the (visually) first one.
2020-11-16 09:01:53 +00:00