Commit Graph
467 Commits
Author SHA1 Message Date
qsm-odoo 6692919d1e [REF] web, *: update bootstrap-datetimepicker to tempusdominus
* website_form, debian

Our old library for datetimepicker for bootstrap 3 is deprecated and
an updated version is developed by the same team under the new name
"tempusdominus", for bootstrap 4.

The lib is imported by taking the *unminified build* JS and the *src*
scss. Odoo is also bundling the lib better by putting the scss file
in both backend and frontend assets instead of only in common (so that
the scss is compiled differently for the frontend and the backend).

Note: the lib also needed to be patched inline to solve a bug at one
line.
2018-07-27 12:36:54 +02:00
qsm-odoo a991a579bc [REF] web: add the 'popper' library
Since bootstrap 4.0.0, the 'popper' library is a dependency.
2018-07-27 12:36:54 +02:00
qsm-odoo 9d90c7ea7b [IMP] base, web: update bootstrap 3.3.7 to 4.1.3
Simply updating the lib, the assets bundle content and the assets bundle
compiler.
2018-07-27 12:36:54 +02:00
Mathieu Duckerts-Antoine 097464de6f [IMP] web: easy selection of a period in filters menu
This commit allow to create easily a range of periods (related to a field
of date or datetime type) to select in the filters menu.

Two new attributes on elements with tag 'filter' are now usable
in combination in a search view arch:

- date: string.

		A valid field name with associated type date or datetime

- default_period: string (optional).

		To choose in the following list:
			- 'today'
			- 'this_week'
			- 'this_month' (default)
			- 'this_quarter'
			- 'this_year'
			- 'yesterday'
			- 'last_week'
			- 'last_month'
			- 'last_quarter'
			- 'last_year'
			- 'last_7_days'
			- 'last_30_days'
			- 'last_365_days'

Example:

<filter string="Creation Date" name="period_generator" date="create_date" default_period="this_quarter"/>

