Commit Graph
12325 Commits
Author SHA1 Message Date
Christophe Simonis 0e7675847f [MERGE] forward port branch saas-12.1 up to 0f4abc5c22 2019-02-22 16:25:02 +01:00
Christophe Simonis 9332e25195 [FIX] web: remove extra test added by forward-port
As related patch hasn't been forward-ported, this extra test (that isn't
execute for unknown reason) can be removed.
2019-02-22 11:14:43 +01:00
Christophe Simonis 7f9b7beed8 [MERGE] forward port branch 12.0 up to b2db72c9d1 2019-02-21 21:36:52 +01:00
Christophe Simonis 1d2b6f1bef [MERGE] forward port branch 12.0 up to 84143a34b3 2019-02-21 15:37:19 +01:00
Hiral BhavsarandMohammed Shekha bb6aec1ac3 [FIX] web: several columns in line chart tooltips for large data
Currently tooltip goes out off the screen when the
graph view (in line mode) presents a large number
of groups.
The present commit splits the tooltip content in
three columns when the number of groups exceeds
20. This split is not done in mobile mode because
it is not an appropriate in that situation.

Co-authored-by: Mohammed Shekha <msh@openerp.com>

Related to Task: 1917958

closes odoo/odoo#30288
2019-02-21 13:03:22 +00:00
Hiral BhavsarandMohammed Shekha 4b652ebe8a [IMP] web: properly display min and max abs when less that 3 abs.
In graph line mode, min and max abs are
displayed beyond the screen when there are less
than 3 abs.
This is happening because nvd3 fixes their
text-anchor to 'middle'. The present commit fixes
correctly their text-anchors to start and end
respectively by using the '!important' rule (it
seems difficult to do otherwise).

Co-authored-by: Mohammed Shekha <msh@openerp.com>

Related to Task: 1917958
2019-02-21 13:01:26 +00:00
Lucas LefevreandIldar Nasyrov 4b8e0d82bb [FIX] web: backport of 70c6d3b04c to 12.0
make sidebar filter generic

Adding `res_model` and `res_fields` attributes on a field of
a calendar view adds a filter in the sidebar.
It saves the result as the defined model and should save it
in the defined field.
However `partner_id` has been hardcoded in the rpc call that creates
the record. This breaks genericity, it cannot be used with another
field than `partner_id`.

This commit makes this generic by correctly setting the field name
in the rpc call.

closes odoo/odoo#31858

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>


Co-authored-by: Ildar Nasyrov <iledarn@gmail.com>
2019-03-15 13:28:12 +00:00
Martin Geubelle dcf8c67fe3 [FIX] web: hide CopyClipboard widget button when pointless
The widget has been moved in rev. odoo/odoo@15f3bbe but was not very generic.

In particular, there was a traceback when clicking on the button if the field
had no value (the button was displayed for readonly fields in create mode).

The button is now only appended in readonly mode (a `button` inside an `input`
or a `textarea` is not very DOM friendly) if the field has a value.

Task 1941996

closes odoo/odoo#31635

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-06 16:11:33 +00:00
Nicolas Lempereur a3489be331 [FIX] web: have link over whole many2one
The style of a link (color) of a many2one is only applied over the
first line (probably for eg. the partner on an invoice that has the
partner name and on following lines the address).

In some instance this make some sense, but on other (the name of a
product is too long from where it is) it makes no sense and seems buggy.

With this change, we have the link style over the whole link which seems
good enough.

opw-1947113
closes #31568

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-05 12:30:48 +00:00
Christophe Simonis f1ff55bca1 [MERGE] forward port branch 11.0 up to de8cefcef4 2019-02-20 13:40:48 +01:00
Nicolas Martinelli b431f8eadc [FIX] barcodes, web: float scannable
- Switch to French language
- Go to Inventory > Inventory Adjustment
- Launch an adjustment

The field 'Real Quantity' doesn't follow the float formatting.

This is because the widget is set as `field_float_scannable`, which is
not recognized by the formatting function.

Since the widget descriptor has priority over the type descriptor, we
must explicitly take this widget into account, on top of adding the
`format_value` method.

opw-1940884

closes odoo/odoo#31366
2019-02-22 13:45:30 +00:00
Lucas Perais (lpe) de8cefcef4 [FIX] web: pivot unload filter, reset, load another filter
On a pivot view with a default filter which has column and row groupbys
Remove the filter
Collapse all columns and rows
Activate another Filter from favorite which has a column groupby at least

Before this commit, the columns were not displayed in the DOM, though RPC's
and internal data were actually correct
This was because we considered the changes had been done "in place"
taking the old tree to build the new one for the columns
when really, we should have recomputed the column tree

After this commit, the columns display the group we want

OPW 1935155

