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
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.
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
* 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
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, ...
* display all lines and don't display the scroll bar into ace editor
* lazy read ace lib and add missing lib file
* use not minified version of ace lib
* Move ace lib from website to web
* Added ace widget for webclient
* XML mode for view text box
* Python mode for server action text box
* Removed web_ace_editor.xml, instead added template in base.xml itself
* Added widget=ace_editor in compute field of ir.model.fields
The goal of this commit is to have better search results when fuzzy
searching. Before this commit, the position of a match was irrelevant
to the search results. After, a match in a first position has more
weight than a match in last position. This is better, because we often
want to find results using the first letters.
This is controversial, but I could not find a better way to do this
without rewriting the whole library myself (which might not be a bad
idea, it is only 50 lines long)
Avoid duplicating web addon in enterprise by extracting a common basis.
Enterprise features stay in enterprise, but use that common basis.
Mainly:
- JS refactoring and linting
- Conversion of .sass into .less split into multiple files
- Templates cleaning and DOM simplification
- Re-generation of web.pot, and update of .po files
When editing a form with the arabic language, the date is formatted in
arabic. But the version of the Moment.js library we use for this had
inconsistencies and parsing the arabic date could not work.
Hence, saving would not work since date field values would be invalid.
This commit cherry-pick http://momentjs.com/ commits which solves that:
from version 1.8.4: https://github.com/moment/moment/commit/c9023b5
from version 1.9.0: https://github.com/moment/moment/commit/bd328d5closes#10634
opw-660453
This commit does not actually fix qweb2.js, but it works around a
phantomjs bug. The problem with phantomjs is that in some situations,
the xmlhttprequests are dropped with a status 0. It is most likely
related to the issue:
https://github.com/ariya/phantomjs/issues/11195
In our testing framework, it seems to appear when requests sent before
the 'load' event of phantomjs are received after, and also when those
requests are listened with the onreadystatechange handler.
The bug does not appear if we use addEventListener with the 'load' event (at
least, not for a few builds)
This commit does not worsen qweb, and it is also a small improvement in
style (in my opinion).