Commit Graph
10240 Commits
Author SHA1 Message Date
Christophe Simonis c6353942ff [MERGE] forward port branch saas-14 up to 5162ca7be7 2019-03-18 10:53:01 +01:00
Christophe Simonis 5162ca7be7 [MERGE] forward port branch 10.0 up to 36ba37a7a1 2019-03-18 10:20:06 +01:00
Pierre Paridans bdc0b4b892 [FIX] lunch: make it work on mobile
This module didn't worked on mobile: user cannot select the products or
see their cart.

This commit reworks the LunchKanbanWidget template and introduces a
dedicated template for mobile. This template introduces a button at the
bottom of the screen to toggle the "cart" widget on mobile (hiding it by
default).

It tries to make the best use of the existing Bootstrap classes allowing
to have a more responsive layout and reducing the custom CSS required by
this module (both in desktop and in mobile).

This commit adds a decent JS tests-suite (mobile & desktop) to this
module as the existing one left substential parts of the UI untested
(opening wizard when clicking on a kanban record, cart's lines content,
clear cart button, widget structure and content based on the state...).
Those tests are also less based on DOM nodes order/tag names and use
instead dedicated classnames.

It also modifies the LunchKanbanRecord click handling to had a dedicated
event handler instead of overriding the default _onGlobalClick() and
make it more testable.

Task ID: 1945032
2019-03-19 09:26:08 +00:00
Christophe Simonis bd63913326 [MERGE] forward port branch saas-11.3 up to 4e39328a76 2019-03-18 20:03:24 +01:00
Christophe Simonis ff1bca32f3 [MERGE] forward port branch 12.0 up to a26496b6e7 2019-03-14 17:43:32 +01:00
Christophe Simonis ac4ef455c4 [FIX] web: correct view definition in new test 2019-03-14 15:01:09 +01:00
Christophe Simonis 9a4e84ae66 [MERGE] forward port branch saas-11.3 up to f5ab04ce50 2019-03-14 14:13:47 +01:00
Christophe Simonis bbedcdb190 [MERGE] forward port branch saas-12.1 up to ff1bca32f3 2019-03-14 19:44:55 +01:00
Sébastien Theys fec83667bb [FIX] web: fix kanban_image when called for a different record
The issue is manifesting for example in the Contact kanban view where the
company image should be displayed in small. Before this fix, the person image
was displayed twice instead.

Following PR #30881 and commit: f78b7a76d6

The fix introduced by the above commit highlighted another issue with the
method: if the `model` and `id` given in parameter are different than the
current record, the method returned the url for the current record instead of
the requested record.

To fix the issue, we return the `raw_value` only if the requested record is the
current record. Otherwise, we return the manually built url.

PR: #31842

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-14 14:10:54 +00:00
Christophe Simonis f5ab04ce50 [FIX] web: adapt new test to extra rpc call made on view loading 2019-03-13 17:55:13 +01:00
Christophe Simonis afe8e97800 [MERGE] forward port branch 11.0 up to c23d1186e7 2019-03-13 16:52:40 +01:00
Martin Geubelle 170c7632f2 [FIX] web: hide handle on readonly x2m
The widget handle was displayed on x2m fields in form views, even when
the field was readonly, which makes no sense.

It is now correctly hidden.

Fixes #30580
opw-1937833

closes odoo/odoo#31743

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-13 09:31:37 +00:00
Denis Vermylen 791a38a655 [FIX] web: qweb2: allow null values in a foreach iteration
Before this commit iteration in a t-foreach containing null or
undefined values crashed because they have no attributes.

closes odoo/odoo#31828

Signed-off-by: Fabien Meghazi <amigrave@users.noreply.github.com>
2019-03-12 16:15:39 +00:00
Martin Trigaux 7e2f9634d2 [FIX] web: do not use t-if inside assets
This makes the assets to be recomputed everytime somebody with a different
language load the page.

closes odoo/odoo#31782

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-03-12 10:58:53 +00:00
Christophe Simonis ecd8c023b7 [MERGE] forward port branch 11.0 up to e5f93b83c6 2019-03-08 15:08:16 +01:00
Lucas Perais (lpe) 6b676f6235 [FIX] web: record datapoint context without group_by or orderedBy
Have a list view, apply a group_by and a filter with a sort parameter

Click on one record to access the form view
Have a x2m within it

Before this commit, the x2m records were loaded with a context containing
the keys orderedBy and group_by
It seems harmless at first, but even conceptually those keys should not be here
- they apply on a list of records, and not to individual ones
- they may contain field names not existing in the x2m model
Hence, when accessing another list view through an action button, the list
will try to be orderedBy or group_by with the given context
Which is plain wrong in the first place and may cause crashes

