Commit Graph
397 Commits
Author SHA1 Message Date
Christophe Simonis d45c32baac [MERGE] forward port branch saas-15 up to bdd051bf78 2018-06-13 18:13:48 +02:00
Christophe Simonis bdd051bf78 [MERGE] forward port branch saas-14 up to c43c540172 2018-06-13 14:12:12 +02:00
Christophe Simonis c43c540172 [MERGE] forward port branch 10.0 up to 788750ea51 2018-06-13 10:55:58 +02:00
Jeremy Kersten 51acdeba4f [ADD] qweb: add tests for widget=date with datetime
This commit is related to #24761
2018-06-12 15:48:21 +02:00
Christophe Simonis 412501a5dc [MERGE] forward port branch 10.0 up to 7147622665 2018-04-16 11:18:08 +02:00
Nicolas Lempereur 7a1db7e620 [FIX] web: wrong day column title in arabic
In arabic, with the version localization of bootstrap we use the week
starts on saturday. But the version of bootstrap-datetimepicker we use
in 10.0 and saas-14 is 3.0.3 which only fully supports week starting
on sunday and monday.

Thus in arabic, the column title in the date picker would be:

  Sunday <- Monday (ﻥ, ﺙ, ﺭ, ﺥ, ﺝ, ﺱ, ﺡ)

Instead of what the numbered days in the calendar are shown as:
  Friday <- Saturday (ﺱ, ﺡ, ﻥ, ﺙ, ﺭ, ﺥ, ﺝ)

This issue doesn't happen in saas-15, 11.0 and over since the library
has been updated with ad6fd5f8 and the as of version 4 supports any
starting day of week, with this change:
 https://github.com/Eonasdan/bootstrap-datetimepicker/commit/557b657

opw-1825640
closes #24200
2018-04-13 09:33:24 +02:00
Christophe Matthieu ec199222c3 [FIX] web: ace: no duplicated char with composition (html/css editor)
Before this commit, there was an issue with input method using
composition in which typed characters were duplicated.
This was occuring until the composition ended.

This is a bug specific to Google Chrome v53+.
It has been fixed in the most recent version of ace.js [1],
and we just port the fix into our custom code.

Note that we do not simply import ace.js as a whole, because
we must update lots of custom code at the same time.
We plan to do so in the future.

Fixes #23629

[1] https://github.com/ajaxorg/ace/pull/3116
2018-03-20 09:44:10 +01:00
Adrien Dieudonne 599f6a762e [FIX] web: qweb: load template with non-http xhr
Since we are able to lazy load Qweb templates, there was
an issue to generate Awesome Timesheet iOS native app with
Cordova properly. It seems that under Cordova, iOS always
returns 0 for the status on a xml http request object.

The problem is that native applications are requesting
a local file from something that isn't a webserver.

The local file is delivered with no http headers that means no
"200 OK" header and no "404 Not Found" errors.

In this case, the request is still be completing as intended even
if the status code used by browsers is 0.

For more info, see:
https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequest
https://bugzilla.mozilla.org/show_bug.cgi?id=331610
2018-03-05 14:06:23 +01:00
Christophe Simonis f96a797fe6 [MERGE] forward port branch saas-16 up to b8540eefe3 2017-12-06 11:59:38 +01:00
Adrien Dieudonne ab42507d46 [FIX] web: datepicker: notify all datetime changes
Before this fix, there was an issue when you changed the value of
a datetime field by editing direclty the input (without using the
datepicker popup).
If this value was equal to the offset of your timezone,
the new value wasn't saved. The problem was that no event was
triggered by the 'bootstrap-datetimepicker' lib because it
considered that the old datetime and the new datatime were the
same...

In odoo JS, we always manipulate UTC moment objects and we
manually add the timezone offset at rendering (we mainly do that
for testing purposes). When the offset is added, calling format()
on the moment object doesn't convert the datetime to the browser
timezone because it's flagged as being UTC.