closes odoo/odoo#31247
2019-02-19 15:12:28 +00:00
Mathieu Duckerts-Antoine 596206cdf6 [IMP] web: remove nvd3 library
It has been decided to use Chart.js instead of nvd3 to render charts.
Now that nvd3 is no more in use, we remove it.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Géry Debongnie 769806ad13 [REF] reimplement journal dashboard widget with Chart.js
This commit is one part of the task 'removing nvd3'.
We use now Chart.js to draw charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 604c43640a [IMP] web: use Chart.js in graph view
It has been decided to use Chart.js instead of nvd3 to render charts.
In this commit the graph view has been largely rewritten to benefit
from the options offered by Chart.js.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine a8d3ca771f [IMP] web: add library Chart.js
This commit makes possible to use the Chart.js library to create
various charts.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine a9bcb12f64 [IMP] web: graph view improvements
This commit extends the support of comparison mode for the graph view
and refine the tooltips and rendering in line mode.
The graph view code has also been slightly refactored.

Task ID: 1946138
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine d23419fd86 [FIX] web: call super in AbstractAction willStart
The commit https://github.com/odoo/enterprise/commit/19a144d6af2974e964c6487170e6bca1b14d3898 has
modified how libraries are loaded at several places and has
introduced a bug in sale_subscription_dashboard where the
libraries are no longer loaded at all. We fix that situation
by calling super in the willStart method of AbstractAction
that inherits from Widget. Abstract actions can now also
benefit from the mechanism present in Widget willStart.
2019-04-01 14:40:51 +00:00
Mathieu Duckerts-Antoine 4315e1b4aa [FIX] web: on_attach_callback of form renderer widgets
Before this commit, the 'on_attach_callback' method of a subwidget of
the form renderer would not be called when the renderer renders
itself but is already in the dom. This can cause problems when a
subwidget has to know if it is in the dom for its own rendering.
This commit fixes that situation.
2019-04-01 14:38:44 +00:00
Mathieu Duckerts-Antoine a804585700 [FIX] web: correct quarter format in mockReadGroup
Before this commit the value of a field (of date/datetime type)
used as a groupby was not correctly formatted in the test environment
when the granularity was 'quarter'. This commit fixes that situation.
2019-04-01 14:38:44 +00:00
Mathieu Duckerts-Antoine 863de16a91 [FIX] web: correctly update this.widgets
Old subwidgets of a widget inhereriting from BasicRender were not
correctly destroyed. This was the cause of various problems when
cycling over this.widgets.
2019-04-01 14:38:44 +00:00
Christophe Simonis 7ac5ec628c [MERGE] forward port branch saas-12.2 up to 18c735361a 2019-04-01 16:20:00 +02:00
Aurélien Warnon 220f5ae53f [IMP] sale_product_configurator: improve p. configurator
Task #1891970
Original p. configurator commit d3530eb

Purpose
=======
- The p. configurator now comes with a widget that is "o2m" like in the SO lines view.
  The widget is only used on the added "product_template_id" field on the SO line.

  This widget controls the opening of the configuration window and removes the need of a "Configure a product" button.
  The "SectionAndNoteListRenderer" is now cleaned from p. configurator specific code.

  The widget is also responsible for handling the configuration provided by the p. configurator form
  and applying it on the SO line with a 'field_changed' event that updates all the necessary fields.

- Added support for 'MULTI' and 'DELETE_ALL' operations on X2Many fields in basic_model.js
  - 'MULTI' allows to batch multiple operations at once
  - 'DELETE_ALL' behaves like 'DELETE' with all the current data of the field

Spec
=======
- remove "configure a product" from sale order lines
  When the product configurator is active, replace the product_product_id by a product_template_id
  in the sale order line. When we select a template without variants, it sets the variant automatically,
  but when we select a product template having variants, it opens the configurator dialog.
- add a widget to modify the product configuration in the sale order line (next to product template field)
- UX improvements:
    - Invert image and configuration in the main screen
    - If the product doesn't have an image, hide it instead of showing the placeholder (only for first screen?)
- new independent option in sales settings to activate product configurator.
  (same in e-commerce)
- demo data: Change demo data to set Customizable Desk & Conference Chair as make to order
- If only one attribute value that is Custom, don't display radio, selection or even color box
2019-03-28 14:55:00 +00:00
Martin Geubelle 32ab3422f0 [FIX] web: tests: correct pass hasSelectors
The attribute is true by default, but when it is set to `false`
in a test, it was not correctly passed in the view.

Note that it has no impact currently in the tests.

closes odoo/odoo#32175

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-27 15:36:59 +00:00
Sarah Van Bogaert ce4713cd0e [IMP] web: allow multiple fields in form views
This feature was already working in the actual version of Odoo but it is now tested. The following
features are supported:
- When the value of one widget is modified, the other ones change accordingly
- The modifiers 'invisible' and 'readonly' are applied correctly if they differ between widgets.
However, the modifiers 'required' must be equal for the several fields, otherwise the behavior
is not guaranteed.

