Commit Graph
12325 Commits
Author SHA1 Message Date
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
Thanh Dodeur a86b726a27 [FIX] base: fixes http redirection
The 7d85ab1eac refactor of 'ir.http' introduced changes in `web/image` that
caused the route to no longer return early (to avoid data processing steps)
in the case of redirection and that caused `binary_content` to not set the
mimetype of the `ir.attachment` when it was an URL.

This commit fixes those issues, allowing `web/image` to redirect properly.

closes odoo/odoo#30777
2019-02-04 10:16:12 +00: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
Odoo Translation Bot a463a87189 [I18N] Update translation terms from Transifex 2019-02-17 01:33:04 +01: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
Mathieu Duckerts-Antoine 84abddfe90 [FIX] web: quotes and backslashes in search view
The commit 6d3ada1
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#31025
2019-02-15 12:38:22 +00:00
Nicolas Lempereur e2e0135a75 [FIX] web: first and last line chart x label shown
The graph view displaying a line chart has had some recent changes in
b23a981320. Now it is of the full width of container but when there is
less than 4 labels (thanks to c4937132a3) the first and last labels may
be cut because they are by default aligned on the middle with its tick
(so for the first label, the half left may be missing, and the last the
half right may be missing).

With this change, we align labels as expected. This could be done in CSS
sheet (with `.nv-axisMin-x > text { text-transform: start!important; }`)
but here it is done only in the given instance.

opw-1917560
closes #31116
2019-02-14 14:40:13 +00:00
Lucas Perais (lpe) 7ecd750a77 [FIX] web: moment lib: update es locale
The parsing/formatting of abbreviated month name was broken.
The locale es in its version for moment 2.22.0 fixes it

OPW 1931272

closes odoo/odoo#31104
2019-02-13 13:01:04 +00:00
Martin Trigaux 1a4f3114a7 [FIX] web: translate pivot value
"Variation" was not translated

opw-1940086

closes odoo/odoo#31050
2019-02-13 07:17:47 +00:00
Lucas Perais (lpe) 12cca6a5fd [FIX] web: timerange menu: descriptions are strings
On a view, define a timerange for fetching data
Save as favorite

Before this commit, the time range description were not transmitted as
strings for the creation of the filter
So, when loading the filter back, there was no description for column headers
resulting in displaying "Object [Object]" as their title

After this commit, we save in the context of the filter the description of the title

OPW 1930582

closes odoo/odoo#30992
2019-02-11 12:22:47 +00:00
edy1192 2503a89e9e [I18N] web: Add new terms to .pot file
-There were two missing terms from the `.pot` file of the module web.

closes odoo/odoo#31008
2019-02-11 22:28:48 +00:00
Xavier Morel f53ad8a4fd [FIX] search_filters: broke a thing in f1a85ba
As part of fixing the JS docs (docstrings & references & ...), the
various search filters were de-namespaced (aka
ExtendedSearchProposition.Integer = ... -> var Integer = ...).

This had the side-effect of making a `new Date` refer to the extended
search Date field instead of the global Date object, which went
unnoticed because *that* had been wrapped in a moment() call, and
moment() apparently doesn't mind being given garbage, but it would also
create an "unbound" and thus never destroyed widget.

Remove the `new Date`, calling moment directly has pretty much the same
effect, moment objects created from date objects just have an extra
field (a cache for the date object I guess).

closes odoo/odoo#30791
2019-02-04 09:17:41 +00:00
Géry Debongnie 1f5807f1c8 [FIX] web: allow user to move cursor in search bar
With the control panel refactoring, the auto_complete widget was set on
a different target, which caused issues with the search bar: the event
handlers for the search bar were triggered before the handlers for the
auto_complete widget.

With this commit, we make sure they are handled in the proper order.

Also, a small piece of code that was supposed to check the position of
the cursor was lost.

closes odoo/odoo#30795
2019-02-04 08:22:34 +00:00
Rishabh Jadia 13e058c573 [FIX] web: prevent footer linebreak.
The purpose is, prevent the linebreak in the phone when using the
document layouts 'background' in the footer.

opw-1920752

closes odoo/odoo#30812
2019-02-05 10:37:01 +00:00
Goffin Simon fced5d1e95 [FIX] web: Wrong comparison in invoice analyes
Steps to reproduce the bug:
Let's consider that we are in 2019

- Create two customer invoices: I1 and I2
- I1 with invoice date = 2 april 2019 and amount = 100€
- I2 with invoice date = 2 april 2018 and amount = 1000€
- Go to Reporting > Invoices
- Click on widget "Time Ranges" and set "Based on" Invoice Date and "Range" This Year "Compare To" Previous Year

Bug:

The untaxed total for previous year was 1100€ instead of 1000€ because it counted previous year and this year.

