Commit Graph
10240 Commits
Author SHA1 Message Date
len-odoo 52d779007d [FIX] web: use read to update record values after resequence
Commit:
https://github.com/odoo/odoo/commit/818c18e55d0718286ff5bf332186a10f4d7a58ef
Updated the resequence logic in a way that was almost falser than before.
The added test however did work by coincidence, as index values were equal to
the sequence field values.
To be sure that we synchronize with what happens on the server, we do a read
after the resequence.
Additionnally, we take into account the result of the server resequence return;
if it is false, it means no resequencing happened, so we should not do a read.

opw 1867049

closes odoo/odoo#27184
2018-10-12 07:51:12 +00:00
8445baa08d [FIX]web: do not crash when dismissing a modal with escape
stopPropagation of navigation_move event for where direction=cancel,
currently if navigation_move event throws error when user press escape
in dialog where dialog is opened from editable list record

Scenario: Install website_sale -> Open Product form(variant enable) ->
open variant tab -> open Attribute m2o form popup and press Escape on dialog
Result: Error
Expected: It should close dialog and keep editable list view record open,
btw m2o field should also be focused when dialog is closed but that's
another issue, will be fixed in another ongoing task

Related to Issue: #1873919

Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2018-10-09 09:46:39 +02:00
Lucas Perais (lpe) 034a27f630 [FIX] web: customizing filter doesn't close dropdown
Have a many2one, click on search more

Open the filter menu of the search view

Add custom filter

Click to select a field

Before this commit, the whole dropdown closed

After this commit, it doesn't

OPW 1911337

closes odoo/odoo#28969
2018-11-26 14:47:44 +00:00
Lucas Perais (lpe) 889bdd3569 [FIX] web: fielddate[time] should select their value when entering them
Before this commit, when focusing on a date[time] field, the value was not selected
In v11.0, it was

This is due mostly because of the migration to BootStrap 4

After this commit, the value inside the input is selected

OPW 1911333

closes odoo/odoo#28989
2018-11-26 14:51:09 +00:00
Aaron Bohy 06b91b7658 [FIX] web: benchmarks: add missing test_utils
Without those, the benchmarks suite can't run.

closes odoo/odoo#28996
2018-11-23 15:00:17 +00:00
Aaron Bohy fad35964bf [IMP] web: backport of new asserts
This rev. is a complement to the partial backport 49e78f46 of
abf32b8. In addition to the helpers, we also backport the asserts
(like isVisible, containsOnce...).

closes odoo/odoo#28994
2018-11-23 14:51:49 +00:00
Aaron Bohy 76cc621c1d [FIX] web: grouped list view: group header layout
This rev. ensures that the group name is vertically centered inside
the group header row. Padding rules have been moved from enterprise
to community.

Task 1878254

closes odoo/odoo#27603
2018-10-11 19:03:57 +00:00
qsm-odoo c7f72248a9 [FIX] web: clear all BS4 alerts
Commit https://github.com/odoo/odoo/commit/8caf84f70ada259f041b424d37686845604d182a
was not handling the case where there was an invisible DOM element
between the button box and the alert component. Let us clear all alerts.

This commit also introduces a way to properly fix/extend bootstrap in
future fixes/updates (some of our rules may already be moved in that
file once it is forward-ported to master).

closes odoo/odoo#27662
2018-10-11 16:31:24 +00:00
Nicolas Lempereur 92bfbfd4f7 [FIX] web: improve style header background layout
As per fpodoo specification:

- decrease max width of logo (from max 33% of header width, to max 22%)
- decrease font-size of tagline by 30%

So logo is smaller, and company address has less probability to get
pushed lower (since sum of contents are larger than width).

Sizing the header works as follow:

If the header is equal to wkhtmltopdf page width or bigger, it is zoomed
out until it fits. So with current configuration:

- 100% of width is 900px,
- company tagline is at maximum 33% (300/900),
- company logo is at maximum 20% (200/900),
- remaining (company address) is remaining space of 44% (400/900)

closes #27641
2018-10-11 14:18:13 +00:00
Alexandre Kühn b7cf456560 [FIX] web: self.menu.change_menu_section is not a function
Revision on https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242

The commit above changed the menu in community, so that it
looks like enterprise. To do so, it copies the menu management
from the enterprise repository to the community repository.

Some code about the home menu has been removed, since it is replaced
with the app menu in community. However, some functions have been
removed by accident, such as `change_menu_section`.

