Commit Graph
10406 Commits
Author SHA1 Message Date
Michael Mattiello (mcm) 4520a09f2c [REF] web: convert FieldBoolean to owl
This commit does 4 things:
- adds a file for deprecated legacy fields.
- moves legacy FieldBoolean into this file.
- converts FieldBoolean to owl component.
- adds a new xml file for component fields' templates.

task id: 2193996
2020-03-31 07:11:01 +00:00
Michael Mattiello (mcm) 9324282b01 [REF] web,*: add new field registry for components
* account

This commit adds a new field registry for component fields.
This field registry is used to only register the new field components
and the other one should register the legacy fields.
Those two registries will be used together while all legacy fields are
not converted to owl component.

As the legacy registry now throws an error when adding a component
field the existing component fields (account.ShowGroupedList and
account.ShowResequenceRenderer) are moved into the new registry.

This commit also refactors some field managers (form renderer, list
editable renderer, calendar popover) to use the new registry and thus
support the component fields.

task id: 2193996
2020-03-31 07:11:01 +00:00
Michael Mattiello (mcm) 91c7e574ed [ADD] web: add CustomCheckbox owl component
This commit adds an owl component for the Odoo custom checkbox.

task id: 2193996
2020-03-31 06:13:11 +00:00
Michael Mattiello (mcm) cde276a1ef [REF] web: add missing features of abstract field
This commit adds missing features of AbstractField written in owl.

task id: 2193996
2020-03-31 06:13:11 +00:00
Aaron Bohy 009fe3e81b [FIX] web: list: keep header checkbox selected
... when toggling an optional field.

