Commit Graph
8215 Commits
Author SHA1 Message Date
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
Aaron Bohy 141f4d95bd [REF] web_kanban: render_buttons()
A special case for X2ManyKanban views was handled in the Kanban view itself.
This commit makes the X2Many case identical to the general case by setting
options.action_buttons to true if the X2Many field is not readonly.
2016-03-18 10:44:52 +01:00
Aaron Bohy 85066e7bcd [REF] web: /web/action/load: remove unused 'do_not_eval' argument
unused since rev. odoo/odoo@4a5cb1ebc4.
2016-03-18 10:44:52 +01:00
Yenthe 91163c8c1e [IMP] web: add restore database option on fresh install
Closes #11393
Closes #11080
Fixes #11079
2016-03-18 09:58:00 +01:00
Invitu bc758128a8 [IMP] add widget support in pivot views (issue odoo#10473)
For example, add widget="float_time" in hr_attendance pivot view measure
field.
2016-03-14 14:24:04 +01:00
Richard Mathot 9f7085586b [DOC] web: do_action accepts also the XML id of an action 2016-03-14 11:37:46 +01:00
Martin Geubelle fe66472e2c [FIX] web, web_kanban: visible default color on tags
The default comportement of tags has been changed. The default color is now visible on kanban.
The 10th color is now invisible.
2016-03-09 14:34:01 +01:00
Géry Debongnie f970906c9e [IMP] base,openerp,web: add debug mode === 'assets' and don't split assets by default
This is a rather large change for developers: from this commit on, we
need to use debug=assets instead of just debug to split assets.

The About menu has been slightly improved as well (the link does not
appear when we are already in debug mode), and an option has been added
in the debugging menu to activate the assets debugging mode.
2016-03-09 13:01:34 +01:00
Aaron Bohy 46857d267b [IMP] board,web: view_manager: lazy loading of default multi-record view
After a refresh or when opening odoo in a new tab, if view_type="form" is
specified in the url, RPCs to load the default multi-record view will be
performed if/when the user clicks on the breadcrumbs.

Moreover, the view manager is directly initialized with the res_id to load
after a refresh on a form view, to prevent the form view to fetch the defaults
values, to render in 'create' more, and then load the requested record and
switch back to 'view' mode.

Some code refactoring as well:
  - don't propagate state to the view_manager, but directly the view_type and
    res_id
  - remove unused argument no_store from switch_mode()
  - view_registry.get(): remove unused second argument
  - no need to switch_mode in do_load_state() as the correct mode is now loaded
    directly, even if it is a mono-record view

Also adapt code in dashboard.js according to changes in view_manager.
2016-03-09 13:01:34 +01:00
Aaron Bohy 8a47095a60 [REF] web: view_manager's init
Always initialize a view_manager with its dataset and views, but without the
action (at least explicitely, as the action might still be given within the
options).

This is a backport of changes in enterprise to keep the view_manager's API
similar in both repository, which is required the large refactoring that will
arrive.
2016-03-09 13:01:34 +01:00
Aaron Bohy b816cdbea9 [FIX] web(_*): views: render action buttons in dialogs
Commit 516b1a6c72 fixes a bug with action buttons not being displayed when they
should in dialogs. However, it makes the assumption that either $node or
this.options.$buttons exist, which is not always the case (e.g. dashboard).

This rev. moves that logic out of the views to the view_manager, and protects
the call of empty() on this.options.$buttons.
2016-02-29 08:47:20 +01:00
qsm-odoo 5a099117c4 [FIX] web(_editor): qunit tests
* Correct qunit template assets
* Delete useless template which broke qunit qweb inheritance
2016-02-25 14:45:34 +01:00
qsm-odoo 516b1a6c72 [FIX] web: target=new forms buttons
Launching a form view in a dialog thanks to target=new did not
display the action buttons (save, discard, ...). This is because
the action_buttons flag is set to false by default and the only way
to start an action with a different value is thanks to JS code (i.e.
the debug manager modals).

Now, action buttons are also rendered if the flag footer_to_buttons
is set to true (only happens when launching an action in a modal) and
that the formview does not have any footer tag with buttons to add
(so that wizard form keep replacing the action buttons by these footer
buttons).
2016-02-24 17:13:00 +01:00
qsm-odoo ed46965dbe [FIX] web*: tours
Selector changes + No need to open the snippet panel anymore.
2016-02-24 13:47:36 +01:00
qsm-odoo 58c5ff1d4f [REF] website*: frontend user navbar
* Remove use of bootstrap navbar
* Add navbar.less file for compatibility with enterprise
* Modify the location of the "new page/product/..." elements
2016-02-24 13:47:36 +01:00
qsm-odoo 88c2b6843a [REF] web,web_editor,website(_*),report,pos,mass_mailing: assets
* Remove recursive assets inclusions (i.e. assets_editor was including
assets_common, summernote, ...)
* Better construct the assets (link, then script + type attribute)
* Better include the assets (split js / css, always use t-call-assets)
* Simplifies the number of assets
* Move bootstrap js to assets common
* assets_frontend is now created by web module to allow using it on the
connexion page but also in the web_editor, where colors have to be
bootstrap/theme ones. Note: if a module depends on website, then keep
using the inherit_id="WEBSITE.assets_frontend"
2016-02-24 13:47:06 +01:00
qsm-odoo 5b65befcd8 [REF] web,web_editor,website,report,mass_mailing,mail: LESS
* Convert some CSS to LESS
* Split/Join LESS files
* Remove duplicates between website and web_editor
* UI improvements
* Allow simple customizations thanks to LESS var&mixins for website
2016-02-24 13:09:48 +01:00
stefanorigano c4a896a8a0 [REF] website,web_editor: complete restyling 2016-02-24 11:15:55 +01:00
qsm-odoo 8f2be0d61b [IMP] web: update Dialog class
Update Dialog class with enterprise version.
2016-02-23 13:40:17 +01:00
Christophe Simonis 60c9cac46b [MERGE] forward port of branch saas-9 up to 87a01c7 2016-02-17 18:07:21 +01:00
Christophe Simonis 5be43b8d9a [MERGE] forward port of branch 9.0 up to 27058c4 2016-02-17 17:48:03 +01:00
Géry Debongnie be3f7ea433 [FIX] web: prevent focus issue with autoresize
The copied textarea used in autoresize was a valid target for focus when
using the tab key.  This is a major issue in editable list views,
because when the user leaves a textarea, the list view jumps up, with no
visible focused field.
2016-02-17 14:24:09 +01:00
Christophe Matthieu 3cb7d907a3 [IMP] web_kanban_gauge: remove justgage lib and use d3 2016-02-17 09:47:46 +01:00
Christophe Matthieu 7fdd33c47b [IMP] web: move ZeroClipboard lib into website_links addon 2016-02-17 09:47:46 +01:00
Christophe Matthieu 831246fc9d [IMP] web: remove spin lib and replace by an image with css to spin 2016-02-17 09:47:46 +01:00
Christophe Matthieu 0208b91def [IMP] web: remove useless jquery.validate lib 2016-02-17 09:47:46 +01:00
Christophe Matthieu 1c02be8974 [IMP] web: remove useless jquery.notify lib 2016-02-17 09:47:46 +01:00
Christophe Matthieu a56f27a3c9 [IMP] web: reduce jquery-ui lib (remove useless modules)
Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, sortable.js, autocomplete.js, datepicker.js, menu.js, tooltip.js
2016-02-17 09:47:46 +01:00
Christophe Matthieu 1a2b1e69dd [IMP] web: remove useless jQuery.timeago lib
Replace call by moment(date).fromNow()
2016-02-17 09:47:45 +01:00
Christophe Matthieu 8d90abc66a [IMP] web: remove useless jquery.textext lib 2016-02-17 09:47:45 +01:00
Christophe Matthieu 63bbb87032 [IMP] web: reduce nv.d3 files size (remove useless models)
https://github.com/novus/nvd3

grunt concat:
css.src: ['src/css/axis.css', 'src/css/scatter.css', 'src/css/tooltip.css', 'src/css/bars.css', 'src/css/lines.css', 'src/css/main.css', 'src/css/pie.css']
js.src: ['src/core.js', 'src/dom.js', 'src/interactiveLayer.js', 'src/tooltip.js', 'src/utils.js', 'src/models/axis.js', 'src/models/scatter.js', 'src/models/multiBar.js', 'src/models/legend.js', 'src/models/lineChart.js', 'src/models/line.js', 'src/models/discreteBarChart.js', 'src/models/pieChart.js', 'src/models/discreteBar.js', 'src/models/multiBarChart.js', 'src/models/pie.js']
2016-02-17 09:47:45 +01:00
Denis Ledoux 493705bb77 [MERGE] forward port of branch 9.0 up to c40070f 2016-02-15 17:00:11 +01:00
Martin Trigaux 9c4c3809fd [FIX] web: missing space in translations
Translated text is stripped of starting and ending spaces on Transifex which
makes the result text look bad (as translators do not put spaces in their
translation either).
Add explicitely a space to be sure it's present in the translation.
Will have no effect on English as it's HTML
2016-02-15 15:31:45 +01:00
Odoo Translation Bot ee42be5921 [I18N] Update translation terms from Transifex 2016-02-14 00:34:15 +01:00
Christophe Simonis 9a805c90ed [MERGE] forward port of branch saas-9 up to d70fde0 2016-02-10 18:40:56 +01:00
Yannick Tivisse 7db8f1ca30 [IMP] web: remove rpc call on SwitchCompany widget loading
By setting the information returned by read_companies on the session
information, we are able to remove the rpc call and the willStart
method definition

Also: Set a debounce on SwitchCompany widget to avoid multiple RPC
2016-02-09 17:40:34 +01:00
Denis Ledoux eb2346ba46 [MERGE] forward port of branch 9.0 up to 0b7990c 2016-02-08 16:08:32 +01:00
Yannick Tivisse 071aa38b4e [FIX] web: avoid infinite pending state in case of RPC call fail
If the RPC fails, the deferred is never resolved nor rejected,
so the deferred given by willStart will stay in a 'pending' state

As the deferred is expected to be resolved or rejected to launch the
systray to continue, we have to catch this case too.
2016-02-08 15:04:01 +01:00
Nicolas Lempereur dde97416b9 [FIX] web: pivot click keep view references
When clicking on a pivot view cell, the gotten view were default views.

For example when on the opportunity pivot view, after clicking on a cell
we we would get to the crm.lead default view instead of the opportunity
one.

This commit keep references to current action views when clicking on the
cell.

closes #10768
opw-668472
2016-02-08 14:33:44 +01:00
Yannick Tivisse 46e925aa9f [FIX] web: Load SystrayMenu even if a systray's deferred is rejected 2016-02-08 11:08:34 +01:00
Yannick Tivisse 09659cca30 [ADD] web: Company swicher button on systray
If the user has multicompany rights and more than one allowed
companies, the full company name is displayed in the  topbar. When you
click on it, there is a dropdown with the name of the other companies.

Clicking on another company name makes you switch on it and reload the page
2016-02-08 09:08:11 +01:00
Odoo Translation Bot f2146d360d [I18N] Update translation terms from Transifex 2016-02-07 00:33:44 +01:00
Christophe Simonis 04416a5a6f [MERGE] forward port of branch saas-9 up to 469e04e 2016-02-02 14:55:52 +01:00
Christophe Simonis e765569d04 [MERGE] forward port of branch 9.0 up to f0a63e5 2016-02-02 14:44:39 +01:00
Richard Mathot 36fbbc46e1 [ADD] delivery: environment field
This field is used in all delivery carriers to determine if they call
the test or the production API.
2016-02-02 14:01:35 +01:00
Christophe Simonis fbd5fab238 [MERGE] forward port of branch saas-6 up to 9ca7ad8 2016-02-02 13:18:33 +01:00
Christophe Simonis 9ca7ad87b2 [MERGE] forward port of branch 8.0 up to 3ac46ee 2016-02-02 12:25:06 +01:00
Aaron Bohy 0de35ffa7f [FIX] mail,web: don't block chat windows when blocking ui
One will still be able to chat in chat windows during long RPCs...
2016-02-01 11:31:36 +01:00
Odoo Translation Bot 3b4bbb8c28 [I18N] Update translation terms from Transifex 2016-01-31 00:33:36 +01:00
xmo-odoo 19a1c18f57 [FIX] make m2m checkbox labels clickable 2016-01-29 16:24:14 +01:00