closes odoo/odoo#32158

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-03-27 13:32:53 +00:00
Christophe Simonis 6b4758cd9a [MERGE] forward port branch saas-12.2 up to 7c1a9a8204 2019-03-27 14:29:01 +01:00
eco-odoo 7dfae39db4 [IMP] web: improve attachment files design
Task: 1893104
2019-03-25 10:23:49 +00:00
Martin Geubelle 3b9483f170 [REF] web: correctly reuse read_group old datapoint
Rev. odoo/odoo@5c6a7c9 made a change to reuse an old group datapoint when
performing a read_group, instead of restoring *some* properties of the old
group (so basically a `_.omit` instead of a `_.pick`).

This is a bad idea as some properties were bound to the new datapoint
(`evaluateModifiers` for example) so it doesn't make any sense to update
the old datapoint with theses properties.

closes odoo/odoo#31956

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-20 09:06:25 +00:00
Christophe Monniez 9ea4fefed2 [FIX] web: avoid click on home menu in community
A fix attempt for the clickEveryWhere test was made in 39e71353c5.
Unfortunately, the last modification of the fix were not tested on the
runbot and introduced two new issues.

1) The click method on the home menu has been changed to use an enhanced
   _click function. This function crash when the jquery element is empty.
   As this menu does not exists in community, the test miserably fails.

2) A "focus" event was added in the _click function that simulates a real click.
   But the "focus" event is not a mouse event and as nothing to do there.

With this commit, the _click function returns immediatly when the
element is empty.

Also, the "focus" event is removed from the _click
simulation but a focus method is used to give focus to the close button.

Giving the focus to the cancel button is itself a fix for the
DateTimePicker field (see 39e7135).

closes odoo/odoo#32082

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-03-25 08:16:24 +00:00
Raphael Collet 1ced3bfca4 [FIX] *: pass context in kwargs in rpc calls 2019-03-22 16:42:08 +00:00
Christophe Simonis 5df4746c9a [MERGE] forward port branch saas-12.2 up to 230ad8c381
closes odoo/odoo#32088

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-25 11:13:41 +00:00
Christophe Monniez 39e71353c5 [FIX] web: focus on close button when before closing a modal
During the clickEverywhere test, when a modal is opened, the hide method
is called to bypass it. This is not realistic and does not work in some
cases.

For example in Point of sale, menu "Reporting/Sales Details", a modal is
opened with a DateTimePicker (tempus dominus) already opened.
When hiding or closing the modal, the DateTimePicker needs to perform
some cleanup. If the modal is simply hidden, the DateTimePicker is not
cleanly destroyed.

With this commit, a modal is closed by clicking on its close button and
before that, the focus is set on the close button to let the
datepicker widget do its stuff on losing focus.

Also, a more realistic click is done by trigerring more events (code
adapted from tour helper).

closes odoo/odoo#32038

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-03-22 10:28:15 +00:00
Christophe Monniez e480406773 [FIX] web: click on home menu on next tick
Since odoo/enterprise@b830ea7ed2, the enterprise home menu is asynchrnonous.
Because of that, the clientActionCount variable is updated too late and
this counter is screwed up, making the test fail.

With this commit a setTimeout 0 is used to click on home menu in the
next tick and then update the current action count.

Also
 * the test is adapted to stop immediately when an error is catched.
 * the initial click on home menu is moved into debug manager because
   the python test launcher uses the correct location already.

Thanks to @VincentSchippefilt and @aab-odoo

closes odoo/odoo#31949

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-03-21 12:15:30 +00:00
Juhil Somaiya 5356f368bb [IMP] im_livechat, web: custom placeholder image
When the user has not set any image, it now displays the default
user image placeholder instead of the image placeholder in livechat.

Task-ID 1924666

closes odoo/odoo#30821

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-03-18 09:19:02 +00:00
David Monjoie 31983e0c2e [IMP] web: only display missing view erorr in debug assets
This error is there to help developpers realize their view has not
been loaded due to an error.

However, we have cases where we define actions containing views
that only exist in Enterprise to avoid creating an entire bridge
module just to add one view to an action.

The error was triggered in this case which resulted in a red build
for the click all runbot test, even though this was not really a
true error, as it was intended.

This commit changes the error to only appear in debug=assets such
that it will no longer put the click all runbot tour red while
still providing help for the developper trying to debug his view
since he will need to be in debug=assets to debug his view anyway.