This bug wasn't really important until now, but with the new
selection mechanism, it could lead to weird situations (e.g. the
selection box says that all records are selected, but the thead
checkbox isn't checked).

Part of task 2185145
2020-03-30 13:33:40 +00:00
Aaron Bohy 4fd30ecbc1 [IMP] web: adapt multi edit feature to list selection changes
We don't change the multi edit mechanism for now: it still only
applies to the selected records, limited to the current page.
However, we add the information in the confirm dialog to make it
clear for the user.

Part of task 2185145
2020-03-30 13:33:40 +00:00
Aaron Bohy 94583df492 [IMP] web: adapt delete feature to list selection changes
Following the new selection feature in list views, this commit
adapts the delete action.

Part of task 2185145
2020-03-30 09:55:08 +00:00
Aaron Bohy 8608a5ed8d [IMP] web: adapt (un)archive feature to list selection changes
Following the new selection feature in list views, this commit
adapts the archive and unarchive actions.

Part of task 2185145
2020-03-30 09:55:08 +00:00
Aaron Bohy 9755e8875b [IMP] web: adapt export feature to list selection changes
The export feature already exported the whole domain when the
thead selector checkbox was checked (unlike all other actions
which were executed on the current page only).

Following the new selection feature, this commit uniformizes the
behavior of the export with other actions: if the page is selected,
only the records on that page are exported. To export all records
matching the current domain, the user has to click on the 'Select
all' link in the control panel.

Part of task 2185145
2020-03-30 09:55:08 +00:00
Aaron Bohy 7af5fb31ec [IMP] web: selection in list views
This commit allows the user to apply actions to all records
matching the current domain in list views. It also ensures that
the user is aware of the set of records actually selected.

The number of selected records is now displayed in the control
panel, and the user can, with an additional click, select all
records matching the current domain instead of the ones of the
current page.

Task 2185145
2020-03-30 09:55:08 +00:00
Aaron Bohy 9be9a75e67 [REF] web: move _archive function to BasicController 2020-03-30 09:06:17 +00:00
Nicolas Lempereur b53cf339e4 [FIX] web,*: phone number ltr even in rtl language
Currently there is two ways in view to have a phone number displayed in
LTR in a RTL language:

- have `widget="phone"` on a field
- have a class o_force_ltr on the field

But this is currently done very rarely and fail in list view because the
direction of data cells is used, eg.:

```
<div style="direction:rtl">
  <table><tr><td style="direction:ltr">
      <span>+1 2 3</span>
  </td></tr><tr><td>
      <span style="direction:ltr">+4 5 6</span>
  </td>/tr></table>
</div>
```

will be displayed as:

+1 2 3
6 5 4+

In this commit, we use unicode-bidi* to optionally add an additional
level of embedding so direction is taken into account by the
bidirectional algorithm.

This commit also adds o_force_ltr class or phone widget on phone fields
where it is not already defined.

*: https://drafts.csswg.org/css-writing-modes-3/#propdef-unicode-bidi

opw-2224828
closes #48425

closes odoo/odoo#48588

X-original-commit: ab067218e069f0a92610c3f0d4137e563e47755c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-30 13:50:04 +00:00
Luis González 8ccdbea9a7 [FIX] web: Make company switcher widget usable with the keyboard
Background
==========

After the refactor on the multi-company behavior performed for v13, now
there are two possible actions per company, depending on where they're
clicked: switch to the company or toggle it. Such actions were handled
by `<div>` elements, which aren't keyboard-reachable by default.

The Issue
=========

Because of the above, the company switcher was neither reachable nor
usable when using the keyboard.

Solution
========

To solve this, the following is performed:
- Add HTML attributes required to make elements reachable, along with
  their corresponding aria attributes
- Actions that are currently triggered when clicking on an element, now
  are also triggered when the keyboard focus is on the element and `ENTER`
  or `SPACE` are hit

Closes #47650

closes odoo/odoo#48627

X-original-commit: 33a7238d0b03ccb89e4c4d2f0d7380b5649dc4d4
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Luis González [Vauxoo] <luisg123v@users.noreply.github.com>
2020-03-30 16:31:37 +00:00
Romain Estievenart 04cc2b5700 [FIX] web, web_tour: mobile quick search view issues
Now we have the mobile search_panel in enterprise,
this commit simply adapt the Odoo repos part with:

- Css Clean up
- Remove the no longer existing step inside the tour
the button 'o_enable_searchview' no longer exist
inside a M2X dialog

Task ID: 2200099

closes odoo/odoo#48376

Related: odoo/enterprise#9494
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-03-29 14:24:33 +00:00
Nicolas Lempereur 469b1a85d0 [FIX] web: show title for short event in day view
In 13.0, as of 369c20a9 there is some style that will show an event with
bigger font-size and spacing in calendar day view.

In this commit, if an event is short (less than 30 pixels, so less than
45 minutes) we will decrease the spacing to have the same as in week
view and see the event title more easily.

opw-2216654
closes #48391

closes odoo/odoo#48409

X-original-commit: a4d170ad9e73d1d63404532b161911df020b5c36
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-26 09:37:28 +00:00
Nicolas Lempereur f3182c6035 [FIX] translate.py,web: aria-label qweb translation and export
In 12.0 9de1bc0e aria-label translation was added for python views, but:

- aria-label attribute are not exported

- aria-label are not translated for JS view rendering

So by default, aria-label would only be translated for python views that
had the same aria-label term in a translatable element (eg. "title"
attribute).

opw-2222504
closes #48255

closes odoo/odoo#48275

X-original-commit: 6b6b11ea2f8391f1f195bd1650531f77b6bed729
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-24 14:46:30 +00:00
Luis González 680b2797d8 [FIX] web: Add missing aria attributes to selectable menu items
Some menus contain items that are selected/checked when they're
activated, e.g. when a filter is applied, the menu item corresponding to
that filter is checked. However, that information of what items are
checked and what don't, is not reported correctly using aria attributes.

To solve the above, the following is performed:
- Attribute `aria-checked` is set accordingly, usually using the same
  logic as the clas `selected`
- Attribute `role` is set to `menuitemcheckbox` or `menuitemradio`
  instead of `menuitem`, so `aria-checked` is applicable

This applies on the following cases:
- Standard topbar's menus: Filter, Group by and Favorites
- The company switcher widget

closes odoo/odoo#48301

X-original-commit: 64c0b47c0e8e8fdd3fa9b1bc13f2b49b6f49f4e1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-25 09:57:53 +00:00
jvm-odoo eaf62e948a [FIX] web: fix grouping content overlap
Issue

	- Be in multicompany
	- Have a company with a long name
	- Install Accounting
	- Settings > Currencies > Dollars
	- Click on the smart button "Rates"
	- Group by company

	Company name and rate overlap

Cause

	In `_computeDefaultWidths`, we use the method
	`_getColumnWidth` which returns a width depending on the
	field type.

	When you use group by, the fields order doesn't change
	so the company name in the group line have the width
	of the date field (92px) and there is nothing that
	limits the place that the string can takes so there
	is overflow.

Solution

	As it seems to be something very accurate, I think the
	safest solution would be to use the `o-text-overflow`
	saas mixin.

OPW-2218143

closes odoo/odoo#48318

X-original-commit: 2898dd4577e12326cbe83dce9fdbdef0e32d51e6
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-25 10:06:49 +00:00
Luis González 5dda9a709e [FIX] web,mail: Harmful or incomplete aria-label attributes
Some elements contain superfluous `aria-label` attributes, which
overrides any default useful information. For instance, some dropdown
menus contain the `aria-label` "Dropdown menu" (e.g. the company
switcher), which doesn't add any useful information, as dropdown menus
are already labelled correctly using `aria-expanded`.

This change applies on the following buttons:
- Schedule an activity
- View attachments
- View followers
- Switch company
- Open user options from systray
- The widget `state_selection`

closes odoo/odoo#48317

X-original-commit: e3c7f66e89d7be39dfa4cc3d6b038c6f4a114aa5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-25 12:39:02 +00:00
Julien Mougenot 70d426b948 [FIX] web: fix dataManager loading caches
Before this commit, coming back on a view when in 'debug=assets' would erase the
previously loaded favorites with an 'undefined' value. This was due to an incorrect
cache invalidation mechanism in the DataManager's load_views' method.

Now the views and filters caches are properly loaded if any of them has been invalidated.

closes odoo/odoo#48085

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-24 09:57:00 +00:00
Mohammed Shekha 5353fb2496 [IMP] web: trim FieldEmail widget value
before this commit, email widget was not trimming value and due to which
space aroung email value remain as it is added by user.

after this commit, email widget will trim the value and remove leading/trailing
space.

task-2197432

closes odoo/odoo#47470

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-24 08:02:13 +00:00
fja-odoo 65e8473464 [FIX] web: change invalid font awesome icon
fa-delete does not exist => fa-trash

introduced by: 6692919d1e

task-2211899

closes odoo/odoo#48207

X-original-commit: 1b830bf1c7211dad5c93ac6929c7c395b32f3f90
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-23 14:18:30 +00:00
fw-bot 94fee8a8dd Cherry pick of b0c5370fd25191b4e537805b006fba02fffe2b23 failed
stdout:

stderr:

closes odoo/odoo#48197

Error: could not apply b0c5370fd25... Revert "[FIX] web, purchase, sale: fix no currency in calendar view"
Hint: after resolving the conflicts, mark the corrected paths
Hint: with 'git add <paths>' or 'git rm <paths>'
Hint: and commit the result with 'git commit'
X-original-commit: e8d6f1eae0f4f9c0f4df78553b7d51a03087940f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-23 13:17:51 +00:00
Hardik Prajapati 3998fa8dc1 [IMP] web: removed extra space in export field list
before this commit:
when manually adding field in export wizard, string has extra space in
begining.

after this commit:
manually added field in export field list doesn't contain any extra
spaces.

task-2065433

closes odoo/odoo#36759

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-09-12 10:01:47 +00:00
Hiral Bhavsar 73834a659c [IMP] calendar, web: private events shouldn't be editable/deletable
Before this commit, when user attempts to edit or delete a private
event without being an attendee, it raises an access right error.

This commit disables edit and delete buttons in this case, in
addition to hide event details.

task-2151150

Closes https://github.com/odoo/odoo/pull/42569

closes odoo/odoo#42569

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-03-20 10:09:10 +00:00
Nisha patel 8978b0bc8f [IMP] web: Show company icon on property(company dependent) field
Purpose Of the task is, we need a visual cue on those fields to let
the user know that their value is company-specific.

So, in this commit On company depedent field we added a building
icon with title 'Values set here are company-specific' next to the
label in the form view.

closes odoo/odoo#47178

Taskid: 2001748
Closes: #47178
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-23 08:48:02 +00:00
Aaron Bohy f6c06bd0b8 [FIX] web: nested x2many with non inline views
Let's assume a form view with an x2many list, containing itself
an x2many field (no widget, so simply displaying the number of
records). When a record of the list is clicked, a form view
opens and displays the same sub x2many field, with widget
many2many_tags. Both list and form views of the x2many aren't
inline (thus have to be fetched on demand).

Before this commit, it crashed when the user clicked on a row
of the x2many list.

The bug has been introduced by a9cebd5a, which wrongly removed the
code handling this specific situation. At least, now we have a
test attesting that this code isn't useless.

Note that the diff isn't as scary as it looks like (we just added
an if/else, and thus indented the former code inside the else
clause).