The datepicker lib creates moment objects in the browser timezone.
So comparing the ones it creates with the one given by Odoo is
like comparing apples and oranges, and it gives wrong results
when the datetimes differ by the exact timezone offset. So in this
case, no 'datetime change' is triggered by the lib.

We could fix this by wrapping moment objects into some kind of
OdooDate class and stop manually adding the timezone offset, but
this would involve a refactoring that can only be done in master.

Instead, we prefered to patch the lib to ignore the comparison
between UTC and non-UTC objects, as this is the safest way we
find to fix this issue in stable version.
2017-12-04 14:46:12 +01:00
Xavier Morel 7f6d32d5e0 Revert "[FIX] qwebjs: add tests to test suite" 2017-10-10 15:39:39 +02:00
Xavier Morel 6e646bc8bd [FIX] web: make qwebjs tests pass again
A bunch of features had been added to the qweb test files and qwebjs
did not pass them as features were either implemented differently or
not implemented at all:

* Fixed wonky and not cross-impl tests
  - added ``not`` word replacemenet to qwebjs as I wasn't sure how to
    handle that one cross-impl
* fixed t-esc/t-raw to render content *inside* the host node e.g.
  span@t-esc should render as <span>{contents of esc}</span>
* added fallback to body content if t-esc/t-raw yields an empty result
* process t-att in order with t-att-* and t-attf-* rather than before
  them both
* suppress attribute generation entirely in case of falsy value
2017-10-10 14:25:19 +02:00
Xavier Morel 1e3c76f41d [IMP] web: add web tests to regular JS suite
Remove old tests page as it was obviously unmaintained and did not run
at all...
2017-10-10 14:25:19 +02:00
Dharmang Soni a12cfa8260 [IMP] web: grouped Kanban: UX improvements in mobile
This commit aims to improve the UX of grouped Kanban views on
mobile devices. Only one column is now displayed, full width. The
columns' records are lazy-loaded. The user can swipe horizontally
to navigate through columns (thanks to the touchSwipe library).
2017-09-25 14:10:40 +02:00
Christophe Matthieu 95c2bd33a2 [IMP] web: lazy load nvd3, ace and fullCalendar lib to reduce asset size 2017-08-31 16:26:11 +02:00
Christophe Matthieu 6f60a9a179 [REM] web: kill zombies 2017-08-31 16:26:11 +02:00
Christophe Simonis cc38b93ab2 [MERGE] forward port branch saas-15 up to 49f819a7a7 2017-06-09 16:43:27 +02:00
qsm-odoo 3741603495 [FIX] web: restore broken datepicker since lib update
There were two main problems with the datepicker since the lib was
updated:
- it appeared broken in the search view "Filters" menu
- it did not overflow the parent which scrolls

Indeed, before the update, the datepicker was placed in the <body/>.
Now this is a lib option. Unfortunately, the option is broken (I don't
know why they broke it since it worked before the lib update...). As the
lib does not expose its internal functions, the only found workaround was
to patch the lib code itself.

opw-745311
opw-745625
2017-06-07 16:09:16 +02:00
Géry Debongnie 15a227375a [ADD] web: add benchmark support
With this commit, we introduce a benchmarking infrastructure: a new
controller, accessible at the route /web/benchmarks which will render a
new template (web.benchmark_suite).

This template uses benchmark.js and qunit.js to display a list of
benchmarking informations.  For example, the number of op/s for
instantiating and destroying a list view.

I hope that this is the start of the beginning of taking the habit to
check our JS code performance sometimes, and making sure we do not have
large regression without a good reason.
2017-05-16 14:41:00 +02:00
Christophe Matthieu 27ff895dfd [IMP] web: extend qweb to allow dynamic templates in t-call
Before this change the t-call can use only receive a literal as parameters:
<t t-call="template.name17" />
This call render the template 'template.name17' with the current context.

Now, we can defined an expression with braces (same syntax that t-attf):
<t t-call="template.name{{ 10 + 7 }}" />
This call render the template 'template.name17' with the current context.