After this commit, the context of a record datapoint (representing a single record)
is stripped from the keys

Read the opw for a concrete use case
OPW 1943583

closes odoo/odoo#31706

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-08 13:30:30 +00:00
Florent de Labarre 5aa00c3362 [IMP] web: allow to override the number of buttonbox buttons
See odoo/odoo#31546

closes odoo/odoo#31698

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-03-08 09:38:23 +00:00
Nans Lefebvre 245286949f [FIX] web: fix kanban css for overflows
If the content is too long, it overflows badly.
Since the height is fixed, the flex doesn't work well.

opw 1924145

closes odoo/odoo#31717

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-08 16:07:34 +00:00
Martin Geubelle 590c9d8e33 [FIX] web: add a fallback for kanban_label_selection
Before 11.0 the kanban view used to have its own widget registry. It is not the
case anymore, but there are still leftovers from the past. For example, the
widget `kanban_label_selection` is still used in many views, even though it is
now called `label_selection`.

As we are in a stable version, a fallback has been added for it in the field
registry.

Similar to odoo/odoo@5401c15

Closes odoo/odoo#30904
Closes odoo/odoo#25928
2019-03-07 08:45:41 +00:00
Christophe Simonis 71faa19af0 [MERGE] forward port branch saas-12.1 up to 2b3296bbf8 2019-03-11 14:42:34 +01:00
Christophe Simonis 2b3296bbf8 [FIX] web: use stricter css selector in new test
It allow not matching the dropdowns of the search view.

closes odoo/odoo#31738

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-11 10:16:53 +00:00
Christophe Simonis 2c5c9b8342 [MERGE] forward port branch 12.0 up to c023d0784f 2019-03-08 17:56:14 +01:00
Christophe Simonis c023d0784f [MERGE] forward port branch saas-11.3 up to ecd8c023b7 2019-03-08 16:10:55 +01:00
Nicolas Lempereur ee5f1e277d [FIX] web: pivot no result no remove groupbys
Since f8b38f64d dictionaries "groupbys" are the same object between the
pivot model instance and the headers menu.

But this causes an issue in 12.0 since when there is no results, the
headers menu groupbys is truncated and now being the same object, the
pivot model instance is also truncated.

So succedding search that find results would possibly have lost the
groupbys which is unexpected and breaks some 12.0 tests not expecting
it.

With this changeset, the groupbys are not truncated anymore.

Without the change, the added test fails with:

 Column groupby not lost after reload after empty results
  expected: { "pivot_column_groupby": [ "customer" ],
              "pivot_measures": [ "__count" ], "pivot_row_groupby": [] }
  result:   { "pivot_column_groupby": [], "pivot_measures":
              [ "__count" ], "pivot_row_groupby": [] }
closes #31644

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-06 17:02:35 +00:00
Martin Geubelle 1793d6d138 [FIX] web: update breadcrumbs when switching view
To reproduce:
 1. go on list view
 2. open record in form view
 3. come back on list view
 4. switch to kanban
 5. open record in form view
 6. click on breadcrumb

Before this rev. we were back on the list view, and not the kanban view.

This is due to the fact that the breadcrumb was not updated when switching view,
(if a controller was already existing) so the form view control panel breadcrumb
was still referencing the wrong (list) controller.

This bug appeared with the control panel refactoring, which is now managed by
the view itself (and not the action manager as previously).

Task 1932646

closes odoo/odoo#31598

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-06 10:28:01 +00:00
Christophe Simonis 3e54704e66 [MERGE] forward port branch 11.0 up to 27081bf6f5 2019-03-05 17:26:04 +01:00
Nicolas Lempereur b8d4fe6d38 [FIX] web: keep col group by on 2nd reload+after 0 result
In 11.0 f8b38f64d improved the column group by managment when reloading
several times by having the same "groupbys" dictionaries between the
pivot model instance and the header menu.

This has been reverted in 12.0 (with c6e7adfb95) because the following
pivot tests failed with the change:
- 'rendering of pivot view with comparison'
- 'export data in excel with comparison'

The failure is because now that the "groupbys" dictionaries are the same
object, the truncated dictionary of a header truncate the one of the
model instance.

So if we search something that has no results, then something with
results, the groupbys could be lost.

This behavior has no reason to be and is changed in 11.0 with #31644,
this commit is the forward-port of f8b38f64d and #31644.