closes odoo/odoo#48116

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-03-20 13:40:42 +00:00
Kaushalya Mandaliya e1b257bd8a [IMP] web: prevent tooltip duplication on a responsible in the calendar
Before this commit,
Hovering on a responsible on the right column of the calendar will:
    - show a classic yellow tooltip
    - show a custom tooltip with a bigger image

After this commit,
Hovering on a responsible on the right column of the calendar will:
    - show a custom tooltip with a bigger image if image exist
      else, show classic tooltip

PR odoo/odoo#45353
Task-2194828

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-03-04 09:50:58 +00:00
Mathieu Duckerts-Antoine 1959e7756a [FIX] web: do not activate falsy search defaults
Before this commit, if an action context would contain a key/value pair
like

    search_default_foo : 0

the filter foo would be activated, while it should be not considered
as default.

The present commit fixes that situation.

closes odoo/odoo#47958

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-20 08:06:41 +00:00
Yannick Tivisse 86691b1379 [FIX] web: Fix switch company menu glitch on mobile
Purpose
=======

When being logged on company A and clicking on company B, I should
log into the company A only.

Currently in mobile, the checkbox next to A remains enabled before the
refresh. With this commit, this behavior is fixed.

closes odoo/odoo#48045

Taskid: 2205603
X-original-commit: 19f196c0afd73c5d64b612aa413e6e6772e0c288
Related: odoo/enterprise#9373
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-19 15:31:08 +00:00
Julien Mougenot 71af8ee4f8 [FIX] web: update clickAll test helpers
Before this commit and following the refactoring of the home menu and the control
panel to the Owl framework, some of the helpers of the 'clickEverywhere' test have
not been properly updated to the new classes/behaviours.

