Commit Graph
286 Commits
Author SHA1 Message Date
Christophe Simonis da53a27a5d [MERGE] forward port of branch saas-11 up to c88c70e 2016-06-21 16:24:38 +02:00
Christophe Simonis c88c70e900 [MERGE] forward port of branch saas-10 up to d73f0d8 2016-06-21 13:58:24 +02:00
Christophe Simonis 0a2317d303 [FIX] test_new_api,web: tests 9.0 adjustments
Rev e37ba61 forward-ported 8.0 revision f02b230 from PR #12379.
This patch introduces extra tests and views for o2m onchange behavior,
including new fields in the test models.

In 9.0 a new convert_to_onchange() mechanism had been
introduced at 9f81c6d

The combination of both requires some adaptation to the
expected results of the new tests and adaptation of existing tests.

The test models in `test_new_api` have an implicit depencies between
models which cannot be express on ORM:
    messages depends on participants of their discussion.

So, when editing a discussion, the field `participants` should be
processed before field `messages`. This is not always done because
field processing order depends of the iteration order of a `dict` (which
is undefined in python).
The testing tour `widget_x2many` worked by chance until now.
Adapt the tour to save the participants before the messages.
2016-06-21 11:23:18 +02:00
Géry Debongnie 77e20f57d2 [FIX] web: prevent some rpcs in tests
each time a js test is run, it used to start the chat manager, which
does a rpc.  This simply prevent the chat manager to start.
2016-06-17 13:32:38 +02:00
Géry Debongnie d56b35e26e [REF] web, *: move QWeb odoo init to web.QWeb
this js module centralizes all odoo initialization
2016-06-17 13:27:18 +02:00
Géry Debongnie cfe4b337af [REF] web: move async_when to utils 2016-06-17 13:24:54 +02:00
Adrien Dieudonne a9b0561106 [FIX] *: use new JS module to read from/write in localStorage
to prevent errors when the localStorage capacity is 0, which is the case e.g.
on private browsing with Safari.
2016-06-16 13:48:18 +02:00
Géry Debongnie 9c68bc7482 [REF] point_of_sale,web(site): move session info into page source
This commit introduces a mechanism to add information into the session
from a different module, without having to fetch it manually with a rpc.
This is intended to be used with small pieces of info required at the
start of the web client, such as currency informations.

To add information to the session, one can simply inherit from ir.http
and modify the session_info method.
2016-05-30 09:23:07 +02:00
Christophe Simonis 91c9284951 [MERGE] forward port of branch saas-10 up to 5aa0bae 2016-05-13 16:33:51 +02:00
Nicolas Martinelli 50b94ef079 [FIX] web: search input of date
When the user searches for date (or a datetime) in the search bar, the
suggested date can become completely wrong. For example, in the French
localization where the date format is DD/MM/YYYY, the system will search
for the date MM/DD/YYYY. This is even worse when the date is not fully
written: DD/MM could be converted to MM/DD/0000, which doesn't make any
sense. This is related to the moment issue
https://github.com/moment/moment/issues/1407.

The fix is to make sure that the input date has a correct format thanks
to `parse_value`. The latter converts the date into a fixed format.

Fixes #11876
opw-676604
2016-05-10 11:19:22 +02:00
Aaron Bohy 977db823c7 [REF] web: stop duplicating web
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
2016-04-21 15:21:39 +02:00
Aaron Bohy 6c57935443 [IMP] openerp,web: cache of actions, fields(_views) and filters
Introduction of 'data_manager' service which handles meta-data related to
actions and views (fields_views, fields and filters). Ideally, all RPCs to
get that kind of information should go through data_manager, as it holds an
internal cache.
2016-03-18 10:44:52 +01:00
Aaron Bohy 002660a9b0 [IMP] openerp, web(_*): batch views RPCs
Load the fields_view of all views of the action together. If a searchview is
required, also load its fields_view and its filters.

Use lazy-loading for fields as they are required for the Pivot and Graph
views only, and may be used by Filters and GroupBy menus of the Search view
if the users clicks on 'Add a custom Filter/Group'.

The fields are thus also loaded directly if the first view of the action is
Pivot or Graph, and otherwise, they are lazy-loaded when/if the user opens
a Pivot or Graph view, or if he wants to add a custom Filter/Group.

Some refactoring of views API as well:
- Views must now be instantiated with their fields_view
- Move code requiring fields_view from start() to init(), or willStart() for
  heavy processing.
