Commit Graph
10240 Commits
Author SHA1 Message Date
Mathieu Duckerts-Antoine 01c159fd9f [FIX] web: quotes and backslashes in search view
The commit 6d3ada178f
aimed to solve problems occuring whith (single or
double) quotes when creating new custom filters.
Unfortunately, the point was missed and bugs were
still present. The present commit solves the
orginial problem satisfactorily.
There was also a problem in the management of
backslashes. Type '\\' in the search bar would
lead to a domain like
[('...', 'ilike', '\\\\\\\\\\\\\\\\')].
This has also been fixed. Note that it is
necessary to input "\\" if one is looking for a
backslash in db (as before).

A remark on the _formatAST function (py_utils.js):

We deescape only the chars `'`, `"`, and `\`
because it does not seem possible to produce a
string in the search view that would intend a
search for a line return or a tab for example.

A general remark:

Domains should always be in normalized form.
In that way they could be manipulated and combined
together without a tokenization/parsing!

closes odoo/odoo#29756
2019-02-12 12:45:51 +00:00
Lucas Perais (lpe) 6d5a993cf7 [FIX] web: control panel load/save filter sort param
Before this commit, the wrong semantics was implemented in the webclient
concerning the "sort" char field in ir.filter
Loading a filter with a sort with negative order made the webclient crash

This field holds a JSON string, representing a list of field names
If the order of the field is inverse, there should be a "-" before it
for legacy purposes

After this commit, the semantics have changed for consistency
that is, at save time the sql notation is preferred
We support the legacy notation too for backward compatibility

closes odoo/odoo#31102
2019-02-15 09:58:47 +00:00
Christophe Simonis 93d736e905 [MERGE] forward port branch 12.0 up to 6e8dff1952 2019-02-11 16:17:02 +01:00
jbm-odoo 4960453db9 [IMP] web Add widget signature on binary field
Add a new widget for binary fields. It open a dialog box and the user can sign manually,
or an signature can be draw automatically or he can upload a picture of his signature.
Move fonts, controller, scss,templates about signature from portal to web to avoid redundance

closes odoo/odoo#30222
2019-02-14 12:59:10 +00:00
Louis Baudoux da4cb0acb5 [FIX] web: pass buttons_template as parameter of KanbanController
Before buttons_template couldn't be passed as parameter, which prevented
from changing the button template used when rendering the button
2019-02-12 11:00:18 +00:00
Romeo Fragomeli 183ff490d6 [IMP] *: add mobile (native) barcode scanner for product field
This commit change widget to many2one_barcode in these views:
- sale_order
- purchase
- invoice
- expense

In the fields register 'many2one_barcode' is mapped to many2one as fallback.
many2one_barcode is implemented in odoo enterprise

Task ID: 1924766

closes odoo/odoo#31018
2019-02-14 09:41:33 +00:00
Romain Estievenart 6ac1ce8579 [IMP] web: mobile kanban tabs UX
The mobile kanban title tabs required to move from column to column
1-by-1 to go from the first to the last column. Focusing everytime to
only the active column has ugly side effects when the titles are long
(eg. text overlapping).

This commit change the mobile kanban tabs UX by allowing to scroll
through them and go directly from a column A to B. It also improve the
readability independently of the title's length.

This behavior is heavily inspired by Material Design.

See: https://material.io/design/components/tabs.html

Task: 1893168
2019-02-14 09:51:04 +00:00
Romain Estievenart 1fca14bfa1 [REF] web: cleanup the layout update for the mobile kanban view
The goal of this refactoring is mainly to improve the code readability
of the layout update in the mobile kanban renderer by focusing on each
parts separetaly:
 * mark current column as the active one.
 * compute the title tabs' position.
 * compute the content column's position.

Task: 1893168
2019-02-14 09:42:11 +00:00
Romain Estievenart 848ea507ec [FIX] web: column data not loaded on mobile kanban view
This commit apply those changes:
 - Avoid overflow widgets array by checking its boundaries when the user swipes
   on the kanban column.
 - Extract the success callback update layout to avoid duplicated code.

Task: 1893168
2019-02-14 09:33:57 +00:00
Romain Estievenart 829003178e [FIX] web: error on mobile when kanban groupedBy change
Sometimes when the groupedBy view is changed the index of the current
active column overflow the kanban tabs length.

In this commit this effect is avoided by resetting the active
kanban column to the first one when the groupedBy is changed.

Task: 1893168
2019-02-14 09:25:21 +00:00
Priyanka Kakadiya bd0e0605cc [IMP] web: add 'Last 5 Years' as a period option
This commit adds the option 'Last 5 Years' in
the list of periods available to selection in
the filter menu and the time range menu for
the date/datetime fields.

Task: 1916017

closes odoo/odoo#29423
2019-02-13 15:47:20 +00:00
3a5f6bfa9f [IMP] web: add kanban searchPanel
This rev. defines a searchPanel widget used in Kanban views to
refine search according to specific dimensions. This wigdet is
displayed as a sidebar to the left of the kanban view.

Part of task 1892462

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2019-02-13 12:23:28 +00:00
Aaron Bohy 33207ed452 [REF] web: linting pass on kanban tests 2019-02-13 12:23:28 +00:00
Aaron Bohy 0eaee45659 [IMP] web: force activeActions to be boolean
The docstring says they are boolean, but they actually aren't
(e.g. edit="0" in the arch would lead to activeActions.edit=0).

This could cause issue if that value is used to toggle a class
with jQuery, as in this case the flag argument *must* be a boolean.
2019-02-13 12:23:28 +00:00
Martin Geubelle 06de564074 [REF] web, *: remove JSONP support
JSONP can be entirely replaced by the CORS mechanism, which is simpler.
We support CORS in our routes since 8.0 (odoo/odoo@9cce88a), so it's about time
to get rid of JSONP.
2019-02-13 09:38:30 +00:00
Martin Geubelle 016f9612ba [REF] web: clean ajax and session 2019-02-13 09:38:30 +00:00
Martin Geubelle 31664422c1 [IMP] web, *: remove explicit references to session_id
Since rev. odoo/odoo@f4d541e the `session_id` cookie uses the `httponly` flag so
it cannot be accessed through client side script. But before this rev. the
`session_id` was still provided by the server to the webclient (in session_info,
mostly) and was stored and accessible. This made XSS injection more
dangerous than they should be as it was very easy to steal the `session_id`.

As the browser automatically set the `session_id` on every request to the server,
the webclient shouldn't need any explicit reference.
2019-02-13 09:38:30 +00:00
Christophe Simonis 75eec26da3 [MERGE] forward port branch saas-11.3 up to 728bb2a28e 2019-02-11 12:47:52 +01:00
Christophe Simonis 8c29df10e0 [MERGE] forward port branch saas-12.1 up to 93d736e905 2019-02-11 17:00:35 +01:00
shreya thakrar 0993546553 [FIX] web: improve visual glitch for 'many2many_tags' field widget on settings view
- For 'res.config.setting' view, when there is a field with
'many2many_tags' widget, a drop-down is not displayed
properly. (For example, see 'default_cashbox_lines_ids'
field from point_of_sale module)

 - This commit fixes the above visual glitch by properly displaying
the field having 'many2many_tags' widget on settings view.

Task id - 1935608

closes odoo/odoo#30956
2019-02-11 10:25:02 +00:00
Xavier Morel 8b5399c476 [FIX] web: properly destroy services in test mock
closes odoo/odoo#30793
2019-02-18 09:46:49 +00:00
Xavier Morel 005164d237 [FIX] web: AbstractStorageService should destroy its storage
If that storage is destroy-able (aka RamStorage), storage objects are
created "inline" without attachment (as they may or may not be parented)
and this means those created implicitly in tests can't be tracked and
cleanly destroyed even by destroying the storage service object.

closes odoo/odoo#30790
2019-02-18 09:34:14 +00:00
Christophe Simonis 728bb2a28e [MERGE] forward port branch 11.0 up to 9553240adc 2019-02-08 19:19:57 +01:00
Romain Estievenart 41b8a6a563 [IMP] web: mobile calendar today button alignment
The "today" button should be aligned (both size and position) with the
view switcher icon.

Task ID: 1891955
2019-02-08 15:41:51 +00:00
Romain Estievenart 4dfd14ed00 [REF] web: extract calendar mobile styling
Extract mobile calendar styling into dedicated SCSS file.

Task ID: 1891955
2019-02-08 15:39:58 +00:00
Romain Estievenart a5ab43ebe6 [IMP] web: Remove CTA should be hidden on creation
- Hide the "Remove" button on the create modal's footer.
- Update title when click on "Save & new" button

Task ID: 1924887

closes odoo/odoo#30209
2019-02-08 14:30:57 +00:00
qsm-odoo 905d18e044 [IMP] website, *: add new logo sizing option
* portal, web

This commit introduces the first of many-to-come non-color website user
values: the logo height. Now, the user can choose it in the customize
dialog.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:38:31 +00:00
Christophe Simonis 87924cb5ad [MERGE] forward port branch 12.0 up to a46138cb01 2019-02-07 13:14:02 +01:00
Christophe Simonis 25e5f0c7ab [MERGE] forward port branch saas-12.2 up to 06898fac3c 2019-02-28 14:45:13 +01:00
qsm-odoo 36caf5fc16 [FIX] web: disable (new) sanitization of tooltips
Bootstrap 4.3.1 introduced tooltip sanitization. Odoo should normally
use tooltips for secure content anyway, so this commit disables this
sanitization. A proper analyse of our tooltip should however be done
to know if sanitizing is needed (it can also be enabled case by case).
2019-02-27 12:27:39 +00:00
qsm-odoo f74ab64df7 [FIX] web: do not show BS deprecation warnings
Part of https://github.com/odoo/odoo/pull/31401
task-1944790
2019-02-27 10:28:30 +00:00
qsm-odoo 9a7858efe1 [FIX] web: remove bootstrap sourceMappingURL
Same as https://github.com/odoo/odoo/commit/8e17223c260add842d83b2549d7bdaa4c3cc4d6c

Part of https://github.com/odoo/odoo/pull/31401
task-1944790
2019-02-27 10:28:30 +00:00
qsm-odoo 4697d74480 [IMP] web: update bootstrap 4.2.1 -> 4.3.1
See https://blog.getbootstrap.com/2019/02/11/bootstrap-4-3-0/
and https://blog.getbootstrap.com/2019/02/13/bootstrap-4-3-1-and-3-4-1/

Again, some fixes were added in this version and not in a 4.2.x version
so there is no clean way to backport them in 12.0 / saas-12.2.
If needed, the file bootstrap_review.scss is there for that.

Among the new features, two notable ones:
- The '.modal-dialog-scrollable' class which does what odoo already
  implemented for all its modals. So we could remove our custom code in
  a next update.
- Responsive font sizes ! Plan was to develop something similar for the
  website, so this comes at the right time. The behavior is opt-in, we
  will enable it in a next update.

Part of https://github.com/odoo/odoo/pull/31401
task-1944790
2019-02-27 10:28:30 +00:00
qsm-odoo a80775ce3c [REF] website, *: stop using 'animation' confusing name
* web, website_blog, website_sale, website_twitter

Before this PR, all website widgets were named 'Animation'. Now that
they are 'Public Widgets', we can at last stop using the confusing
'animation' name.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:09:23 +00:00
qsm-odoo 335a505d1f [REF] website, *: move and review the notion of edit mode
* portal, sale, web, website_blog, website_crm_partner_assign,
  website_forum, website_event_track, website_links, website_mail,
  website_slides, website_mail_channel, website_mass_mailing,
  website_sale, website_sale_comparison, website_sale_delivery,
  website_sale_wishlist

The `editableMode` option and its related options in public widget
should only be part of website, this commit moves them there. This is
also the occasion to implement something that is long overdue: stop
creating 'animations' / public widgets in edit mode by default. Indeed,
lots of 'animations' were defined by beginning with 'if not edit mode'.
Now, if a public widget should be considered in edit mode, it must be
defined explicitely through a property at *definition* of the widget.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:09:22 +00:00
qsm-odoo 3eb9269308 [FIX] web: consider the body when there is no wrapwrap
Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:02:59 +00:00
qsm-odoo 7b960c66bb [REF] website, web, *: move part of website into web
* im_livechat, survey, website_forum

When website is installed, the JavaScript code has access to utilities
to define improved widgets which are automatically attached to existing
DOM elements on page load. Those mechanics are more and more needed in
portal which does not depend on website (as it is website which depends
on portal). This commit moves part of website JS to web, so that it can
be used by all 'frontend' apps whose only common dependency is web
(portal, survey, auth_signup, ...).

This PR also questioned several other similar issues which will be
handled later like:

- website should maybe not depends on portal but only on http_routing

- part of portal should be moved to http_routing and http_routing
  should be renamed (especially for frontend layouts, etc) so that apps
  like survey can reuse some common code

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:02:59 +00:00
qsm-odoo 3f4e760f34 [MOV] web, *: simple moves of JS files to 'public' folder
* web_editor, website, survey, im_livechat

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:02:58 +00:00
Christophe Simonis ff9c9341d6 [MERGE] forward port branch saas-12.2 up to fcb972db9d 2019-02-26 16:39:30 +01:00
b3b29f3b86 [IMP] web: graph view legend and tooltips improvements
This commit ameliorates the tooltips and the legend
of the graph view in its different modes (bar, line, and pie).

Related task id: 1917940

Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>

closes odoo/odoo#29747
2019-02-25 08:26:10 +00:00
jpr-odoo 3461637b7a [IMP] web: group by more than two fields in graph view
Before this commit: select more than two groupbys
in a graph view would have no impact at all if mode
'bar' or 'line' is selected.

This commit allows to correctly handle more than
two groupbys in all modes.

Task ID: 1917948

closes odoo/odoo#29673
2019-02-20 09:28:07 +00:00
Kishan Gajjar 726aeefe36 [REF] web: small refactoring for export wizard
- add missing docstrings
- correctly order functions
- move functions in correct sections
- follow JS guidelines

closes #31261
2019-02-20 06:32:31 +00:00
Lucas Perais (lpe) f9a80a6e84 [FIX] web: calendar: take locale to format dates
Backport of d9fed5381a78c19ce14ddc8b9233f60d53c65453

Before this commit, when opening the calendar view with a specific locale
in the "week" view
the days were translated but the date format was wrong and fell back to english
This was because the translated terms were passed explicitly, but the locale did not
get passed

After this commit, we do what it takes to pass the locale to fullcalendar
and the dates are formatted with the right pattern

Also, there may be a bug in fullcalendar, because just passing the locale in the options
won't work, it should be instanciated first in fullcalendar's "locales cache"

OPW 1922092
OPW 1934127

closes odoo/odoo#30909
2019-02-07 09:57:32 +00:00
Aaron Bohy 495d475d1d [FIX] web: only call name_get when necessary
For many2one fields, 'default_get' only returns the id, whereas
'onchange' (like 'read') returns an array with id and display_name.

Before this rev., when creating a new record, we always called
'name_get' for all many2ones, whether or not their value was
obtained by 'default_get' or 'onchange', i.e. even if their
display_name was already known.

It may just look like unnecessary RPCs, but those RPCs could
actually cause a crash when the user has access to the main model
(and thus can access the display_name of the many2one thanks to
related sudo), but doesn't have access to the many2one comodel.

closes odoo/odoo#30892
2019-02-06 14:03:25 +00:00
Vincent Schippefilt 7d1957da8f [FIX] web: hang when saving then discarding
When editing a record, if it cannot be saved (b.e. due to required
fields) and the user clicks on save, then on discard

Before this fix, the window did nothing (seems like it is unresponsive)

After this fix, the user is able to discard the form.

task-id: 1937142

closes odoo/odoo#30871
2019-02-06 11:57:58 +00:00
Christophe Simonis 530f364547 [MERGE] forward port branch saas-11.3 up to 0c42a607ec 2019-02-06 11:59:44 +01:00
Christophe Simonis 9c6acbaaa0 [MERGE] forward port branch 11.0 up to e0b14bf9a7 2019-02-05 17:53:35 +01:00
Xavier Morel 78a1ba3449 [FIX] web: undestroyed widgets in tests
closes odoo/odoo#30794
2019-02-04 09:25:46 +00:00
Xavier Morel 6772216842 [FIX] bus, mail, web: missing super() call in destroy overrides
closes odoo/odoo#30792
2019-02-04 09:21:04 +00:00
Mathieu Duckerts-Antoine 24b0f092b4 [FIX] web: remove human_number limitations
The formatting of very big numbers (like
1.0045e+22) was not handled adequately by
the function 'human_number' in web.utils.
For those numbers, it seems more appropriate
to use the scientific format. The only
difference introduced here is the following.
Beyond a magnitude of e+21, we represent the
numbers by themselves but we keep the
number of decimals provided as parameter
(or zero by default) and we remove useless
zero decimals like in the other cases.
For instance, 1.0045e+22 is replaced by 1e+22
instead of 1.00e+22 if ask 2 decimals of
precision (and by 1.005e+22 for 3 decimals).

We have also fixed a small bug occuring in the
previous version of the function: the symbol
'E' was never used. So by the past the above
number would have be represented as
10045000P and, even worse, 1.01e+45 by
1.012e+28P.

closes odoo/odoo#31140
2019-02-15 10:51:01 +00:00