Now the selectors target the right elements and some actions that were previously
synchronous are now properly awaited (home menu toggling, filter menu interactions,
etc.).

Also slightly changed the behaviour of the clickAll functions:
- requesting a click on a null element will make the test crash (added some conditions
  to avoid this in a standard flow).
- any error crashing the test at a deeper level will be displayed in the console
- an animation frame is awaited after clicking on an element. This is to comply
  with the Owl rendering system.

closes odoo/odoo#47762

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-18 12:33:02 +00:00
Jeremy Kersten 5bdec6351a [FIX] web_editor: allow widget text on field html in studio
Before this commit, widget='text' was not available in web_studio since 'html'
was missing from the supportedFieldTypes list of the TextField.

After this commit you can use widget text (and other derivated type of text).

task-sbu-feedback

closes odoo/odoo#48043

X-original-commit: 34bd90e7fc2aa094eac92b6f635c2d8d933ecb86
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-03-19 15:20:29 +00:00
Aaron Bohy 0b88e862a8 [FIX] web: editable list: activate correct field
We have an editable list with 4 fields:
  - fieldA (say boolean)
  - fieldB with readonly modifier, readonly iff fieldA is true
  - fieldC with readonly modifier, readonly iff fieldA is false
  - fieldD

Add a new row to the list: fieldA being false by default, fieldC
is readonly whereas fieldB isn't.

Change the value of fieldA: fieldB becomes readonly, and fieldC is
now editable.

From that point, before this commit, clicking on fieldC activated
fieldD (instead of fieldC).

The bug occurred since 3fd7b20, which added a delay between
the moment fields are re-rendered (and inserted at the end of
allFieldWidgets) and the moment there previous instances are
destroyed (and the new ones take their place in the list). So when
several fields were re-rendered at the same time, the order in
allFieldWidgets could not match the actual column order anymore,
and cause issues like the one described above.

Part of task 2210323

closes odoo/odoo#48039

X-original-commit: 89b9717c08e148ad94db17d8746faa2312b6a07a
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-19 14:59:50 +00:00
Rémy Baranx (bar) b3d9647695 [IMP] web: use do_action instead of BBQ push_state on RedirectWarning
In the RedirectWarning exception handler, it is better
to use 'do_action()' instead of using a BBQ push_state() and then
a location.reload(), to preserve the context and avoid losing menus
and breadcrumbs for example.

As the RedirectWarning receives only the action ID and not the full
action, a new parameter has been added to be able to provide a context.
This context is added in the 'additional_context' parameter of the do_action()