- Remove view_type attribute from views as it was used to call
  fields_view_get.
- Remove view_id parameter to views' init as it is no longer used.
- Move duplicate code from various views' init to the View widget.
- Remove view_loading() function from views as they now follow the classical
  lifecycle of widgets (init -> willStart -> start -> destroy).
- Searchview now extends View like all other views.
- Remove useless function guard_active() as it was used for the form_view's
  action buttons to wrap handlers to ensure that they are executed only if
  the form_view is the current active view. This is not useful anymore as
  from v9, views and their control panel are appended in the DOM
  simultaneously, so one can't click on a button of a view which is not the
  current active view.
2016-03-18 10:44:52 +01:00
Géry Debongnie 29427bdcb3 [FIX] web: reimplement autosize for fun (and some bugfixing)
autosize does not work correctly (it moves the screen in all directions
sometimes when the user press enter in the bottom of the screen in some
browser),

So, we decided to have our own version, because of course, we can do it better.  A
few horrible hacks later, I proudly present you "autoresize" (it was
almost named "odooresize" but common sense prevailed).

As added benefits, it plays better with our web client, so when you open
a dialog in a modal for example, the autosize fields should have the
correct height automagically (or should I say 'odoomagically')
2016-01-11 14:32:51 +01:00
Christophe Simonis 56a442e205 [MERGE] forward port of branch saas-6 up to dade7e3 2015-11-25 13:26:02 +01:00
Denis Ledoux 32fd520d97 [MERGE] forward port of branch 8.0 up to 6f29cbe 2015-11-23 17:40:15 +01:00
Thomas Groutars b665478fa7 [FIX] py.js: unhandled prefix not
closes #6129
2015-11-19 13:54:26 +01:00
Denis Ledoux a3648fd23a [MERGE] forward port of branch 8.0 up to aabbdc7 2015-09-21 16:01:58 +02:00
Olivier Dony 0f06e5f54f [FIX] tests: outdated resource paths in manual test files 2015-09-18 15:52:11 +02:00
qsm-odoo 1a405ed7c4 [FIX] web: widget_x2many tour
The test was not stable enough since listview editable and onchange
API changes.
+ Some step were wrong (test of the wrong element)
+ Minimize differences with enterprise version (so that the two tests
are testing the same things)
2015-09-08 14:14:31 +02:00
qsm-odoo 3f7d350fe2 [FIX] web: Listview editable
(backport of enterprise version)

Fix various problems with list view editable :
* Click outside which should discard/save the line in edition
* Warnings which should not appear when line is being discarded/saved
* JS test

+ JS code refactoring
2015-09-08 14:14:31 +02:00
Nicolas Martinelli 0414c9dd6a [IMP] web, website*: adaptation due to the new Sale module
Major changes:
- No use of UoS anymore
- Specific method to calculate delivery

Reason: complete rewrite of the Sale module.

Responsible: fp, dbo, nim
2015-08-27 19:21:37 +02:00
Christophe Matthieu a102a9f3fc [IMP] web: add a test to check the one2many create form and onchange 2015-08-27 15:01:09 +02:00
Ronak Baxi 0e603b9927 [FIX] web: x2many tour: broken selector
of a button in a modal footer
2015-08-19 08:10:45 +02:00
Christophe Simonis 98ef7e29f3 [FIX] web: correct x2many js test tour.
Now that users are ordered by name, we need to explictly choose the
correct participants.
2015-08-16 00:52:04 +02:00
Christophe Matthieu 7c10cb47f1 [FIX] web: readonly fields not transferred from dialog to 2many field
Transfer options to 'data_create' and 'data_update'
Add tour to check the fix
2015-08-14 15:34:58 +02:00
Aaron Bohy 83dab472f3 [REF] web(_tests),test_new_api: split and remove web_tests
Move the widget_x2many tour to web and call it from test_new_api as it needs
to be overrided for the new design, and it requires models and data from
test_new_api.

Clean other unnecessary stuff from web_tests, and thus remove the addon.
2015-08-05 14:38:00 +02:00
qsm-odoo 86c399f3bd [IMP] web: New notification system
Backport of the Notification system
2015-07-23 10:51:12 +02:00
Aaron Bohy 27df65c878 [IMP] board,google_spreadsheet,web,web_calendar: Favorites menu
Adapt the Favorites menu so that addons appending stuff in it are compliant with
the enterprise edition.

Mainly, creation of dashboard.less from of dashboard.sass so that we can use mixins
defined in the web addon.