This change allows for greater flexibility for applications using qweb.
(The performance due to this change is unchanged during rendering time.)
2017-05-04 17:19:25 +02:00
Christophe Simonis 4441237b0a [MERGE] forward port branch saas-15 up to ab68a1c674 2017-04-25 12:36:02 +02:00
Christophe Simonis ab68a1c674 [MERGE] forward port branch saas-14 up to 64b7d4e8a8 2017-04-24 13:24:13 +02:00
Christophe Simonis 64b7d4e8a8 [MERGE] forward port branch 10.0 up to 3f6e573c67 2017-04-24 12:53:34 +02:00
Christophe Simonis 814c550913 [MERGE] forward port branch saas-11 up to a0ff1f2ad8 2017-04-21 14:34:11 +02:00
Christophe Simonis a0ff1f2ad8 [MERGE] forward port branch 9.0 up to 8de514f805 2017-04-21 14:19:05 +02:00
Christophe Simonis 8de514f805 [MERGE] forward port branch saas-6 up to b084ffd7f1 2017-04-21 14:07:02 +02:00
Christophe Simonis b084ffd7f1 [MERGE] forward port branch 8.0 up to 716ceede16 2017-04-21 14:05:52 +02:00
Nicolas Lempereur 716ceede16 [FIX] web_enterprise: kanban_state_selection ie
On IE (from 9.0 up to at least IE EDGE 14) we have this behavior
for the method serializeToString of XMLSerializer:

> (new XMLSerializer()).serializeToString($('<b>"</b>')[0])
  '<b xmlns="http://www.w3.org/1999/xhtml">"</b>'
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild)
  '&quot;'

Whilst browser such as chromium or firefox have:

> (new XMLSerializer()).serializeToString($('<b>"</b>')[0])
  '<b xmlns="http://www.w3.org/1999/xhtml">"</b>'
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild)
  '"'

Hence for IE9 and over, if in a `<t t-extend/>` a `t-jquery`
sub-directive (without `t-operation`) is available, we can have
broken javascript if a " is transformed into an &quot; at a unfortunate
location.

This commit favour node.data over XMLSerializer serializeToString to
avoid the possibility of this issue when a text node is processed.

