Commit Graph
531 Commits
Author SHA1 Message Date
Romeo Fragomeli e7d6a68a56 [REV][FIX] web: pdfjs: hide buttons that doesn't work in webviews
The commit odoo/odoo@7a40d528 is reverted as the following commit
will do same behaviour without "Monkey Patching" the lib PDF.js
2021-05-05 10:20:06 +00:00
Romeo Fragomeli 7a40d528e7 [FIX] web: pdfjs: hide buttons that doesn't work in webviews
Some features of the PDF.js library doesn't work in the
webview of the mobile apps.

Initially 'window.print' is defined as an empty function in
webviews unlike browsers where it is already ready.
After that, PDF.js needs to monkey patch 'window.print' and
saves a reference to the original definition, which is not
yet fulfilled in by the mobile app (Java part).
So the print of PDF.js doesn't work in webviews and end
users will need to download the file before printing it.

Regarding the Download button, the 'download' attribute is
not supported by the webview as you can see in:
https://bugs.chromium.org/p/chromium/issues/detail?id=432414
As there's many ways to download a file in Odoo it's not
a big deal to simply hide it in PDF.js.

Because it's quite complicated to fix this, we decided
to hide the features that don't work (Download / Print)
or don't make sense (Open file).

Note that a refactoring is already in progress in order to
avoid to patch this library in master.

closes odoo/odoo#70110

Task-id: 2200168
X-original-commit: 39225827035efe11cdc90b2a7f1ae1f24a54b136
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
2021-04-29 14:27:31 +00:00
Gorash aa47eda087 [IMP] web: add mode qweb in ace
Add a new parser in the ace for the qweb highlight. This makes it possible
to visualize the qweb tags and the part of code.
Used in the website and in xml fields.

closes odoo/odoo#69609

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-04-21 12:15:01 +00:00
Simon Genin (ges) 51e660c47e [IMP] web: align date range widget behavior with date picker's.
The range date lib would open the selector on focus.
This is a behavior we don't want in lists, but want to keep in quickedit
forms.

Task id: 2492914

closes odoo/odoo#68390

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-03-29 09:38:07 +00:00
Géry Debongnie 3915a3f00e [FIX] web: display better tracebacks in debug=assets
A previous commit (934e0896160272542dd00) modified QUnit to make sure we
can display better tracebacks in debug=assets mode.  However, this
commit did not apply to errors coming from failing promises.

To fix this, we can simply keep a reference to the error in that
specific case.

closes odoo/odoo#67048

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-03-02 11:00:30 +00:00
Géry Debongnie cbadef9365 [IMP] web: display annotated tracebacks in debug=assets
Warning: this commit savagely patches qunitjs sourcecode. I know... I
feel bad.

Since we updated the way debug=assets work, we have a new problem in the
qunit test suite: the tracebacks displayed by QUnit are relative to the
bundle file, not the original file, which is annoying in practice.

There is really no good way that I could find to integrate with QUnit to
perform that task, so I had to do it the ugly way: modify QUnit from the
inside to use the StackTrace library to annotate the traceback with the
proper information.

closes odoo/odoo#66771

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-25 14:45:15 +00:00
Géry Debongnie 2716828f25 [IMP] web: display better tracebacks in debug=assets
The recent change in the way debug=assets works (which now bundles all
files in a bundle instead of serving them statically) had a negative
impact on the stacktrace displayed in the error dialog in debug=assets:
it now display the bundle/linenumber instead of the actual file/line
number.

This is not a huge deal, most of the time, because the errors displayed
in the console display the correct information, and the debugging
process should work as before.  But it can certainly be annoying in some
cases.

With this commit, we use the Stacktrace.js library to dynamically fetch
the sourcemaps and to decorate the displayed information with the
correct file and line numbers.

closes odoo/odoo#66318

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-17 11:52:40 +00:00
Nicolas Lempereur 376a77ed65 [FIX] web: show more text of short calendar event
In a4d170ad9 there were some improvment to not show event totally empty
on the day calendar view because of different style (font + padding).