Closes #27436
2018-10-10 15:39:25 +00:00
ThanhDodeurOdoo 1dbb555aab [FIX] document: JS feature disabled
Reason: This feature currently has unfixed bugs, does an unnecessary RPC and
was functionally replaced by a button inside the chatter in commit
7f97c9f and the menu inside the debug manager in commit d12b88315.

This commit disables the JS part of the document module to prepare
for the complete removal of the whole module and the MOV of
the indexation to base.

Closes #27613
2018-10-10 18:28:13 +00:00
Martin Trigaux 0aa0cec97a [FIX] web: do not warn on empty field
If no value is specified on the datefield, do not set a warnfuture message

Remove code comment that was referring the condition present at b51b0d66c2
but no longer present.

Add tests

Fixes #27551

closes odoo/odoo#27593
2018-10-10 13:59:36 +00:00
qsm-odoo 8caf84f70a [FIX] web: clear form button box before an alert
On the user form view, just after the button box, there might be an
alert component. Since BS4, this alert goes over the floating button
box in community. Before BS4, the button box went over the alert (so it
was functional but still ugly).

This commit adds an extra style for community only: clear the button
box before an alert component.

Closes https://github.com/odoo/odoo/issues/27435

closes odoo/odoo#27566
2018-10-09 09:08:48 +00:00
svs-odoo 078b31dc7f [FIX] web: Make datetimepicker configurable in datetime fields
The datetimepicker option was introduced to be able to customize the
datetime picker widget in date/datetime fields. However, due to the way
the _makeDatePicker function was coded, it did not work in datetime
fields.

Thank to Yajo for the initial fix

closes odoo/odoo#27541
2018-10-09 12:34:23 +00:00
Nicolas Martinelli 360212f206 [FIX] web: remove reference to Enterprise version
closes odoo/odoo#27505
2018-10-08 07:27:40 +00:00
Nicolas Martinelli 38ee891bf6 [FIX] web: appropriate color theme
Do not mix Community and Enterprise color themes. Moreover, increase the
contrast of the control panel for better readability.

closes odoo/odoo#27502
2018-10-08 06:20:55 +00:00
Pedro M. Baeza 1be50fdeaf [ADD] *: support SVG images
Introduce official support for SVG files in the framework, including the
following parts:

1. When client-side SVG images are uploaded, the content is displayed until
you save using data URI scheme according RFC 2397 [1]. This scheme requires
to specify content format. Using hardcoded "image/png" works for all images
types except SVG.
Type-sniffing is done using "magic byte" detection via the first base64
encode byte, so that the proper data URI scheme can be used.
This should not cause SVG-related security problems as the file is
displayed through `<img>` tag, which does not allow SVG scripting [2].

2. Make /web/image controller compatible with SVG

3. Add support for SVG files for company logo, which uses a dedicated
controller.

4. Resizing of SVG files is a no-op, as it makes little sense for a
vector-based format. We also want to avoid micro-alterations to the SVG
document (in "natural" viewport parameters) as we would store multiple
copies of the files in the filestore.

5. Because SVG files are inherently dangerous, upload of SVG files is
restricted to administrators, either by blocking it directly before
saving it in the database (binary fields with attachment=False), or by
neutering them to text/plain mimetype (for binary fields with
attachment=True)

6. Add tests for the SVG upload cases and for the non-admin uploads.

[1] https://tools.ietf.org/html/rfc2397
[2] https://www.w3.org/wiki/SVG_Security

Closes #26635
2018-10-03 17:48:01 +02:00
Xavier Morel a47f6093f8 [ADD] auth_password_policy{_signup}: password strength widgets
* generic strenght meter widget which can be included in various
  places
* password field, taking over the isPassword special cases strewn
  throughout the codebase, this should probably become an actual thing
  in core /cc @ged-odoo, the meter is opt-in as most uses of
  `field[@password=True]` are passwords & secrets for third-party
  services or external servers for which a meter would not make sense
* separate override of the ChangePassword wizard which isn't a regular
  view for some reason
* direct implementation for signup pages (create user & reset password)

Skip/comment/remove existing testing of @password fields: the policy
replacement/augmentation needs to make an RPC call and does not
support readonly use (because it doesn't seem to be used anywhere so
that made sense?); and there currently is no way to augment or
override/replace existing tests, so the tests will either fail when
auth_password_policy is installed (current situation) or fail when
auth_password_policy is not installed (if updated to be compatible
with APP).
2018-10-02 20:54:00 +02:00
Alexandre Kühn 4e2dffadda [ADD] web:tests: user menu basic tests 2018-10-02 17:58:47 +02:00
Alexandre Kühn 09cbe3e3b2 [FIX] web: no shortcut for app menu
This menu mistakenly tells that there is a keyboard
shortcut to navigate in the app menu.
2018-10-02 17:58:47 +02:00
Alexandre Kühn ef15d1ce3d Revert "[FIX] web: 'Shortcuts' in user menu (community)"
This reverts commit 05971d0050.