closes odoo/odoo#31884

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-15 14:08:21 +00:00
Aaron Bohy 9a8f59a674 [FIX] web: update domain when switching between views
Let's assume the following scenario on an action with two multi
records views (e.g. kanban and list). In the kanban view, activate
a domain or groupby, switch to list view, remove the domain or
groupby, switch back to kanban: the domain or groupby is still
applied (even though it's no longer displayed in the search view).

This is due to the jQuery update (ab56e637b7) and the use of
native Promises (always async) instead of old jQuery 1.11 Deferreds
(which where sync when already resolved). In the new version, the
domain/context/groupby were added to the params a 'tick too late',
so the view was updated without that information (and thus the old
domain/context/groupby were kept).

Issue reported on the jquery update pad.

closes odoo/odoo#31859

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-15 07:35:21 +00:00
Christophe Simonis 44515bc7be [MERGE] forward port branch saas-12.2 up to c9f832d9f0
closes odoo/odoo#31790

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-13 14:24:51 +00:00
Aaron Bohy 5ee9e1d200 [FIX] web: correctly display crashes in firefox
After the update of jQuery, crashes were no longer displayed (in
dialogs) on browsers using the unhandled-rejection-polyfill lib
(e.g. firefox). This was due to a bad conversion from ES6 to ES5.

Issue reported on the jquery update pad.

closes odoo/odoo#31767

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-12 09:46:04 +00:00
Sébastien Theys 2f932e3a46 [IMP] web: add filename to qweb image widget
It's better to always have a relevant name in the image URL for SEO.

Also make sure there is always an alt on the image.

closes odoo/odoo#31705

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-08 15:41:52 +00:00
Aaron Bohy 0bc24a78a2 [FIX] web,*: adapt autocomplete dropdowns after jquery update
*partner_autocomplete,test_main_flows

In jQuery 3, the active element in autocomplete dropdowns is no
longer identified with class 'ui-state-focus' on the <li/>, but
with class 'ui-state-active' is on its child <a/>. Moreover, the
background color of the active element is now set on the <a/>
instead of the <li/>.

This rev. adapts scss rules accordingly, and selectors in the
main_flow_tour.

Issue reported on the jquery update pad.

closes odoo/odoo#31693

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-08 07:25:39 +00:00
qsm-odoo 1d3af8e957 [FIX] web: handle unhandled rejections in the frontend
Following of https://github.com/odoo/odoo/pull/28457. Promises which
are rejected are acting the same way as exceptions and thus have to be
catched. The Odoo `guardedCatch` method is not stopping the exception
though. In the backend, unhandled promise rejections are catched by the
CatchManager, which then ignore them.

This commit makes the frontend act the same way regarding unhandled
promise rejections. We might want to share the crash manager behavior
someday.

Part of https://github.com/odoo/odoo/pull/31664

closes odoo/odoo#31664

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-07 14:37:21 +00:00
qsm-odoo 6ad94ac6ef [REF] web: adapt 'makeAsyncHandler' to use Promises
Following of https://github.com/odoo/odoo/pull/28457. A `$.when()` was
kept while it seems possible to convert it to a Promise.

Part of https://github.com/odoo/odoo/pull/31664
2019-03-07 14:37:05 +00:00
Aaron Bohy 0bae5e2402 [FIX] web: bad conversion from ES6 to ES5
We had to manually convert the unhandled-rejection-polyfill lib,
and we forgot to replace this by self in two arrow functions.
This was causing crashes e.g. on Firefox.

We also forgot some uses of const, which is not really an issue as
const is supported on all browsers, but it is not ES5.

Issue reported on the jquery update pad.

closes odoo/odoo#31658

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-07 10:44:20 +00:00
ab56e637b7 [REF] web: adapt code after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:17 +01:00
380550f62f [IMP] web: don't swallow errors in async handlers
This commit adds a 'guardedCatch' function to the Promise API. This function
has to be used when we don't want to swallow real errors (crashes), like
'catch' does (i.e. basically all the time in Odoo). When the promise has
been rejected because of a real error, the rejected Promises chain bubbles
up to the top and triggers the 'unhandledrejection' event (triggered on
all browsers thanks to the unhandled-rejection-polyfill lib). We then add a
listener on that event to display real errors with the CrashManager.

Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:15 +01:00
Aaron Bohy 96b0319239 [ADD] web: unhandled-rejection-polyfill lib 2019-03-06 19:53:21 +01:00
Aaron Bohy ef88b8e408 [IMP] web: qunit: add hook at end of each test
This hook will be used to check that there are no leftovers in the
DOM.
2019-03-06 19:53:21 +01:00
David Monjoie aa24779cfa [REF] web: update qunit to v2.9.1
The new version of qunit better reports failures of promises then
the previous version.
2019-03-06 19:49:01 +01:00
David Monjoie 154c3dcda4 [REF] web: update select2 to v3.5.4 2019-03-06 19:49:01 +01:00
David Monjoie c8bab2ddb3 [REF] web: update jquery.ui to v1.12.1 2019-03-06 19:49:01 +01:00