closes #31627

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-06 17:04:42 +00:00
Christophe Simonis 1c712986c4 [MERGE] forward port branch saas-15 up to 1f1fa35c07 2019-03-04 15:49:35 +01:00
Christophe Simonis 1f1fa35c07 [MERGE] forward port branch saas-14 up to 232da9a0ec 2019-03-04 13:40:44 +01:00
Aaron Bohy df7fcfb3fd [FIX] web: remove duplicated entry in field_registry
Commit 4960453d added the field signature in field_registry.js and
in signature.js.

closes odoo/odoo#31434

Signed-off-by: =?utf-8?b?R8OpcnkgRGVib25nbmllIChnZWQp?= <ged@openerp.com>
2019-03-05 09:11:37 +00:00
Martin Geubelle 8316c2d210 [FIX] web: correctly handle (no result) selection in search
In the recent control panel refactoring, selecting '(no result)' (when using the
autocomplete on a many2one for example) was no correctly handled and was leading
to a traceback.

It is now correctly handled and the search bar is correctly re-rendered.

Task 1936745

closes odoo/odoo#31438
2019-02-27 10:33:41 +00:00
Christophe Simonis 4c46dd4f9d [MERGE] forward port branch 10.0 up to 2f139632d6 2019-02-27 10:42:03 +01:00
Nicolas Lempereur f8b38f64d3 [FIX] web: keep col group by on 2nd reload
In 187c32c2 some improvements were made for conserving/restoring group
bys on the pivot view.

This introduced an issue on the column group by:

- before reload, if we set manually a column group by (+ icon in the
  header) it would be saved and not lost (unless a context or filter
  in the search view override it)

- after reload, the following manually set column group by are not saved
  anymore on subsequent reload (the column group by at the first reload
  are set back)

This behavior is not normal since the behavior (conserving or losing
column group bys) should be the same at first reload or second reload.

The issue was caused by the duplication of group bys that were not
synchronized (one on the column root header, one on the pivot model
instance).

Without the change, the added test failed with: "Column groupby not lost
after second reload" and product_id is hidding from the object
pivot_column_groupby dictionary (having only "customer").

Using _.clone on initialRowGroupBys was necessary change because without
duplication of "groupbys", the initialRowGroupBys would be changed on
expandHeader which is unexpected.

opw-1941095
closes #31407
2019-02-26 14:54:46 +00:00
Aaron Bohy 6a8e1b53e3 [FIX] web: search more in many2one: filter on ids
Let's assume a many2one field with a lot of possible values. The
user clicks on 'Search More...'. In the opened dialog, only 160
records are available (their ids have been obtained with a
name_search, with the optional text the user could have typed in
the many2one input).

Before 4cd379cf, that extra domain on ids was removed automatically
as soon as the user interacted with the search view in the dialog.
This was especially useful when there were more than 160 records.
However, this was rather an happy coincidence than a designed
feature.

From 4cd379cf, the ids selection was added to the initial domain
of the list, so they couldn't be removed from the domain
afterwards. The user was thus stucked with its preselected 160
records.

This rev. doesn't restore the former behavior, but rather improves
the current one, as follows:
 - when there is no text in the many2one input (i.e. no value to
   filter on), we bypass the name_search, s.t. all records are
   available in the dialog
 - when there is some text in the input, we perform a name_search (as
   before) to get a list of record ids, and we add a special filter
   to the search view in the dialog (the filter on those ids), s.t.
   the user can remove it if he wants to access the remaining records.
 - finally, the limit is now set to 320, to mitigate the problem

Issue reported on the saas-12.1 migration pad.

closes odoo/odoo#31232
2019-02-26 08:26:51 +00:00
Pierre Paridans c0f8690d1b [FIX] lunch,web: display correctly list's cell with text overflow
Installing the 'lunch' module add css rules to the generic list view
styling, modifying the styling of all the list views by the simple fact
of being installed.

The goal of those rules is that in list view a table cell with the
o_text_overflow class should still be displayed as a table-cell (and not
a block/inline-block).

Without the lunch module a list view's cell with the o_text_overflow
class is narrower and break the alignment between this column and the
headers.

This commit moves the necessary rule (display property) to the web
module and apply them globally.

Remark: module's css rules shouldn't override globally the one from
'web'.

Original commit: https://github.com/odoo/odoo/commit/855c6dac25fccaf9312543022001ed0b360d6e13

closes odoo/odoo#31506
2019-02-28 15:08:15 +00:00
Christophe Simonis 06898fac3c [MERGE] forward port branch saas-12.1 up to f9d3b5b7df 2019-02-28 13:47:09 +01:00
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