Some changes as well in the dashboard view to make it compliant with the enterprise
edition.

Use correct naming convention: classnames with underscores, less mixins with hyphens.
2015-07-15 13:32:56 +02:00
Christophe Matthieu 500c33b184 [IMP] web: split model.js into model.js and data_model.js. Web js modules must call web.DataModel. 2015-07-10 16:32:35 +02:00
qsm-odoo 46bf047e86 [IMP] web, web_*, mail, board : New modals and dialogs 2015-06-17 09:49:46 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
qdp-odoo c04065abd8 [IMP] accounting v9. Yeeeeaah 2015-05-05 17:28:04 +02:00
Christophe Simonis 9c5a1d8231 [MERGE] forward port of branch 8.0 up to cf4d14c 2015-04-27 17:33:44 +02:00
Denis Ledoux 84e10ad03b [FIX] web: translation of default M2O values in search bar
When a many2one field of a searchview was selected
by default, through a default_*_id within the context,
the many2one value name wasn't translated.

e.g. with Spanish loaded (and l10n_multilang installed),
translate a project.project name in Spanish.
Then, while being in Spanish, in the project.project kanban,
click on the Tasks link of a project (tareas),
then, notice the value of the project name in the
search bar.

opw-632818
2015-04-22 17:53:35 +02:00
Géry Debongnie ebc39b8788 [FIX] update tests to new module system
Various tests (mostly tours) were broken with the large changes in the
way the js code works.
2015-03-18 09:23:37 +01:00
Géry Debongnie 4fdf74fe21 [IMP] web+addons: improvement to module system
The module system needs to know the dependencies of a given module
before executing the function.  This is why the dependencies were
defined once in an array, and then were described one more times in the
call to require.

But a trick can simplify this: the boot function can parse the string
representation of the module and extract the calls to require from it.
It is more work for the processor, but it leads to simpler module
definitions.
2015-03-18 09:23:37 +01:00
Géry Debongnie b960f8ad52 [REF] web: update test suite to new module system
The test suite needs to be adapted to the modules.  Also, the update
of qunit changes the API, so the tests needs to be changed as well.
2015-03-18 09:01:50 +01:00
Christophe Simonis bc2fd0515b [MERGE] forward port of branch 8.0 up to 017f346 2015-03-04 15:16:10 +01:00
Xavier Morel f64a2fa386 [ADD] js tests: more relativedelta tests
* add some more boundary tests and nudges
* add test for weekday

ref #5089
2015-03-03 11:55:18 +01:00
Géry Debongnie 77413fc764 [FIX] update tests and change search logic (webclient)
previous commit broke some tests.  The issue is that the search view
now avoid making requests if there is no action id.  But this is an
assumption that tests use, so some slight adjustments have to be made.

Also, this is the moment to give properly the action id to the favorite
menu.  Instead of bypassing its parent, it now receives the action id
from the search view.
2014-11-20 14:58:10 +01:00
Fabien Meghazi a29c44be31 [FIX] python strftime to moment.js format conversion 2014-11-05 15:28:00 +01:00
Cedric Snauwaert a878de477f [FIX] web: fix remarks from pr 2014-11-05 15:27:59 +01:00
Cedric Snauwaert a8d9743c0c [FIX] web: fix tests on date parsing 2014-11-05 15:27:59 +01:00
Cedric Snauwaert ef886aed2f [FIX] web: remove datejs and replace by momentjs 2014-11-05 15:27:59 +01:00
Géry Debongnie f25608c6fc [FIX] remove search.invisible tests
The search view architecture allowed an 'invisible' attribute in fields.  These fields were ignored for the autocompletion and did not appear in the interface.  The goal was to allow default parameters to create facets, without displaying the field in the interface.  Since that functionality is not used and the new search view does not support it right now, the tests can be removed.
2014-10-21 09:33:51 +02:00
Géry Debongnie d9f95e855e [FIX] update tests in search view 2014-10-21 09:33:51 +02:00
Géry Debongnie 2e43d4be29 [FIX] update the search tests
The search tests are totally outdated since the search view rewrite. This commit update them to the new search view.
2014-10-21 09:33:51 +02:00
Christophe Simonis 52fee2811d [MERGE] forward port of branch 8.0 up to 2b192be 2014-10-16 16:04:39 +02:00
Xavier Morel 62fcce9054 [ADD] JS widgets reference documentation
Also fixed Widget#alive's behavior and tested it
2014-10-07 10:21:44 +02:00