This menu makes sense in community, therefore we re-enable this
menu.
2018-10-02 17:58:47 +02:00
qsm-odoo 39fb86a352 [FIX] web, *: remove useless mixin
* mail
2018-10-02 17:29:30 +02:00
qsm-odoo 43655b3b39 [FIX] web: restore dashboard text-right design
We should style review the kanban (dashboard) design / grid system / ...
2018-10-02 15:17:09 +02:00
qsm-odoo 3b2ab5a499 [FIX] web: review disabled checkbox design
Thanks to @kea14
2018-10-02 15:17:09 +02:00
Adrien Dieudonne b2cadc9238 [FIX] web: avoid no content helper for pie chart in comparison mode
In comparison mode with no data, we render two empty pie charts even
if it's not an embedded view.
The non content helper is still used when there is no comparison.
2018-10-02 13:10:34 +02:00
Mathieu Duckerts-Antoine 64d7da4198 [FIX] web: fix update problems in graph view
The graph view was not updated correctly with respect to
time range menu data. We fix that problem in this commit.
2018-10-02 13:04:34 +02:00
qsm-odoo 9df7bca6f5 [FIX] web: prevent users to type invalid values for opacity
Also, make all the _updateXXX methods follow the same structure.

Thanks to @kig-odoo for spotting the issue.
2018-10-01 21:33:32 +02:00
Alexandre Kühn 05971d0050 [FIX] web: 'Shortcuts' in user menu (community)
Revision on https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242

This menu item should not appear in the community version of Odoo.
The commit above mistakenly added this menu item, even though no
logic was implemented for it. This was a consequence of the copy
& paste approach to rapidly deploy the new navbar in community.

(Note: a big refactoring of the web client is coming very soon,
so this duplicated code issue should only be temporarily).

This commit fixes the issue by removing this menu item in the
community version.
2018-10-01 18:19:48 +02:00
Mathieu Duckerts-Antoine 9b5dabd399 [FIX] web: right labels in bar chart and comparison mode
For a single groupby selected, the graph view didn't render well
the data when simultaneously in bar chart and comparison mode.
The labels were in that case always integers.
This commit fixes that situation.
2018-10-01 16:42:12 +02:00
Christophe Simonis 9b477f5311 [FIX] web: define used variable in test
Oversight of previous forward-port
2018-10-01 16:21:46 +02:00
Christophe Simonis 43b63a0465 [MERGE] forward port branch saas-11.4 up to 57e387b645 2018-10-01 16:01:54 +02:00
RomainLibert b2870ae1eb [FIX] web: add shortcuts menuitem support
Since https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242, it was possible to click on a "Shortcuts" menu item
in community which triggered a call to _onMenuShortcuts whose
implementation was only defined in enteprise

As the keyboard shortcuts are available both in community and
enterprise, we should support this menu item
2018-10-01 15:13:57 +02:00
Adrien Dieudonne c4937132a3 [FIX] web: line chart x ticks labels overlapp
This commit hides some labels depending of the avalaible size
of the graph.

We had to skip some test because 'renderEnd' is not triggered
for line chart. We need to update nv.d3.
2018-10-01 14:24:51 +02:00
Aurélien Warnon 27a7393852 [IMP] product,(website_)sale: Product configurator default_get cleanup
Targets commit d3530eb07e

Purpose
=======

[Follow up AL review]
Removed the default_get override in the sale_order_line model.
- The default values to create records are now specified by pefixing them with "default_" in the JS.
  That will use the built-in framework method, which is more simple/clean.

- The "list_editable_renderer.js" file for the product configurator was removed and its content is now merged within
  the SectionAndNoteListRenderer.

Updated fields:

- [sale_order_line in sale/sale.py] "product_no_variant_attribute_values" to "product_no_variant_attribute_value_ids"
2018-10-01 13:28:41 +02:00
Christophe Simonis 998723b909 [MERGE] forward port branch saas-11.3 up to e980af9df0 2018-10-01 11:27:51 +02:00
Andrea Ulliana 5ba0216b74 [FIX] web, *: support opacity in colorpicker dialog
* web_editor, website

Add an opacity slider and an opacity input to control opacity over
the chosen color.