TaskID: 2168071
2020-03-19 12:59:09 +00:00
Siddarth Gajjar 41822a5022 [IMP] web: improve height of input inside oe_title > h1
studio now supports adding of oe_avatar, in few cases oe_avatar field is added
inside oe_title > h1 and while input is also inside h1 so height of input
increase as we have image tag as a sibling, to fix this set height of input
to fit-content.

task-2172320
Closes #47968

Related: odoo/enterprise#8176
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-03-19 09:16:50 +00:00
jerome hanke (jhk) e58db3ff5c [FIX] web: graph view ignores duplicate labels
Steps to reproduce:
- install recruitment
- go to recruitment > configuration > job positions > duplicate a job
and keep the exact same name as the original > change the department
- add any application to the newly created job position
- go to recruitment > applications > all applications > select the
graph view > group by job

Previous behavior:
you only see one of the two jop positions with the same name
the graph view does not handle multiple labels with the same name
and only keeps the latest values when rendering

Current behavior:
duplicate labels are suffixed to prevent the view from confusing them

opw-2214284

closes odoo/odoo#47948

X-original-commit: a77086f8bcb4498361d1183ba8af3d0663cd031b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-03-18 17:22:59 +00:00
Aaron Bohy f79f9c5133 [FIX] web: report client action: mount control panel
Before this commit, the 'mounted' hook of the control panel in the
report client action was never called, because of a missing call
to '_super'. As a consequence, the 'Print' button wasn't displayed.

closes odoo/odoo#47940

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-03-18 16:07:16 +00:00
Julien Mougenot d678d516ef [FIX] web: action menus default select_all
Before this commit, the context sent by an action performed by the action menu
could hold an 'undefined' select_all key, which would cause the context evaluation
to crash.

Now, the select_all key is defaulted to 'false' and does not crash in actions that
do not provide it.

closes odoo/odoo#47745

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-17 08:26:25 +00:00
Nicolas Martinelli a12479aaa8 [FIX] web: rounding error
In JavaScript, the following computation introduces numerical errors:
```
Math.pow(10, -4) = 0.00009999999999999999
Math.pow(10, -5) = 0.000009999999999999999
```

