Commit Graph
14339 Commits
Author SHA1 Message Date
Aaron Bohy 4b3dc07b52 [FIX] web: better handle error in actions
Before this commit, if there was a crash in a view or client
action during an update (i.e. the action is already in the DOM,
but an update triggers a re-rendering), the error was caught by
the action service, it wasn't displayed to the user, and the
action was re-rendered again (which could obviously result in the
same error being thrown again and again).

With this commit, we properly show the error, and we do not try
to re-render the action.

closes odoo/odoo#73507

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-12 13:40:26 +00:00
Aaron Bohy a8976144fe [FIX] web: correctly call dialog service 2021-07-12 13:40:26 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Mohammed Shekha ef21b193cd [FIX] web: datepicker week date offset
PURPOSE

The week dates computed by our datepicker do not meet the ISO 8601 standard:

The ISO 8601 definition for week 01 is the week with the first Thursday of the
Gregorian year (i.e. of January) in it.
The following definitions based on properties of this week are mutually
equivalent, since the ISO week starts with Monday:
- It is the first week with a majority (4 or more) of its days in January.
- Its first day is the Monday nearest to 1 January.
- It has 4 January in it. Hence the earliest possible first week extends from
Monday 29 December (previous Gregorian year) to Sunday 4 January, the latest
possible first week extends from Monday 4 January to Sunday 10 January.
- It has the year's first working day in it, if Saturdays, Sundays and 1
January are not working days.

If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in W01. If
it is on a Friday, it is part of W53 of the previous year. If it is on a
Saturday, it is part of the last week of the previous year which is numbered
W52 in a common year and W53 in a leap year. If it is on a Sunday, it is part
of W52 of the previous year.
https://en.wikipedia.org/wiki/ISO_week_date#First_week

Since Jan 1st 2021 falls on a Friday, according to the ISO 8601 standard above,
the first week of 2021 is the one starting on Jan 4th.
Nevertheless, it looks like our datepicker simply assumes that the first week
of the year is simply the one including Jan 1st.

SPECIFICATION

Fix the week dates of our datepicker to meet the ISO 8601 standard.

Task - 2458112

closes odoo/odoo#73270

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-07-12 06:44:24 +00:00
xO-Tx a075536837 [FIX] website, web: fix first link of table of content snippet
The first element is now selected once the snippet is visible at the
bottom of screen.

task-2431484

closes odoo/odoo#73499

X-original-commit: e2cfaf8e58c3f267503fc7ec81d78f728e75b506
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-09 12:07:24 +00:00
Francois (fge)andSergey Shebanin 7f10ca0d7c [IMP] web: make the hotkey service overlay modifier customizable
From this commit:
- It is possible to modify the overlayModifier allowing to display the
overlay and to access the data-hotkeys defined in the Dom.
- Adding a hotkey using the service or hook does not add the
overlayModifier anymore.

closes odoo/odoo#73279

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Sergey Shebanin <sergey@shebanin.ru>
2021-07-09 09:16:57 +00:00
Francois (fge) 20e157dd01 [FIX] web: doesn't apply the invisible data-hotkey
The purpose of this commit is to prevent the activation of data-hotkeys
associated with hidden elements of the dom.

Task-2591069 - BUG 1
2021-07-09 09:13:58 +00:00
Lucas Perais (lpe) a935096e51 [FIX] web: webclient: remove bootstrap tooltips more accurately
Before this commit, when hovering a button with a bootstrap tooltip set on it
(form view with header button in debug mode) and then clicking while staying hover
the tooltip was not destroyed and there was no easy means to destroy it.

After this commit, any click within a legacy context remove any bootstrap tooltip from the DOM,
since popper and tooltip are not meant to be used in the future in a wowl setting.

closes odoo/odoo#73447

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-08 15:28:01 +00:00
Jeremy Kersten 478068c829 [IMP] *: always use Odoo Response
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.

We removed redirect_with_hash that was only for retro compatibility

local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.

Default code for redirect is 303 now instead of 302.

Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.

All werkeug.utils.redirect has been replaced by request.redirect.

Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.

Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.

Migrate your code:

http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect

Courtesy of odony for help and review ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +00:00
Jorge Pinna Puissant 54e9527ec2 [IMP] web, *: read session information from a module
* google_recaptcha, mail, partner_autocomplete, point_of_sale, website