opw-727283
2017-04-20 17:08:17 +02:00
Géry Debongnie 6a8e7acc67 [IMP] web: update qunit to last version (2.2.1)
It has an Abort button!!!
2017-04-11 19:44:38 +02:00
Géry Debongnie 905e01921f [REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
2017-04-11 19:44:38 +02:00
Christophe Simonis 65a5ced979 [MERGE] forward port branch saas-14 up to 777a87cde8 2017-03-13 17:37:20 +01:00
Christophe Simonis 777a87cde8 [MERGE] forward port branch 10.0 up to 2ef43281c2 2017-03-13 16:22:57 +01:00
Denis Ledoux cde8668034 [FIX] web: IE <= 11.0 doesn't support ChildNode.remove
IE 11.0 doesn't support `Childnode.remove`:
http://caniuse.com/#feat=childnode-remove

As a workaround, we use `Node.removeChild`,
which is more widely supported.

opw-710617
2017-03-06 18:21:06 +01:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Christophe Simonis eddefc9948 [MERGE] forward port branch 10.0 up to 8c55e57c7f 2017-03-01 16:14:41 +01:00
Géry Debongnie 678ea26f99 [FIX] web: fix fuzzy search algorithm in app switcher
The fuzzy search score algorithm is quite simple, but had an interesting
problem: for the search string 'AB DEF', the result 'XXAXXBXXXXXXX DEF' had
a higher score than the result 'ABX X DEF", because it has 4 consecutive
matching characters.

This commit slightly tweak the algorithm to take space into account, but
to make sure they are not used to compound the score for a string.  This
means that space characters are not ignored, but are not really
as important as a normal character.
2017-02-28 15:01:24 +01:00
Fabien Meghazi 3c8a2bcaf0 [FIX] qweb2.js: fix erratic object type detection in foreach (Fixes #15655)
Could not add a test as the qweb js testsuite is broken and it's xml
test files have been modified in order to test qweb.py specific cases.
2017-02-28 13:11:24 +01:00
Fabien Meghazi 38ec6d7522 [FIX] qweb2.js: fix erratic object type detection in foreach (Fixes #15655)
Could not add a test as the qweb js testsuite is broken and it's xml
test files have been modified in order to test qweb.py specific cases.
2017-02-28 13:00:54 +01:00
qsm-odoo 198673bf35 [ADD] web_editor, website, web: new LESS editor
The old "HTML" editor now handles LESS edition. The editor has now a
button to switch between XML and LESS edition. By default, it only
displays the odoo files which only appear in the assets_frontend bundle
and in debug mode, it allows to see all the files that influenced the
page design.

The new editor has a new set of options which allows to use it as a
xml editor only or a less editor only if needed.

Also: make the "include bundles" option appear only in debug mode.

Technical details:

- When saving a modified LESS file, an attachment is created with the
full modified content and an extension view xpaths the bundle where
the original file was added to link this attachment instead. This
relies on the fact that qweb, when generating assets bundle,
replaces missing files by the "datas" contents of the ir.attachment's
which have an "url" field equal to the urls it is searching.

- If a LESS error is introduced, the recent changes in assets bundle
generation (see c248674a5c) will not break
the design but only open a dialog on page loading, with the LESS error.
The user can then go to the LESS editor and reset its changes.

This feature code has been started with original work of @pga-odoo
2017-02-14 16:37:23 +01:00
fwi-odoo 7015ec5062 [IMP] web: update fontawesome 4.5.0 to 4.7.0 2017-02-14 14:14:42 +01:00
fwi-odoo ad6fd5f838 [REF] web: update bootstrap-datetimepicker lib and adapt datepicker widget
from 3.0.3 to 4.17.42
2017-01-30 10:29:27 +01:00
fwi-odoo c5af1d215f [REF] web: update momentjs lib
From 2.8.1 to 2.9.0
2017-01-30 10:29:21 +01:00
fwi-odoo 9a3ad41cfa [FIX] web: change selection color in the correct file
Fix commit 537b919ec2
Don't change the lib file directly.
2016-11-21 10:53:02 +01:00
fwi-odoo 537b919ec2 [IMP] web: darker highlight selection 2016-11-21 09:45:14 +01:00
qsm-odoo dd560377e2 [IMP] web: improve traceback reporting
* Do not assault the user with a full traceback on bug, but indicates
an error occured and allow him to toggle the traceback
* Automatically scroll the traceback to the end (better for python
errors)
* Propose the user to report the traceback by using a new "Copy"
button which correctly copies the full error + traceback
2016-11-02 13:26:00 +01:00
Martin Geubelle aa19d9edd0 [REF] web: update nestedSortable lib 1.3.5 -> 2.1a 2016-09-28 16:55:51 +02:00
Christophe Matthieu 0777af3e60 [IMP] qweb: Add extra condition branching (t-elif) (closes #3b3dbcd)
To have the same feature client and server side (t-elif was added in the qWeb client side)
2016-09-19 11:24:56 +02:00
qsm-odoo d83f7587aa [MOV] web, website(_slides): move PDFjs lib to web
website_sign is now a backend-only module in enterprise, so it should
not use a website library (even in a static way).
2016-09-13 14:18:31 +02:00
Fabien Meghazi 75f60f6941 [ADD] web: Add extra condition branching (t-elif, t-else)
A new preprocess method is added to the template engine in order to do
preprocessing/sanitization of the templates before compilation.
This method can be overloaded in order to add new features such as
translation, ...
2016-09-09 18:03:08 +02:00
qsm-odoo b6b3e156a0 [IMP] web, website(_quote): move jSignature lib location (website -> web)
The jSignature lib is now used by non-frontend module (at least it
will be in upcoming commits).
2016-09-05 15:01:21 +01:00