Commit Graph
11 Commits
Author SHA1 Message Date
David Monjoie 93d09397af [ADD] web: add integer field tests and documentation 2017-04-11 19:44:38 +02:00
David Monjoie 8992b7751c [ADD] web: add boolean field tests and documentation 2017-04-11 19:44:38 +02:00
David Monjoie c7e4ffad4f [ADD] web: add date and datetime fields tests and documentation 2017-04-11 19:44:38 +02:00
David Monjoie 4126c31fda [ADD] web: add char field tests 2017-04-11 19:44:38 +02:00
Géry Debongnie dde1223a14 [REF] *: remove manualDestroy options for tests
With the new JS test framework, we had experimented with an autodestroy
feature, meaning that all views/widgets are automatically destroyed
after a while.  By default, it was 50ms, because we could not hook some
code to run after the end of the current test.

For various reasons, this was not a good idea: some side effects, such
as modifications of the session or of the DOM (with modals) could
interfere with other tests.  This commit disable the feature.

From now on, we will have to destroy each widgets created in a test.
2017-04-11 19:44:38 +02:00
Géry Debongnie dba7e64a2f [FIX] web: fix crash in FieldBooleanButton
It tried to read its options in the wrong key, which resulted in a good
old-fashioned BOOM.
2017-04-11 19:44:38 +02:00
Géry Debongnie da4e653695 [FIX] web: various fixes for date and datetime in client
The field_utils date method have been modified recently, and the idea
behind those changes is that the BasicModel keeps at all time a moment
instance as its internal representation of a date or datetime.

But the parse and format methods did not properly support unset dates,
so we have to slighlty change them to support the case where their values is
not set.
2017-04-11 19:44:38 +02:00
Géry Debongnie 064d7f4621 [FIX] web: make focus tests works if window has not the focus
Until now, those tests failed if the window did not have the focus. We
solve the issue with 2 different fixes:
* instead of checking that the focus property is set, we can check the
activeElement instead, it seems to work.
* instead of calling the focus method, in some tests, we can trigger a
* 'focusin' event.  I don't know why this works, but it does.

Note that this might make the tests work in phantomjs
2017-04-11 19:44:38 +02:00
Christophe Matthieu 3c0190d0a6 [IMP] web: use moment object instead of string for date
Before this commit, the odoo web client used strings to represent dates.

Now, the date is parsed into a moment object when the value is read from the
server side. The widget formats the object to display the value. When the
widget value changes, the value is parsed to a moment object. The value is
automatically formatted to server value in ajax calls (toJSON method).
2017-04-11 19:44:38 +02:00
qsm-odoo 92f24f2cfe [IMP] web: adapt field domain to new API
Add the implementation of the "FieldDomain" (widget='domain') in
basic fields file.
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