Now, to read session information, the module "@web/session" must be
imported. Not that, there is also the user service with all the user
information.

closes odoo/odoo#73201

Related: odoo/enterprise#19434
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-08 14:13:39 +00:00
Anh Thao Pham (pta) e2fb83814e [FIX] web: fix resequencing after moving records with same sequence
- Install Sales > Configuration > Settings and activate Delivery Methods
- Create a SO as followed:
  * Add a section (i.e. Section 1)
  * Add a product (i.e. Product A)
  * Add a product (i.e. Product B)
  * Add a shipping (i.e. Delivery X)
  * Add a section (i.e. Section 2)
  * Add a product (i.e. Product C)
- Move (drag & drop) Delivery X to the first place
SO lines are reordered, but Product B is moved after Section 2.

It comes from the fact that some lines have the same sequence and that
only the lines between the source and the destination position are
re-sequenced.

Before the move, the sequencing is as followed:
 1) Section 1: 10
 2) Product A: 10
 3) Product B: 10
 4) Delivery X: 11
 5) Section 2: 12
 6) Product C: 13

After the move, only lines from 1 to 4 are re-sequenced. Leading to the
following sequencing:
 1) Delivery X: 10
 2) Section 1: 11
 3) Product A: 12
 4) Product B: 13

 5) Section 2: 12
 6) Product C: 13

As Product B has now a greater sequence than Section 2, it will be moved
after it.

If some lines between the source and the destination position have the
same sequence, all lines should be re-sequenced to prevent such a behavior.

opw-2531524

closes odoo/odoo#73456

X-original-commit: 8f64ac8ff2b94b66a8d8e94a8635727d0d53ca6b
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-07-08 17:56:36 +00:00
Géry Debongnie 46fdfdbd84 [IMP] web: update owl from 1.3.2 to 1.4.3
Github releases:

 https://github.com/odoo/owl/releases/tag/v1.4.0
 https://github.com/odoo/owl/releases/tag/v1.4.1
 https://github.com/odoo/owl/releases/tag/v1.4.2
 https://github.com/odoo/owl/releases/tag/v1.4.3

closes odoo/odoo#73436

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-08 14:14:14 +00:00
Hardik PrajapatiandMohammed Shekha 2ebb34b7cd [FIX] web: open list optional fields dropdown position to right place
Currently, the optional field's dropdown displays outside of the form view when
columns are expanded. it happens because the left css property is applied when
the column is expanded.

This commit fixes the issue by applying the correct css property after this
commit, the optional field's dropdown should always be positioned on the
right side of the list in ltr mode.

closes #69727
TaskID-2510187

closes odoo/odoo#73411

X-original-commit: bbc338438518bbb7d0e9ad1a313e872f95a36870
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-07-08 10:03:09 +00:00
yograj tandelandMohammed Shekha 3603654006 [FIX] web: broken listview dropdown on state_selection
Before this commit: when clicking on an editable state_selection widget in
listview, the dropdown is not displayed. this is happening because overflow
of cell was hidden.

After this commit: when clicking on an editable state_selection widget in
listview, the dropdown is displayed. change overflow to visible for
state_selection column. Also fixed the issue when selecting option from
state_selection widget row was get edited or if it is not editable listview
then view is swithed to form view, it is because of event propagation which
we stopped here.

Task - 2485883

closes odoo/odoo#68129

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-07-07 13:36:11 +00:00
Lucas Perais (lpe) 4fa4ff685a [FIX] web: load_state_tests: avoid undeterministic asserts
Before this commit, two tests had undeterministic outcomes:
they wanted to assert something in DOM was present at the same tiome as an owl rendering

After this commit, the problematic asserts are removed and the tests behave deterministically.

closes odoo/odoo#73379

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-07 14:31:04 +00:00
Mohammed Shekha 38fc6a6e80 [FIX] web: manually enter value in daterange throws error
before this commit: if user enters some random value in daterange widget and
click outside the daterange field it throws traceback while it should not throw
traceback, it should only warn user that you are entering wrong value.

after this commit: if user enters some random value in daterange widget then it
will show warning toaster that you are entering wrong value.

task-2410523

closes odoo/odoo#73366

