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
closesodoo/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>
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#59786closesodoo/odoo#59908
X-original-commit: 112267d62544c56acfdcef96727c32c314c15f16
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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).
closesodoo/odoo#58806
X-original-commit: 598d036b59012af0a95894d759fe3b6276fc8ccb
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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).
closesodoo/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>
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#54922closesodoo/odoo#54988
X-original-commit: 820128385c523f562b9ee82698c81daa63149bb7
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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.
closesodoo/odoo#54315
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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
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
closesodoo/odoo#51606
Related: odoo/enterprise#9740
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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>
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.
closesodoo/odoo#50236
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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
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
closesodoo/odoo#47458
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#47024
X-original-commit: 42e6f56c887c3175c76f0f84b8581e288ebc7daf
Related: odoo/enterprise#9044
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
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
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
closesodoo/odoo#45899
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
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
closesodoo/odoo#43955
X-original-commit: 1a90740b8e699fc3afa28c3ddb5490328facb995
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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
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.
closesodoo/odoo#41582
X-original-commit: 24d8ae59e08143dc0ca7e05be37a3cd607d58a4a
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
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>
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).
closesodoo/odoo#40502
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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#39953closesodoo/odoo#40154
X-original-commit: 5ca38da66de00ca6efef307bcb39fc5037903221
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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.
Before this commit, on a device with a "pen" (e.g. Surface Pro, ...),
it was not possible to sign a document on some browsers recently
updated (e.g. Chrome, Firefox, ...) only Internet Explorer was working.
Instead of drawing continuous lines only few dots appeared.
For Chrome and Firefox we have to catch events with "addEventListener".
For Edge we add touch-action property to convert touch events into click.
Steps to reproduce:
1) Go to sales app
2) Then go to quotations (menu Sales)
3) Create a new quotation
4) Click on preview
5) Click on the "Accept" button at the end of the preview
6) Use the "pen" to draw the signature (BUG)
We use a custom version of the jSignature lib (c.f. odoo/odoo@eddcb46),
so we have to patch the file in the Odoo repo with a mix of some
pull request found in the official repo and forks.
Link:
https://github.com/brinley/jSignature/pull/109https://github.com/brinley/jSignature/pull/159https://github.com/willowsystems/jSignature/pull/96
opw-2029684
Add a new behavior to numeric fields, possibility to enter value manually or to use a simple arithmetic expression that will be evaluated.
Example: =20+3*2
In order for the computation of the arithmetic expression to be done, the value needs to starts with = and then an expression can be entered. We only support the basics mathematical operations + - * / ( ) ^
User locale and digits separator are taken into account. If the value entered can't be evaluated to a numeric, the field will be displayed in error.
closesodoo/odoo#34538
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The months name in momentjs used an arabic translation with the month
then some crap (or the month said a second time) after.
This does not seem expected, and has been solved in moment.js library 2
years ago:
https://github.com/moment/moment/pull/4271
This PR apply this change in moment.js localization included in Odoo.
opw-2006265
closes#34248
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Assume an editable list view with a date(time) widget, click to
edit a line, focus the date field (the datepicker opens), press
ESC: there is a crash in the lib, and the datepicker remains open
forever.
This fix is twofold:
- we added a check in the lib to prevent it from crashing (it is
easily reproducible: it crashes when an opened datepicker is
removed from the DOM).
- we added an event handler of ESC keydown event to hide the
datepicker before the field is removed from the DOM.