Note: the attribute 'domain' can not be used for such filters.
The generated domains are dynamic and can be saved as such
via the favorites menu.
2018-07-06 14:09:09 +02:00
Géry Debongnie dcc4d71623 [REF] web: move some code from pyeval to lib py_extras
Some functions that were in web.pyeval were actually "odoo independant".
To make them easier to manage/understand, this commit move them in the
library py.js, as an extra file.
2018-07-06 14:09:09 +02:00
Mathieu Duckerts-Antoine 64f3580af7 [IMP] web: add support of modulo in pyeval 2018-07-06 14:09:09 +02:00
kujiu f90cf060a3 [FIX] Syntax of icons (#25577)
Description of the issue/feature this PR addresses:

Accessibility improvements forbids the use of the syntax
`<i class="fa fa-check"/> Some text`
to create a labelled icon. But, by this, some fonts are changed.

Desired behavior after PR is merged:
The old syntax can be used.
2018-07-04 09:55:52 +02:00
kujiu 9de1bc0eef [IMP] Improve compatibility with screen readers (accessibility) (#24574)
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable.

This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader.


* [IMP] Labels must have a for attribute. Improve accessibility.
* [IMP] Better error message when trying to read a missing cached value
* [FIX] Add some aria-label and title attributes for screen readers.
* [FIX] Template name is not included in the error message in case of SyntaxError in QWeb
* [FIX] Improve the Tour failed at step error message to be more explicit.
* [IMP] Add aria-labels
* [FIX] Add missing aria-label on failing test
* [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all.
* [IMP] Color names on kanban views and many2many tags
* [IMP] Add some checks on views for accessibility.
* [IMP] Add `alt` attribute on `img` tags.
* [IMP] Add aria-label and title on non-described icons
* [IMP] Add button role to widgets with btn class
* [IMP] Translate aria and formatted attributes.
* [IMP] Remove wrong aria-labelledby
* [IMP] Add menu role on dropdowns
* [IMP] Buttons must be focusable
* [IMP] Add aria attributes on progress bars
* [IMP] Improve accessibility of basic widgets
* [IMP] Change main layout to more semantic tags
* [IMP] Add menuitem role when missing
* [IMP] Remove wrong role='presentation'
* [IMP] Improve accessibility of tab panels
* [IMP] Add aria-invalid on invalid fields
* [IMP] Add aria-sort on ordered columns
* [IMP] Add role on alerts
* [IMP] Use dialog role, header, main and footer tags for modals
* [IMP] Add labels on o_status
* [IMP] Improve accessibility of kanban view with feeds and articles
* [IMP] Add alerts in case of new messages
* [IMP] Add widget, navigation or img role to aria-labelled items
2018-06-22 21:22:21 +02:00
Christophe Simonis 73652a0b19 [MERGE] forward port branch saas-11.3 up to 50860317cc
Note: 1aacc96262 has been ignored and will
be forward-ported later
2018-06-15 13:27:27 +02:00
Christophe Simonis 50860317cc [MERGE] forward port branch saas-11.2 up to b170a753e1 2018-06-15 11:30:27 +02:00
Christophe Simonis b170a753e1 [MERGE] forward port branch 11.0 up to b05e4d5f95 2018-06-15 10:15:27 +02:00
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
qsm-odoo e5b268827f [REF] web, web_editor, website: convert LESS editor to SCSS editor 2018-04-18 15:59:25 +02:00
qsm-odoo a13ba24b3a [REF] web: change bootstrap datetimepicker source from less to scss
Note: the scss version of the lib file was not up to date, I manually
updated it to our current version (very small changes). The lib will
probably have to be changed with bootstrap 4 anyway.

Note 2: the file is left included in the common assets but it would
probably make more sense to put it both in backend and frontend instead.
2018-04-18 15:59:10 +02:00
qsm-odoo 6096f24501 [REF] web: change bootstrap source from less to scss
Note: bootstrap 3.3.7 in SCSS produces slightly different CSS
of bootstrap 3.3.7 in LESS... the DOM result should be the same
though.
2018-04-18 15:59:09 +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 Simonis b51f2d38c2 [MERGE] forward port branch saas-11.2 up to 500e3f4970 2018-03-21 11:04:48 +01:00
Christophe Simonis e0345a4a3f [MERGE] forward port branch 11.0 up to 2835d29979 2018-03-20 11:45:11 +01: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
Géry Debongnie 64d47c0bc5 [IMP] update ace editor to v1.3.1
Note that we do not do a custom build anymore, since we lazyload the
files anyway.  A custom build will save a few kb, but will not do any
meaningful change to the user experience.  However, it dies impact
negatively our ease of maintenance, so standard build it is.
2018-03-14 09:02:16 +01:00
Christophe Simonis 4aa5ec3fa5 [MERGE] forward port branch 11.0 up to d67b410dfc 2018-03-07 18:46:38 +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
Alexandre Kühn 7113e27cb6 [FIX] web: update to qunit from 2.2.1 to 2.3.0
In particular, qunit 2.3.0 solves this issue: https://github.com/qunitjs/qunit/issues/1119

A consequence of the above issue is that some tests could have completed successfully,
although an error was raised.
2018-02-22 14:23:03 +01:00
qsm-odoo 126850e9bd [IMP] web: update bootstrap to 3.3.7
Before this commit the bootstrap version we used was inconsistent.
Indeed, the javascript files were the 3.3.4 ones and the less files
were the 3.3.5 ones. This was due to a failed merged resolution in 9.0.
This should however not cause any issue as the difference between
3.3.x versions are very minor.

Basically, this commit is more of a fix than an improvement and may
even be backported if we find reasons to do so. This commit is mainly
made to prepare the transition to version 4.0.0, which requires to
switch our LESS files to SCSS first (and it will be easier to go by
bootstrap 3.3.7 with SCSS files first).
2018-02-01 11:03:05 +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