opw:1962027

closes odoo/odoo#32331

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-02 09:27:49 +00:00
Odoo Translation Bot 3f50c16d5a [I18N] Update translation terms from Transifex 2019-03-31 01:32:20 +01:00
Romeo Fragomeli e6e206b14e [IMP] web: control panel add on_detach_callback
Adding event listener in on_attach_callback need to be removed
in on_detach_callback.

Before this commit on_detach_callback was not implemented in control panel.
After this commit we can use on_detach_callback.

Needed for task ID: 1934261

closes odoo/odoo#30758
2019-02-01 09:55:31 +00:00
Sébastien Theys f78b7a76d6 [FIX] web: fix kanban_image for binary data
`.value` is always bin size. By using `.raw_value` we allow the condition to be
true when actually using binary data.

This solves an issue when trying to display the image for a model being created
since at that time the URL does not work yet since the model does not exist.
Eg. website_sale extra images on product.

This also prevents (potentially a lot of) unnecessary GET to fetch images for
which we already have the binary data downloaded.

Part of task 34045

PR: #30881
2019-02-06 13:20:39 +00:00
Aaron Bohy 724504ec1b [FIX] web: pass x2many context to subrecords
Before this rev., the context specified on an x2many fields (in the
arch) wasn't fully propagated to the subrecords. This means that it
couldn't be used, e.g., in the template of the sub kanban view (see
parent commit).

PR: #30881
2019-02-06 13:20:28 +00:00
Aaron Bohy c9eb44d729 [IMP] web: expose context in kanban templates
This rev. allows to use variable 'context' in kanban view
templates.

Part of task 34045

PR: #30881
2019-02-06 13:20:19 +00:00
Aaron Bohy 791b1bd839 [IMP] web: Set a timeout on rainbow man destruction
Avoid traceback when the click that triggered the rainbow man
is the click that closes it.

Example: The last step of a tour.

closes odoo/odoo#29969
2019-02-06 12:58:58 +00:00
Lucas Lefèvre dccd37d4e4 [FIX] web: fix tabs padding and min height
No padding is applied to tab content panels in Community.
Also the minimum height selector does not correctly target tabs.

Related Enterprise PR: https://github.com/odoo/enterprise/pull/3568/

closes odoo/odoo#30771
2019-02-04 09:33:42 +00:00
Odoo Translation Bot 69dbbea09a [I18N] Update translation terms from Transifex 2019-02-03 01:38:30 +01:00
Odoo Translation Bot 8d9b196145 [I18N] Update translation terms from Transifex 2019-02-01 02:44:47 +01:00
qsm-odoo bc711426b6 [FIX] web: correct list view caret position
Through many design refactorings, the community caret position was
broken while the enterprise was not. This commit removes the breaking
rule to put it in enterprise only.

closes odoo/odoo#30799
2019-02-04 10:11:01 +00:00
Christophe Simonis cb8fefa899 [FIX] web: correct tempusdominus lib patching
Oversight of previous forward-port.
2019-01-31 15:22:27 +01:00
Christophe Simonis 49cb3d8fad [MERGE] forward port branch saas-11.3 up to aeed32d4ff 2019-01-31 15:07:09 +01:00
Nicolas Lempereur c4d222677f [FIX] web: click/studio work in colored kanban tile
When a colored kanban tile is colored, and there is a color attribute on
the tile HTML element indicating a color field (eg. when a kanban view
with color dropdown is created in studio), there was a HTML element over
the whole tile preventing to click on links or other sub element of it.

This HTML element is just a transparent used for accessibility to
contain the tile color intelligible name, so this commit just size it
over the area of the color (currently in base bootstrap ~3px at the left
of the tile).

opw-1932283
closes #30717
2019-01-31 09:01:44 +00:00
Christophe Simonis aeed32d4ff [MERGE] forward port branch 11.0 up to 1dbe4ea0d7 2019-01-30 17:10:34 +01:00
Martin Trigaux 2087fb5aa9 [FIX] web: support full attribute syntax
Only the syntax
<t t-operation="attributes">
    <attribute name="foo">bar</attribute>
</t>

was currently supported for attributes while the syntax

<t t-operation="attributes">
    <attribute name="foo" value="bar" />
</t>

Is also correct and supported server side.

Using value instead of the node content is needed to avoid translating the node
while it is parsed by babel to extract translatable content
2019-01-30 15:23:50 +00:00
Christophe Simonis 2f118c41fb [FIX] web,mass_mailing: adapt forward-ported tests to new version 2019-01-31 18:10:02 +01:00
Christophe Simonis f927c68ddb [MERGE] forward port branch 12.0 up to cb8fefa899 2019-01-31 16:59:58 +01:00