task-1887571
Closes https://github.com/odoo/odoo/pull/27289
2018-10-01 11:00:54 +02:00
Mathieu Duckerts-Antoine a4b1c4193e [IMP] web: count measure first if selected in pivot view
The count measure is now put first in the order
of selected measures.
2018-10-01 10:38:14 +02:00
Lucas Perais (lpe) 1bd7adcc8b [FIX] web: debug_manager set defaults
On a form view, click on set defaults, select a value for a field,
then save

Before this commit, there was a traceback because the model on which we apply
the defaults was not found

After this commit, it works as expected

OPW 1887032
OPW 1888715

closes #27148
2018-10-01 09:31:15 +02:00
Xavier Morel 10228fe3ef [ADD] web: ability to become superuser (uid=1)
* requires that current user has group_system
* only visible in debug mode (?debug)
* available at login or via debug menu
* special systray color in superuser sessions

Closes #27254
2018-09-28 17:25:36 +02:00
Martin GeubelleandAaron Bohy f4b2060af5 [FIX] web: handle lazy load with previous actions
Before this rev. the lazy loading of views was correctly handled if there was
only one action in the action stack (which is usually the case when performing a
F5, the main use case of the view lazy loading).

Nevertheless, it might happen that the lazy-loading is used in top of other
actions (when performing a `doAction` with a form view for an action with
another view as first view, i.e. when leaving Studio while editing the form view).
The controller was `unshift` in the case (put in the first position of the
controller stack), which is not correct.

This causes the breadcrumb to be misordered and a traceback occured when trying
to access a breadcrumb element.

Co-authored-by: Aaron Bohy <aab@odoo.com>
2018-09-27 12:34:04 +02:00
Mathieu Duckerts-Antoine 53a9bdf900 [FIX] web: only default time range works
If a default time range was set in the action but no
other default filter or groupby, the time range wasn't applied.
This commit fixes that situation.
2018-09-27 12:34:01 +02:00
Mathieu Duckerts-Antoine 3c093a8108 [FIX] web: human numbers and percentages
A recent modification of the float and integer
formatters allowing the rendering to be human readable
causes a bug in the percentage formatter for large values.
The reason is that the latter formatter uses formatFloat (wich can
now produce 'numbers' like 3k) and then parse the result. In the case
of 3k an error is raised since 3k is not recognized as a true number.

This fixes avoid to parse the number in case it has been formatted
to be 'readable'. Note that the parsing was essentially used
to produces better percentages like 10% instead of 10.00%.
This is not necessary in our case since utils.human_number takes care
of the unwanted (not all) decimals for us (the original number is always
rounded by utils.human_number).
2018-09-27 11:58:39 +02:00
Martin Trigaux 17416e664c [FIX] web: translate search view
Group By and Filters strings in the search view were not translatable
2018-09-27 10:24:32 +02:00
Vincent Schippefilt 13d3456791 [FIX] web: fix crash in sidebar when adding attachment
task-id : 1873908
2018-09-26 21:42:58 +02:00
Mathieu Duckerts-Antoine 692b557284 [FIX] web: avoid empty header in pivot.
In comparison mode, a useless line with an
empty header was sometimes created due to
problem in the treatment of read_group results.
This is no longer the case.
2018-09-26 18:21:39 +02:00
Mathieu Duckerts-Antoine 61253cbf6b [FIX] web: better submenu switcher style in groupby menu 2018-09-26 17:42:55 +02:00
Vincent Schippefilt 4f624b70fc [FIX] web: dialogs with shouldFocusButtons option have the focus set.
Before this fix, sometimes dialogs that had the option shouldFocusButtons set on open
did not set the focus on the buttons. This is especially true for the "discard changes"
dialog where it is less usable with the keyboard.

After this fix, we wait for the widget to append itself to the dom before setting the focus.
2018-09-26 16:18:41 +02:00
Vincent Schippefilt fe4c3e0064 [IMP] web: do not set accesskeys on buttons with tabindex=-1
It excludes a lot of 'noise' when we do not set automatically access keys to all
the skipped items, this allows a better focus on actions when using the keyboard.
2018-09-26 16:18:41 +02:00
Vincent Schippefilt 01abb0f254 [FIX] web: focus the buttons in warning dialogs 2018-09-26 16:18:41 +02:00
Adrien Dieudonne 498c27a6af [FIX] line chart: show tick labels on x axes
Before this commit all x axis labels were not displayed because
ticksLabels was empty.

Now, we show all labels except the first one and the last one
because they are truncate.

We need at least two intermediate labels to know the scale and
the direction.
So, we only remove labels when there is more than 3 data points.
2018-09-26 15:55:12 +02:00