The lower part of the text was still a little cut, this commit try to
improve this for week and day view mode by removing 5 additional pixels.

opw-2422700

note:

Also fix the fc-short for fullcalendar Odoo, we had this 2019 change:

fullcalendar/fullcalendar@e879c43

that made it not working without title (odoo use case), in 2020 it was
reverted when refactoring for 5.0:

fullcalendar/fullcalendar@7c7ce1e

closes odoo/odoo#66109

X-original-commit: b856d312be19b0fdf636600a76c4d9b427eedb7c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-16 12:24:41 +00:00
Géry Debongnie addf9d7eec [FIX] web, point_of_sale: update owl to v1.2.4
This commit update owl from 1.2.3 to 1.2.4, and
introduces a few fixes for code that was broken (because it accesses
private owl values)

Note the fix for the test menu code is interesting. Before this commit,
the handler for the click on the home menu component was not called, so
the click had a side effect: it modified the url to its href, which
caused the action manager to load the next application, even though the
home menu was not mounted.

With the update to Owl, this is no longer true: the handler is called,
and call preventDefault on the event. Because of that, the url is not
changed. However, since the home menu is itself not mounted, it cannot
communicate to the web client that we should load the next app.  This is
why it was broken.  The fix is simple: we actually make sure that the
home menu is displayed before clicking on the app menuitem.

closes odoo/odoo#65906

X-original-commit: 2385e58d76aa5e4bca0fc6d76ecedc7de5fd4267
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-10 17:28:10 +00:00
Aaron Bohy 50eff609a0 [FIX] web: update owl to last version
This commit updates owl from v1.2.1 to v1.2.3

See [1], [2] for the list of changes.

[1] https://github.com/odoo/owl/commit/71f545058bc9cdc326003bf8573cef1bb4c903d4
[2] https://github.com/odoo/owl/commit/490cf180794cdc100e33e792f6d12172d42bf981

X-original-commit: b91266be4d13ab5320a57b2e986d545df984af62
2021-01-20 15:51:36 +00:00
Aaron Bohy 9fc79bbf14 [FIX] web: update owl to last version
This commit updates owl from v1.2.0 to v1.2.1

See [1] for the list of changes.

[1] https://github.com/odoo/owl/commit/25738a1bf08ff47b2d8cb7b7c57d3bf4a7e1caa7

X-original-commit: 1e87d7b65bdfef323a6cdae3a54b3beb6aacf3b4
2021-01-11 15:46:37 +00:00
Aaron Bohy ae7aae7140 [FIX] web: update owl to last version
This commit updates owl from v1.0.13 to v1.2.0

See [1] and [2] for the list of changes.

[1] https://github.com/odoo/owl/commit/abb9d0b364da3a976915c092ab8d2696e5e524e5
[2] https://github.com/odoo/owl/commit/144b323d2bac7384114eb6b63670991f42943e67

closes odoo/odoo#63342

X-original-commit: cc77978c84d988a4b059abce97b46c72a9d3167d
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-12-14 14:35:50 +00:00
Romain Derie 0081ff91e3 [FIX] web: prevent crashes from tempusdominus
The BS4 tempusdominus lib has 2 issues within Odoo:
1. On wrong string formating (eg typing "33"), the lib would trigger its own
   error "datetimepicker.error" that would be catch in our crash manager making
   it display a modal error.
   This is generally handled by catching that event and preventing it to bubble
   to the crash manager, see:
   Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#L128
   OWL datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/components/datepicker.js#L43
   Snippets options: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web_editor/static/src/js/editor/snippets.options.js#L1646
2. If there is a valid date, and an user enter an unvalid date, the lib crashed
   by throwing `Cannot read property 'format' of undefined'`.
   Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#L94 (fbbfa6ddca and 5481c429efb)
   OWL datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/components/datepicker.js#L149
   Snippets options: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web_editor/static/src/js/editor/snippets.options.js#L1617

Note that the issue was reported at https://github.com/tempusdominus/bootstrap-4/issues/223