X-original-commit: 588d133f3daf28e0ce69052ae57ad89c5a96eb3a
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-07 11:09:19 +00:00
Hardik Prajapati d03de125b9 [FIX] web: inconsistent hover cursor on some stat button
Before this commit: the hover property inconsistent with some content of the
stat button, it happens because the content of the stat button contains field
widget which contains 'o_quick_editable' class in read-only mode which has the
property cursor: default.

After this commit: stat buttons and field inside stat buttons will have cursor
pointer always as we override the CSS rule for the field inside stat buttons.

TaskID-2479807

closes odoo/odoo#73365

X-original-commit: 761d4f6634c98de3425cb40314d91606ab5fad57
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-07 10:42:39 +00:00
Lucas Perais (lpe) 23da5621f3 [FIX] web: router_service: concurrent hashchange
Do an action that will change the hash.
During this, change the url hash to load another action

Before this commit, the hash taken to load the second action was wrong, because the first
action pushed its state instants before the hashchange event is actually triggered.
This is because the hashchange event is triggered in a non blocking stack
(https://html.spec.whatwg.org/multipage/browsing-the-web.html#scroll-to-fragid)

After this commit, the right action is loaded with the right hash

closes odoo/odoo#72878

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-07 09:16:38 +00:00
Mohammed Shekha 2b34cea21c [IMP] web: display sequence field as non editable
Before this commit: when editable listview has sequence field with handle
widget and user edits row it is displayed with white background, while user
can not change it in edit mode so it should be displayed with grey background

After this commit: sequence field will be displayed with grey background in
editable listview in edit mode.

task-2507971

closes odoo/odoo#73173

X-original-commit: 9f00dcaedb280f403ff7576a31ff7f7e67f49c6c
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-07 08:02:52 +00:00
Christophe Monniez 16f470fa53 [FIX] web: blacklist odoo payments menu from click_all test
closes odoo/odoo#73268

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-07-06 06:14:17 +00:00
Francois (fge) f1fccbe3c7 [FIX] web: style issue with o_field_many2one_avatar
closes odoo/odoo#73285

X-original-commit: 1cd6348b6524c09f8ede88d3e7fd9399a8344b93
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-06 10:34:09 +00:00
Géry Debongnie 2063b26b09 [FIX] web: add context in pyeval context
When the owl refactoring landed, we rewrote the pyjs evaluation system.
Then, we used the new system in the new code. In particular, the action
service uses it to evaluate the action domain.

But the previous code had a subtle behaviour in the special case of
evaluating domain: it added the context as a pydict object in itself, so
one could evaluate expression such as `context.get('a', 14)` to read the
value of a key in the context with a fallback.

With this commit, we uniformize this behaviour across all python
expression: the `context` key is now reserved, and used to access
anything in the current evaluation context.

closes odoo/odoo#73227

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-05 12:53:44 +00:00
Simon Genin (ges) 9583c74e5f [FIX] web: make js tooling safe with paths with spaces
If $basepath in the tooling contained spaces, it could have dramatic
consequences on the rm -rf command.
We simply escape everything to avoid the problem.

closes odoo/odoo#73222

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-05 13:07:48 +00:00
Géry Debongnie f8ffa757c8 [IMP] web: optimize read/unlink when id list is empty
With this commit, we can simply skip performing a rpc when we know that
the id list given to read/unlink is empty.

closes odoo/odoo#73063

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-05 14:17:58 +00:00
Géry Debongnie 3e8ee3aedc [IMP] web: add some validation in orm service
Before this commit, orm service calls had no validation whatsoever,
which means that the requests would fail serverside, then display a
python traceback. This makes it harder for developers to find the cause
of the issue.  Also, it is easy to perfom some really basic validation
anyway.
2021-07-05 13:57:54 +00:00
Mohammed Shekha d8134350b8 [IMP] base,stock,web,website_sale: replace create_text with add-label
before this commit: create_text was passed in node options and due to which it
was not parsed by translate.py, pass add-label as attribute on field so that
translate.py parse it and it is translated.

after this commit: create_text will be passed as field attribute instead of
node options.

task-1923433

closes odoo/odoo#59713

Related: odoo/enterprise#19418
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-05 11:11:21 +00:00
Mohammed Shekha a65493fb83 [IMP] web: do not close column quick create on first column
Before this commit: When there are no columns in kanban and user is
creating very first column then it will display column + examples
clicking out closes quick create of column and due to which mockup
column also disappeared.

After this commit: Quick create of column will not discard if there
are no columns and user is creating very first column, clicking
outside will discard quick create of column if there is atleast one
column exist.

task-2517684

closes odoo/odoo#70220

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-05 08:36:17 +00:00
Simon Genin 063e38c4fd [IMP] web,mail: add resetLocalState to rendererWrapper
add resetLocalState method to rendererWrapper and test activity view is not
crashed on on_destroy_callback

task-2466057

closes odoo/odoo#73022

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-02 12:48:52 +00:00
Mohammed Shekha afa4ac684d [FIX] web: reset renderer local state when switching view
before this commit: when switching to form view from listview using Create
button and then activate some other tab and Discard that record which will
move back user to list view now again clicking Create button opens form view
but active tab is last activated form tab instead of first one, this is because
of local state is not cleared.

after this commit: when form view is switched back to list view using Discard
button, local state will be cleared, here we are explicitly removing 'active'
class from all tab and pages of all notebooks.

task-2466057

X-original-commit: ff0e5694e28a46287dc54ab440364e11e8e9c832
2021-07-02 12:48:45 +00:00
Francois (fge) 1e5a0dfc0a [FIX] web: display shortcuts correctly on the command palette
closes odoo/odoo#73048

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-07-01 11:37:45 +00:00
Hardik PrajapatiandMohammed Shekha 157b40ad5c [FIX] web: traceback on removing a groupby in editable list
Currently, a traceback is generated on removing a groupby when line is in edit
mode in groupable list view. It happens because the facet removal and window
click both are called at the same time.

This commit fixes the issue by ignoring the window click on removing the search
facet.

TaskID-2518527
closes #70236

closes odoo/odoo#73102

X-original-commit: da51bd7ef270fe5a481b937f0a3c296d0eea196c
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-07-01 17:00:13 +00:00
Bruno Boi 3bbfd1582b [FIX] web: do not open multiple groupBys submenus at once in pivot dropdowns
Introduced with odoo/odoo@5c5924af88

closes odoo/odoo#73076

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-07-01 12:55:25 +00:00
Andrea Grazioso (agr-odoo) d81875491c [FIX] web: filter out non-exportable fields
Go to User list
With studio add column User type
export

Traceback will occur because the special field sel_groups_*
should not be exported

opw-2565911

closes odoo/odoo#72861

X-original-commit: 196fe4c0be19310964b41da3b8a113f6d81aed6e
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-06-28 11:14:44 +00:00
Romain Tartière bac1f99312 [FIX] web: Adjust label#for to match input#id
The #for attribute of the LABEL tag should match the #id of the INPUT
tag, not it's #name.

This regression was introduced in a171694644

closes odoo/odoo#73052

X-original-commit: 979c9d71aee4b1bb6c8798bdfdbf69ac8af3fa69
Signed-off-by: Romain Tartière <romain@vittoriaconseil.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-07-01 09:05:16 +00:00
Mohammed Shekha 3212737a25 [FIX] web: color picker in readonly show default cursor
before this commit: when user is in readonly form, hovering on color picker
widget show cursor pointer due to which user has impression that it can be
edited while color picker should display default cursor in readonly form.

after this commit: in readonly form color picker widget will display default
cursor while hovering over color.

task-2326198

closes odoo/odoo#73011

X-original-commit: a7663fd5c0bf9f09dbb7fa472b1cb0ef3aa47930
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-06-30 16:27:44 +00:00
abd-msyukyu-odoo f69fa7af8c [IMP] web: add hover description for kanban progressbar sum field
This commit adds a sum field description when hovering the quantity at the end
of a progressbar. The description is the label (translated string
representation) of the field used for the sum.

Task-ID: 2243913
PR odoo/odoo#69380
2021-06-30 09:51:42 +00:00
abd-msyukyu-odoo eed1e64a93 [IMP] core, web: add a range for date(time) read_group
1. Objective

  - We are in a Kanban view, and we group by a "date/datetime" field.

  - In order to "quick create" a record in a group, or to "drag & drop" a
    record between 2 groups, we need a default value for this date field.

  - In this case, a group represents a "range" of dates. A default value could
    be the last date of this range.

  - Prior to this commit, the view had only access to a display string for this
    date range. We want to have access to the concrete bounds (start/end dates)

  - Since some date/datetime fields have backend constraints, it would be
    difficult to generate a compliant global default value. As such, the use of
    the default value should be disabled by default and activated on a field by
    field basis.

2. Usage

  - Use the last day (for dates), or second (for datetimes) of the range to set
    a default value in kanban "quick create" and "drag & drop"

  - Use the end of the range of the last group from a read_group to be able to
    request the next group (chronological order) in subsequent read_group calls

3. What are the changes in this commit

  - read_group from the "core" "models.py", with the added __range for
    date(time) fields, a dictionary for each group. The keys are the field
    names and the values are a dictionary with the following keys: value:
    - from: starting date(time) of the range (inclusive)
    - to:   ending date(time) of the range (exclusive)

  - XML changes:

    - with a new xml attribute on <field> tag allow_group_range_value (for the
      kanban view):

      - we allow (or disallow) supported non-readonly fields to be:
        - draggable
        - quick created

      - this attribute can be used only on date(time) fields, and if not set,
        the default behavior is false

      - the naming is subject to contention because it relates to
        different features. The relation comes from the constraint:
        To perform a drag&drop or a quickCreate, we must be able to get the
        value from the group containing the record.

  - JS changes:

    - we add "group.range" after a read_group for date fields, which is a
      dictionary: {field_name: {from, to}}, for each date(time) groupby field

    - since date(time) fields can use the format "date_field:granularity" when
      used in a groupby, we have to properly split out the granularity to ensure
      compatibility with the code previously in place (drag&drop procedures)

    - update mock_server and sample_server to make use of the date range.
      Adding support for datetime grouping to both mock and sample servers, for
      tests and previews.

    - the default value for kanban drag&drop and quickCreate features is the
      last day/second of the range for date/datetime fields

4. Why can't this range be computed from the original display value with
  moment.js

The Babel python library that we use for date(time) formatting (2.6.0) is kept
at the same version as the package in stable Debian Linux. This version has
some issues with displaying weeks consistently around the new year in certain
locales.

We cannot reverse compute a date(time) label with moment.js to get a range since
nothing guarantees that the range will be the same one that Babel used to
output it.

5. read_group return format discussion

Prior to this commit, the format of the value for the groupBy field was
either :

  - String : used as a display value for the group.
    Most notably, for date and datetime, this value cannot be used as a field
    value in most cases. It would be more practical to also return the date
    range along with the display value, so that Drag&Drop and QuickCreate
    functionalities can be properly enabled in views
    example :
      "March 2021" has the range ['&', (field, '>=', 2021-03-01),
        (field, '<', 2021-04-01)]
      This information is lost at the end of the read_group.

  - Array : used to indicate a res_id in case of a many2one field
    res_id = array[0]
    field_diplay_value = array[1]

Since we cannot use the array format to send the date(time)s of the period range
because it could be confused with the many2one format, this commit introduces
the use of a new `__range` key which is a dictionary with specific related
keys to be used to defer usable data to the web client.

Task-ID: 2243913
PR odoo/odoo#69380
2021-06-30 09:51:42 +00:00
Aaron Bohy 88340cc2fb [FIX] web: debug: allow to edit SearchView
Before this commit, clicking on "Edit ControlPanelView" in the
debug manager actually edited the "main" view (e.g. kanban), because
we used the wrong view id.

This commit also renames "Edit ControlPanelView" into "Edit
SearchView", which is more accurate w.r.t. to the view type.

closes odoo/odoo#72995

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-30 12:59:54 +00:00
Ivan Yelizariev 0249f87ed0 [FIX] web: prevent selecting element from html field
html field allows to insert html structures that can be treated as elements of
odoo web client. This patch updates setLocalState method (part of the web
client) to check if an element is inside html field, so such elements will be
ignored

---

opw-2520403

closes odoo/odoo#72877

X-original-commit: d2733da4863bd03b0cf853355596a44e901405d2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-06-28 14:17:07 +00:00
Xavier Morel 6cfc265944 [FIX] web: typo in test's attr key
Does not really seem used by the test so probably not much of an issue
either way.
2021-06-29 05:34:17 +00:00
Xavier Morel 03772ac07a [IMP] web: use testUtils in tests
Seems like a better idea than doing it by hand? IDK.
2021-06-29 05:34:17 +00:00
Xavier Morel 32062a3bbb [FIX] board, bus, web: replace deprecated test-utils calls
A number of functions from `web.test_utils` have been deprecated at
the module root and should be called through submodules.

Fix a bunch of remaining cases. Also add a few missing `await`s on
`triggerMouseEvent` calls. Don't bother rewriting the imports in
unpacking style as for most updating the imports is unnecessary. Do so
for `field_one2many_tests.js` where we have to rewrite the imports
anyway:

* recursively import controlPanel, createView, mock.patch and
  mock.unpatch
* remove the aliasing of controlPanel to cpHelpers
2021-06-29 05:34:17 +00:00
Xavier Morel 7d90cfac55 [FIX] web: SearchPanel warnings
Can't have a searchpanel with both:

* a filter (`field[@select='multi']`) with a `@domain`
* *and* a category (`field[not(@select='multi')]`) with `@enable_counters`

That specific case will trigger a warning and the counters being
disabled. Fix them. Oddly enough the only cases seem to be in tests...
2021-06-29 05:34:17 +00:00
Xavier Morel b39c5072f7 [FIX] web: avoid warning during qweb tests
One of the qweb tests checks that in a t-set @t-value takes priority
over body contents. However this construct also triggers a warning
when invoked.

Mock out `window.console` during qweb tests, this suppresses that
warning.
2021-06-29 05:34:17 +00:00
Xavier Morel de5aceb88e [IMP] web: test reliability
This test sometimes fails locally.

Updating it to be a bit more modern also seems to make it more
reliable (also moved the delay between the drag & drop operation & the
steps checking as it seems more logical, but the reliability issues
had disappeared before that).
2021-06-29 05:34:16 +00:00
Xavier Morel 3985edd5da [FIX] web: missing action id warnings
* Add test name when logging missing action ids, makes finding out
  which test causes the issue much simpler.
* Suppress the warning emission in the one remaining test which
  triggers it, as testing invalid action IDs is exactly the purpose of
  the test.
2021-06-29 05:34:16 +00:00
Xavier Morel 1e6de40b78 [IMP] web: downgrade warning messages to info
Two internal warnings are features which literally are not (entirely)
implemented, the tests can't be fixed to avoid them. Also augmented
the log messages with which test triggered the log, as it's very hard
to debug the issue otherwise.

As for the qweb debug mode warning, there's no way to disable it
easily because multiple tours explicitly opt into debug mode (with
good reasons), so it's not enough to just bypass the `mode` setter in
the test setup helpers (test_main in POS and main_tests in web), there
would also need to be special workarounds in the 4 modules which set
`owl.config.mode` based on the session's debug mode.

I don't know that this warning is even useful, it defaults to `false`
so the only situation in which this would be relevant would be for a
third-party to use Owl *and* explicitly enable the debug mode *and*
forget to remove it when deploying to production *and* look at their
console.
2021-06-29 05:34:16 +00:00
Xavier Morel 053285afdc [FIX] web: momentjs warnings
* Without an explicit format string, moment() should be called with
  ISO date(times).
* Correctly destroy all test locales (`zz` was not destroyed at all,
  and `englishForTest` was double-destroyed instead of destroying
  `frenchForTests`).
* Avoid creating a moment object from the value `false` in date(time)
  fields.
* Disable the warning entirely in dates_tests, the contents are super
  messy and weird.
2021-06-29 05:34:16 +00:00
Xavier Morel 29de1ef72b [IMP] web: reduce warning spam, only show rpc error warning in debug
Trigger a *lot* of spam while running tests

It's not great that this is now disabled:

* some cases are mistakes in the test e.g. RPC not properly setup,
  they should really be fixed
* others are literally testing error responses, the logging should be
  suppressed instead

Ideal scenario would probably be to upgrade this to `error` and have
an API of some sort to suppress it on a per-test basis (not unlike
`@mute_logger` on the Python side).
2021-06-29 05:34:16 +00:00
Xavier Morel 9528fd350f [FIX] qunit: suppress ResizeObserver error
The error is (apparently) benign and already suppressed in some parts
of the system, however it can (apparently) trigger locally during some
tests, causing the test to fail as the error is caught and converted
to a failure by QUnit.

Sadly QUnit does not offer a proper hook for this, so it has to be
suppressed by wrapping the existing handler and only calling it for
other errors.
2021-06-29 05:34:16 +00:00