In the context of `round_decimals`, such errors propagate to
`round_precision`, ultimately leading to inconsistencies between Python
and JS (see #47300 for detailed use case).

Instead of computing `Math.pow(10, decimals)`, we parse the scientific
notation to prevent such inaccuracies.

We also introduce tests in line with the Python tests.

opw-2205092

closes odoo/odoo#47694

X-original-commit: cb471897bfa08d1fee6a9f49e90d9c120e1733fc
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-16 12:01:57 +00:00
jvm-odoo 3f9c3b475c [FIX] web: fix control panel long breadcrumb
Issue

	- Install CRM and Events
	- Change Azure Interior Name with a
	  very long string
	- Click on "1 Events" smart button

	The view is shifted out of the screen

Cause

	In 12.0, the control panel was separated
	with 2 div where width = 50%

	Now they use flex. (they are still 50% width
	by default)

	The long name is hidden by a `overflow:hidden`
	and there is a `text-overflow: ellipsis` to
	avoid extra-width issue.

	The problem is that there is a `white-space:
	no-wrap;` which force an extra width and
	this cause the shifting.

Solution

	We come back to the 50% even if there is no search view.
	Breadcrumb will always be on the top left area of the screen
	which simplifies the code and avoid jumping left to right
	(taking all the width of the screen) which can be disturbing
	for users.

closes #47063

OPW-2210786

closes odoo/odoo#47603

X-original-commit: 019dc91020a461263c29004ef0c304a8f91abae9
Related: odoo/enterprise#9219
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-13 13:40:26 +00:00
Julien MougenotandMathieu Duckerts-Antoine 18e5416636 [REF] web: Adapt views/actions to new control panel
Some web actions/controllers/viewsl have been adapted to properly instantiate the
newly refactored control panel and update it accordingly. We needed to adapt the
starting mechanism of actions and controllers to ensure that the control panel
instantiation did not delay the loading of any widget.

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 14:08:33 +00:00
Julien MougenotandMathieu Duckerts-Antoine fbf347498f [REF] web: Control panel Owl
Refactoring of the control panel with the Owl framework.

The MVC structure of the control panel has been changed to a 'component <-> model'
relationship. As such:
- Removed the old control panel: view/model/controller/renderer
- Created a new Owl Component (ControlPanel)
- Created a new class: the Model (an Owl Store did not fit here) and a newly
  designed ControlPanelModel extending it

Refactored all inner subcomponents, including:
- Pager
- ActionMenus (peviously SideBar)
- Filter menu
    > Custom filter item
- Group by menu
    > Custom group by item
    > Removal of groupby_menu_mixin (and refactored graph controller in sibling commit)
- Time range menu
- Favorite menu
    > Custom favorite item
    > Moved the favorite menu registry to the favorite_menu file
- Search bar
    > Removed and splitted auto-completion dropdown logic between the new SearchBar
      Component (descriptions) and to the new ControlPanelModel (domains).

The templates (all in web/base.xml) have been adapted to the new standards. Most
of the DOM structure remains unchanged with some occasional improvements (replace
hiding with not rendering, removed pointless wrapper divs, etc.).

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 14:08:33 +00:00
Julien MougenotandMathieu Duckerts-Antoine 0a129284e4 [IMP] web,*: Enhance test helpers
1. Test utils helpers adapted to properly instantiate the new Owl control panel
2. New file 'test_utils_control_panel' to create a control panel and use helpers
3. New helper: createComponent (creates a generic component, see jsdoc)
4. Use of the new helpers in the current tests (more in sibling commits)
5. Helper 'addMockEnvironment' is now asynchronous
6. Owl config mode set to 'dev' in test suite (props validation)

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 11:39:53 +00:00
Julien MougenotandMathieu Duckerts-Antoine 72f1633532 [REF] web: Move control panel mobile to enterprise
Now that mobile is not supported anymore in community, the mobile layout of the
control panel has been entirely moved to enterprise. This caused some conflicts
with the community mobile test suite (which does not make sense anyway). The failing
tests and related style sheets have been moved as well.

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 09:37:30 +00:00
Julien Mougenot da8790f0bb [IMP] web: Dialog: add option to stop click propagation
There are situations where we don't want clicks to be detected behind an opened
dialog: for example, when a dialog is opened by a dropdown, we may want to keep the
dropdown open while we interact with the dialog.

There is now an option (default: true) to stop clicks propagation when
they arrive at the dialog container.
2020-03-13 09:37:29 +00:00
Julien Mougenot 384e516218 [REF] web: Update generic files
General cleaning of some helpers and generic files. The idea is that they are
less likely to be entirely re-written in the near future so this is a way to
keep the code clean, readable and compliant to the current standards. Changes include:
- Use of async/await when possible
- Use of const/let instead of var
- Removal of underscore.js
- Use of native JS instead of jQuery when possible

The logic of the affected code remains the same.
2020-03-13 09:37:29 +00:00
Julien Mougenot 11ba58a311 [REF] web: Indent and reorganize generic files
The purpose of this commit is to correctly indent and order some generic files.
There is strictly no change in the code logic.
2020-03-13 09:37:29 +00:00
Joseph Caburnay 78beadb748 [REV] web: allow patching getters
This reverts commit d6b854306c.

The reverted commit introduced issues in patching class methods.
Introducing getters in the patch function is not actually compatible
with the original method patching.

Test for patch method is also introduced to guard patch from future
invalid modification that happened.

A more robust  way of patching classes is now being developed.

closes odoo/odoo#47557

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-13 08:41:15 +00:00
Aaron Bohy f692a39677 [FIX] web: FieldMany2ManyTags: failing quick create record
The FieldMany2One allows to quick create record (name_create).
However, sometimes, required fields on the co-model make the
name_create crash. In this case, the FieldMany2one opens a form
view in a dialog to let the user specify those fields, and create
a new record with the 'create' method. This was working fine.

The FieldMany2ManyTags embeds a FieldMany2One to let the user
search for and select or (quick) create tags. In this case, failing
quick creation didn't fallback on the dialog form view, but
displayed a server error instead. This commit fixes this issue.

Bug introduced by 50bf8309f8

Task 2192754

closes odoo/odoo#47183

X-original-commit: 63ab065f3298c13bb19ae1245d7fd2652581b254
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-09 10:31:01 +00:00
jvm-odoo 31551f8e51 [FIX] web: prioritize record context instead of bin_size
This commit allows to pass a bin_size context to False.
Before this commit it wasn't possible because it was
always overriden.

OPW-2208232

closes odoo/odoo#47491

X-original-commit: 17d53cea1043054dfa9c39b16b430539c4082a9d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-12 12:10:11 +00:00