Those errors can be seen for instance in Page Properties dialog (publish date
field) and in the form builder snippet if you add a date(time) field.

task-2335403

closes odoo/odoo#61475

X-original-commit: bcfbc3ea11814931c5d1f8ce3c44b1756bbfc439
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-11-06 13:01:05 +00:00
Nasreddin (bon) 0edf1ce246 [FIX] web: add rtl management for resizable jquery-ui widget
Issue

	- Install "Project" modules
	- Set user language as "Hebrew"
	- Go to Project and open any project
	- Go to 'gantt' view
	- Try to resize a task

	Everything is reversed.

Cause

	Jquery-ui 'resizable' widget do not manage RTL feature.

Solution

	Update the the `position.left` props according to the language
	direction (LTR or RTL).

opw-2367692

closes odoo/odoo#61082

X-original-commit: 1f318d7c7aa66287c8756a89b49293b4e8c2217e
Related: odoo/enterprise#14507
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-10-30 16:47:13 +00:00
Aaron Bohy 887bc757b5 [FIX] web: update owl to last version
This commit updates owl from v1.0.10 to v1.0.13

See [1], [2] and [3] for the list of changes.

[1] https://github.com/odoo/owl/commit/8da68e925b3baf00f671dd0435bc463d234031d7
[2] https://github.com/odoo/owl/commit/392185ab6740c8872ca6f19cc71e059b36d3a727
[3] https://github.com/odoo/owl/commit/d615ffd81b0b0c80780fcf022316769e10dc5dc1

closes odoo/odoo#60724

X-original-commit: 610d5b86114dfc877a3a3650cd54cc7ec2327ab8
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-10-26 11:01:33 +00:00
Nicolas Lempereur f0ba2dbfa5 [FIX] web: no safari issue with DST at midnight
On safari with apple device in belgium timezone, this code:

```
x = new Date(2020, 2, 28, 2)
x.setDate(29)
```

returns:

> Sat Mar 28 2020 02:00:00 GMT+0100 (CET)
> Sun Mar 29 2020 01:00:00 GMT+0100 (CET)

This is not consistent with any other combination of OS and browser
tested, where this code would return eg. for chrome on macOS:

> Sat Mar 28 2020 02:00:00 GMT+0100 (Central European Standard Time)
> Sun Mar 29 2020 03:00:00 GMT+0200 (Central European Summer Time)

In most instance, this is not an issue, but for country with midnight as
Daylight Saving Time (DST) change, this is an issue, because the Tempus
Dominus calendar widget will have a duplicated day which might eg. make
a month totally not usable.

This issue can eg. be reproduced in Lebanon timezone at this address:

https://tempusdominus.github.io/bootstrap-4/Usage/

Going to the month of April 2020, an error happen  because to get the
first day of the week of 1st April, we do:

```
this._viewDate.clone().startOf('M').startOf('w').startOf('d');
// .startOf('M') => Apr 01 00:00:00
// .startOf('w') => Mar 28 23:00:00 (safari bug)
// .startOf('d') => Mar 28 00:00:00
```

which gives us the wrong day (28 instead of 29) which causes an error.

Other report of the issue:

- https://www.donedone.com/timezone-specific-browser-specific-datetime-bug-2014/
- https://github.com/date-fns/date-fns : issue 571
- https://forum.mobiscroll.com/t/issue-with-invalid-dates-range-script/108

opw-2271482
closes #59786

closes odoo/odoo#59908

X-original-commit: 112267d62544c56acfdcef96727c32c314c15f16
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-10-13 16:16:45 +00:00
Aaron Bohy 4749beea20 [FIX] web: update owl to last version
This commit updates owl from v1.0.9 to v1.0.10.

See [1] for the list of fixes it contains.

[1] https://github.com/odoo/owl/commit/e73fb462c5d70011ab667c1c529b85749a6bcf4a

closes odoo/odoo#58959

X-original-commit: 1682c6b73c39c693e0fcdb4da70891ef55edc3fd
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-10-02 09:23:18 +00:00
Aaron Bohy c4bddd6ba2 [IMP] web: qunit: always log name of failing test
After each test, a check is done that there is no leftover in the
DOM. If there are, the suite fails, but there is no indication on
the test that left elements in the DOM.

This commit logs that missing information. We also stop dumping
the DOM when this happens, as it was rather creating noise than
providing useful information (the remaining elements are still
logged though).

closes odoo/odoo#58806

X-original-commit: 598d036b59012af0a95894d759fe3b6276fc8ccb
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-29 12:03:40 +00:00
Victor Feyens 594ccdcbf4 [FIX] *: typos and english incoherences
Mainly transifex issues but also some errors found through 'grep' checks.

Fix typos and obscure english strings in xml contents, fields strings/helps, some docstrings, ...
ensuring correct translations base (and fallback when translations isn't available).

closes odoo/odoo#57276

X-original-commit: 4214f05d454bca2b60fda3a288d529c098e84f77
Related: odoo/enterprise#13053
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-09-08 18:12:26 +00:00
Nicolas Lempereur 922c7c722d [FIX] web: show digital signature in PDF
Show digital signatures items in PDF.JS preview even if the signature
verification is not implemented.

From discussion in mozilla/pdf.js this is like this because they don't
want to give the user a false sense of "the digital signature has been
verified" when it has not, but for a preview of the PDF this seems
misleading, in any case the user can have a full fledged PDF reader and
know if the document is well signed then.

https://github.com/mozilla/pdf.js/ issues/4743

opw-2287840
closes #54922

closes odoo/odoo#54988

X-original-commit: 820128385c523f562b9ee82698c81daa63149bb7
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-07-27 13:58:00 +00:00
Aaron Bohy b558cb7996 [FIX] web: qweb old inheritance mechanism
Before this commit, defining a extension of a template by using the
combination of directives 't-name' and 't-extend' ignored potential
extensions that could have been defined beforehand.

For instance, let's assume the following templates.
```xml
<t t-name="a">
    <div><span>1</span></div>
</t>
<t t-extend="a">
    <t t-jquery="span" t-operation="replace">
        <span>2</span>
    </t>
</t>
<t t-name="b" t-extend="a">
    <t t-jquery="div" t-operation="append">
        <span>b</span>
    </t>
</t>
```
Rendering template "b" displayed "1b" whereas we would expect "2b".

Moreover, when the extended template is itself an extension of
another template:
```xml
<t t-name="a">
    <div><span>a</span></div>
</t>
<t t-name="b" t-extend="a">
    <t t-jquery="div" t-operation="append">
        <span>b</span>
    </t>
</t>
<t t-name="c" t-extend="b">
    <t t-jquery="div" t-operation="append">
        <span>c</span>
    </t>
</t>
```
Rendering template "a" displayed "a", template "b" displayed "ab",
but template "c" displayed "ac", whereas we would expect "abc".

With this commit, other extensions done to a template are kept when
a new extension is defined. It relies on the templates order, and
takes into account all extensions that have *already* been defined.
This is exactly how the new qweb inheritance mechanism (using
't-inherit' and 't-inherit-mode') behaves.

closes odoo/odoo#54315

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-07-10 11:53:23 +00:00
Pierre Paridans c9ba9dc94b [FIX] web: TempusDominus unsafe access to config
During TempusDominus autobinding to fields matching its default classes
(like `.datetimepicker-input` used by our DatePicker widget) and no
config was previously provided to the library (like when we disable it
on mobile), an unsafe access to the config's `_options` property results
into an error as the config is `undefined`.

This commit fixes it by first checking for config existence before
attempting to access its property.

Note: as this is a fix inside a library, a comment is added to make
clear. Also similar fixes where already done in the same file.

opw-2242880

X-original-commit: fe1f7c3e361bbd249b4025a464c546f478b6e989
2020-07-03 15:54:08 +00:00
Jeremy Kersten 669bba4694 [FIX] web: update font-display for fa
Partial backport of https://github.com/FortAwesome/Font-Awesome/pull/16353/commits/e446f7e16ba3904a36babba767c739f1da6eae3e
To remove warning in lighthouse

closes odoo/odoo#53416

X-original-commit: 4ac592d4d99de478072a417c479efe97d15952d5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-06-22 12:55:03 +00:00
Michael Mattiello (mcm) 1019e1529c [FIX] web: update owl to last version
This commit updates owl from v1.0.8 to v1.0.9.

closes odoo/odoo#52657

X-original-commit: 584b1f428ace121b125699ee93ee500fe069a5bd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-09 08:04:03 +00:00
Aaron Bohy 798931fc39 [REF] web(_editor): move jquery.nearest lib to web
This lib is also used by the Gantt view, so we move it to the
common basis between web_editor and web_gantt, which is web.

Part of task 2205607

closes odoo/odoo#51606

Related: odoo/enterprise#9740
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-05-20 09:33:04 +00:00
Aaron Bohy f71b09725f [FIX] web: update owl to last version
This commit updates owl from v1.0.7 to v1.0.8.
2020-05-18 12:43:39 +00:00
Laurent Stukkens (LTU) 68584351e4 [IMP] web: Allow hide/show stroke in signature
In the sign application, it appeared that when using the default signature
in a signature SignItem that was higher the stroke at the bottom was doubbled.

This was caused by the fact that the bottom stroke is always added to the
template and that the default signature image had it already.

In order to solve this, we have added a setting 'show-stroke' that allows
controlling the stroke presence in the signature.

Task Id 2216067
Closes #48529

Related odoo/enterprise#9538

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-08 07:56:09 +00:00
Xavier Morel f08b5d22a4 [IMP] web: handling of escaping in literals
Handling of escapes (`\`) was performed during evaluation rather than
parsing, so strings in the AST stored the escaped form (rather than
the proper one), and _formatAST had to mess around in order to try and
get it back into a semblance of relevance (especially as the AST would
store the escaped string without delimiters).

Fix: perform the escapes handling (aka normalisation) during
tokenization where it belongs. This means the AST formatter can now
just JSON.stringify the data. Until and unless we decide to produce a
cpython-compliant
repr (https://github.com/python/cpython/blob/0169d3003be3d072751dd14a5c84748ab63a249f/Objects/unicodeobject.c#L12902-L13006)
which is unlikely.

closes odoo/odoo#50236

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-27 13:59:49 +00:00
Julien Mougenot 03415f08f4 [IMP] web: update Owl to v1.0.7 2020-04-28 07:24:23 +00:00
Romeo Fragomeli ebce7719b6 [REF] calendar,web: update to FullCalendar v4
This commit updates the FullCalendar library from v3 to v4.

The purpose of this update for us is to add a proper support of the
drag-and-drop of events on mobile.

But also to fix scrolling issues present mainly on smaller screens. In
those configurations multi/inner-scrolls were present resulting into
either the inability to properly scroll the desired content or even
blocking alltogether the scroll.

As a nice-to-have feature, the version 4 removes its dependency on the
jQuery library, allowing a faster loading of a bigger set of events.

Last but not least, this version also reduces its dependency on the
Moment.js library (but still keeps a binding to it for compatibility
purpose).

This commit focus only on the update of the library itself and the
adaptation of the related code to keep it working. Further
enhancements/fixes will be done later on.

To do so it modifies the following points:
* Update the library in itself (js, css...).
* Convert all FullCalendar's method calls to the new syntax (e.g.
  `$calendar.fullCalendar('destroy')` becomes `calendar.destroy()`).
* Add a utility method to convert v4 events into the old v3 event
  structure to ease the transition from one version to the other.
* Wrap all event's custom fields into a new event's
  `extendedProps` object (as its the new way of storing them instead of
  directly as a prop. of the event).
* Adapt `slotLabelFormat` and `weekNumberCalculation`.
* Use the view's new names:
** `agendaDay`  -> `timeGridDay`
** `agendaWeek` -> `timeGridWeek`
** `month`      -> `dayGridMonth`
* Use the option's new names:
** `viewRender`      -> `datesRender`
** `eventMouseover`  -> `eventMouseEnter`
** `eventMouseout`   -> `eventMouseLeave`
** `isRTL`           -> `dir`
** `selectHelper`    -> `selectMirror`
** `weekNumberTitle` -> `weekLabel`

Ref:
https://fullcalendar.io/docs/upgrading-from-v3

Task ID: 2092550
2020-03-31 15:06:11 +00:00
Dhruv Patel 2d5dd1448f [FIX] web: restrict to open sidebar forcefully in pdf viewer initially
Before this commit, when PDF viewer opens, it opens the sidebar forcefully.

Now with this commit, we have restricted to open the sidebar on initial load
by passing the false value to the forceOpen flag, we did this changes directly
in the library file itself as the file loads in iframe so we can not change the
file from outside by overriding the existing function or parameter.

task-2209742

closes odoo/odoo#47458

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-16 13:17:00 +00:00
fja-odoo 65e8473464 [FIX] web: change invalid font awesome icon
fa-delete does not exist => fa-trash

introduced by: 6692919d1e

task-2211899

closes odoo/odoo#48207

X-original-commit: 1b830bf1c7211dad5c93ac6929c7c395b32f3f90
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-23 14:18:30 +00:00
fda-odoo 32c8922432 [FIX] web: eventBusDispatchToDOM set to true in pdf.js
In the module account_invoice_extract, the the code need to react to the 'pagerendered' event triggered by pdf.js. However in recent version of pdf.js, event are not visible outside of the library, except if the 'eventBusDispatchToDOM' has been set to true.

We tried to set this option from outside of the library but without success, as our pdf viewer is in an iframe.
There is no state of the iframe in which we can add an event listener to set the option.
pdf.js has an event used to signal when we can set settings, called 'webviewerloaded'.
This event is triggered in an EventListener attached to the 'DOMContentLoaded' event.
So, to list options we had, we could:
a) add an eventListener to the iframe document or window to react to 'webviewerloaded'. This doesn't work as document and windows are not the definitive ones and won't catche the event later.
b) add an eventListener to the iframe to react to 'DOMContentLoaded', which doens't work too as our listener will be called after the pdf.js one.

Finally the option was choosed to modify the default value of this option directly in pdf.js as no hook worked in the
'account_invoice_extract' module.

closes odoo/odoo#47024

X-original-commit: 42e6f56c887c3175c76f0f84b8581e288ebc7daf
Related: odoo/enterprise#9044
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2020-03-05 16:31:29 +00:00
Michael Mattiello (mcm) 74d3fc4d87 [FIX] web: update owl to last version
This commit updates owl from v1.0.4 to v1.0.5.

This last version fixes an issue in the home menu (enterprise).
Issue's task: 2196878

X-original-commit: cce932b9179c5acb6845b895b04312c937f8de96
2020-02-28 07:53:21 +00:00
Lucas Perais (lpe) 9256492f10 [FIX] qweb2: ignore comments between branching directives
Have a template of that form:
```xml
<t t-if=""/>
<!-- Comment -->
<t t-elif=""/>
```

Before this commit, both python and JS crashed because any type of node
between branching directive was forbidden

After this commit, Comments are just ignored and removed, while actual
template nodes are still forbidden between branching directives
There is no crash anymore

closes odoo/odoo#45899

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-02-24 15:32:19 +00:00
Aaron Bohy 6eadb1f7f6 [FIX] web: update owl to last version
This commit updates owl from v1.0.0-beta5 to v1.0.4.
2020-02-03 09:15:02 +00:00
Jeremy Kersten 9f1fa0852d [FIX] web: backport fix from ace.js
Bug in ace-editor is present since that we updated in 1.3.1.
Because diff between 1.3.2 and 1.3.1 is big (-1288 +4661) with new feature...
We prefer just patch the library in stable branch applying part of commit:
https://github.com/ajaxorg/ace/commit/1890598a5da2259cfb0ceac38fed7bca582765db

To do in master? : upgrade ace.js

How to reproduce:
   > create ir.ui.view
   > be sure to empty all the content
   > type '<xpath expr=""'
   > Now if you type the > it will crash
        - Cannot read property 'type' of null

closes odoo/odoo#43955

X-original-commit: 1a90740b8e699fc3afa28c3ddb5490328facb995
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-01-24 17:56:06 +00:00
Julien Mougenot 3cf49e1913 [IMP] Owl: update to 1.0.0-beta5
Update of the Owl library.
Also added "_lt" to the default test environment properties.
2020-01-06 14:37:16 +00:00
Mohammed Shekha 5c7892fe6b [IMP] web: update pdfjs to 2.2.228
after this commit:
Worker disable is no longer supported by pdfjs since version 2.0, so
remove disabling worker code.
Used pre-built version of pdfjs as source version dependency with other
lib like SystemJS and we can not add dependency of these libs, so used
pre-built version which don't require any other dependent lib.
pdf.worker.js is always loaded and as we are using pre-built version we
don't need odoo's loader, previously we need it because worker loader of
pdfjs was loading files separately so to avoid it as we were loading
files in asset bundle we had odoo's loader file but we don't need it
anymore.

task-2124443
2020-01-07 05:21:22 +00:00
Géry Debongnie fc0f22f9b9 [FIX] web: update owl to last version
This commit updates owl from v1.0.0-beta1 to v1.0.0-beta2.
2019-12-12 13:34:48 +00:00
Adrien Dieudonne 6b9197244e [IMP] web: Chart.js update to 2.9.3
Update of Chart.js library to the latest version.

Before this commit, we weren't able to see all
x-axis dates labels like in Accounting Overview.
Tick label rotation on mobile has been fixed in
https://github.com/chartjs/Chart.js/pull/5961.

closes odoo/odoo#41582

X-original-commit: 24d8ae59e08143dc0ca7e05be37a3cd607d58a4a
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-12-09 14:15:05 +00:00
29726e8fd0 [ADD] web: add owl 1.0.0-beta1 to odoo
With this commit, we properly introduce the Owl library into our beloved
codebase. More information on the Owl library can be found in the project
repository: https://github.com/odoo/owl/

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2019-12-09 11:09:10 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
Xavier Morel 9546a37599 [ADD] pyjs: support for conditional expressions
Conditional expressions were already parsed, but there was no support
for executing them (or stringifying them back though I'm not sure when
that's used).

closes odoo/odoo#40502

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-19 13:16:04 +00:00
Nicolas Lempereur 062735847c [FIX] web: guardedCatch on IE Edge async return
In IE Edge async and await are supported, but guardedCatch is added to
polyfilled MyPromise object and async methods return original Promise so
depending of chain guardedCatch can cause en error or not.

It seems that historically, the MyPromise patching has also had issue in
firefox with it sometimes working or not.

In this changeset we completely remove it (which will have the drawback
of more error shown in console in firefox).

opw-1964486
opw-2116839
closes #39953

closes odoo/odoo#40154

X-original-commit: 5ca38da66de00ca6efef307bcb39fc5037903221
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-12 17:13:56 +00:00
mreficent 355a5dfc36 [IMP] *: fix typos in comments
closes odoo/odoo#35404

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 10:28:33 +00:00
Thomas Werland f9bcf4c079 [IMP] web: Chart.js update
Update of Chart.js library to the latest version.
The onLeave listener was not avalaible in the previous version of the library.
This has also removed a bug in the graph view where
some groups were sometimes not shown in the legend.
2019-07-30 06:53:11 +00:00
Jigar Patel cda93a5c19 [IMP] web: add new date range picker field widget
Adds a new widget to support start & end date or datetime.

closes odoo/odoo#33266

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-18 12:13:34 +00:00
Martin Trigaux fd15ca1918 [MERGE] Forward port of saas-12.4 to master up to 1f5a4649a6
closes odoo/odoo#34850

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 08:12:26 +00:00