Commit Graph
134 Commits
Author SHA1 Message Date
Christophe Matthieu 95c2bd33a2 [IMP] web: lazy load nvd3, ace and fullCalendar lib to reduce asset size 2017-08-31 16:26:11 +02:00
Géry Debongnie 2106e3dd2e [REF] web, *: simplify our RPC system (in JS)
The RPC system was not completely satisfactory, we decided to prepare
the future and do it properly.  This commit introduces the new rpc
system, which replace the previous new one.  We now simply have a
method, this._rpc, which takes a dictionary of parameters.  The idea is
that depending on the parameters, it is able to add correct default
value when necessary.

For situations where we don't have the this._rpc method, we can use the
rpc.query method, which takes the same arguments, but directly calls
ajax.rpc instead of triggering up some events.
2017-04-11 19:44:38 +02:00
Christophe Matthieu eaa66d1156 [REF] web: change internal representation of fields and view meta datas
* Data manager load_view returns a viewInfo object
* ViewInfo contains: the arch, fields and fieldsInfo objects, and some extra informations
* The fields come from the server and are frozen, without any view attributes (depend of the model).
* The fieldsInfo contains every view attributes and informations.
2017-04-11 19:44:38 +02:00
Géry Debongnie 86a87aa8b0 [REF] *: use _rpc method for all rpcs
The _rpc method is now the preferred method to do a rpc, so we need to
update all calls.
2017-04-11 19:44:38 +02:00
Géry Debongnie e574027056 [REF] web,*: remove 'web.model' and 'web.dataModel
Use this.rpc instead of Model object, with web.ajax if necessary.

nb: EventDispatcherMixin include now the custom_events managment instead
of widget
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 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
Aaron Bohy cc59da1fc8 [FIX] web_diagram: wait for dialog's form view to be ready
Since rev. 002660a, form views are instantiated with their fields_view.
This has an impact in FormViewDialog as the inner form view
instantiation is now asynchronous. The diagram view instantiates several
FormViewDialogs but doesn't wait for the form view to be instantiated
before accessing it, which produces a traceback.

Closes #13775
2016-10-26 13:37:28 +02: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
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
Christophe Matthieu 7d6e63dddc [IMP] web_diagram: lazy load of jquery.mousewheel and raphael lib 2016-02-17 09:47:47 +01:00
Aaron Bohy bffa8f37f1 [REF] web_diagram: various tweaks
- Ensure compatibility with both editions of web
- Use the Pager widget instead of re-implementing it
- Fix the use of Dialogs which was broken (wrong type of Dialog was used)
- Convert css into less
- Some js linting
2015-08-07 14:05:07 +02:00
Aaron Bohy 1587647dcd [FIX] account,web(_diagram): FieldMany2One: rename $drop_down
$drop_down has been renamed into $dropdown in enterprise edition, which was
probably not a good idea, as it is accessed from outside web.
2015-08-07 14:05:07 +02:00
Aaron Bohy 10f2df8e59 [REF] web(_*): views: view_switcher icon
Add a key icon in the view's prototype corresponding to the font-awesome icon
to display in the view switcher.
2015-08-07 14:05:07 +02:00
qsm-odoo 46bf047e86 [IMP] web, web_*, mail, board : New modals and dialogs 2015-06-17 09:49:46 +02:00
Aaron Bohy 48f4605f5a [IMP] Web, Web_diagram: better integration of the Diagram view
The 'New node' button is inserted in the ControlPanel. Breadcrumbs
are now handled as well.

The 'multi_record' flag has been added to the views to distinguish views
displaying several records, like the List view, from views displaying
a single record like the Form view and the Diagram view. This flag is
used by the ViewManager to manage its view stack. Fixes the breadcrumb
bug when switching between Form view and Diagram view (the last element
of the view stack is now replaced by the new one in that case).
2015-03-24 13:33:10 +01:00
Aaron Bohy 1280bf2513 [IMP] Web and all views: ControlPanel atomic update
Change the logic of rendering and displaying/hidding the control
elements (buttons, sidebar and pager) of all views. The views do no
more render automatically their elements as this is rather done
through the render_[element] function called by the ViewManager.
This function only appends the element to the $node given as argument.
If no argument is given, then it may appends it to the DOM directly,
within the adequate div of its template.
This allows the ViewManager to attach/detach all elements of the
ControlPanel in an atomic may, to prevent the ControlPanel from
flickering.
Also detach the contents of the ControlPanel in headless mode. Headless
means that the ControlPanel exists, but is hidden. Detaching its
contents permits to have a cleaner DOM.

Also remove the oe_form_dirty class on the buttons in the FormView, as
this class is only used on the view itself.

Side changes:
* base_import: import.js:
    Extend render_buttons function to be compliant with the new buttons
    rendering logic
* board: dashboard.js:
    Set flag search_view to True as the searchview is needed for the
    Views displayed in the Dashboard to retrieve the records to display.
    Necessary since we do no more construct the searchview when this
    is set to false
* google_drive: drive.js,
  share: share.js:
    Module extending the Sidebar widget often add their own buttons
    by extending the start(), which is called each time the Widget
    is appended to the DOM. With our new design, this could be done
    in start() anymore as it should be done only one. It is now done
    in init() instead.
2015-03-20 16:34:39 +01:00
Aaron Bohy 53a9f6c081 [IMP] Web et al.: ControlPanel extracted from ViewManager
The ControlPanel is still instantiated by the ViewManager.

Changes details:
* web: views.js:
    Code related to views header is extracted from the ViewManager
    to a new Widget named ControlPanel.

    Also uses the headless flag to tell the inner view not to put
    its buttons (use case: kanban) or pager (use case: list) in the
    header as it is hidden.
* web: view_form.js, base.xml:
    Uses the headless flag at initialization of the One2ManyViewManager
    widget instead of extending the ViewManager template (which doesn't
    handle the header anymore).

* web: view_list.js:
    Test on this.options.$pager instead of this.options.$buttons
    when dealing with pager.

    Note: the behavior for list view is unchanged and has a bug.
    If there are more then 80 records to display, only the 80th
    first are display, and as there is no pager, there is no way
    to see the remaining ones. A fix for this would be to use a
    light ControlPanel in One2Many views as well. With this,
    there won't be duplicated .oe-'view'-buttons/sidebar/pager
    anymore.

* web: view_graph.js, view_pivot.js:
    Only render buttons in non-headless mode

* web_dashboard: dashboard.js:
    Fix some references that were broken with ControlPanel extraction

* web_view_editor: web_view_editor.js:
    Extend ControlPanel instead of ViewManager

* Changes in selector of ControlPanel elements in several addons:
    * base_import
    * mail
    * web
2015-03-20 16:17:06 +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 c8a8fec622 [REF] web_X: update to the new module system 2015-03-18 09:01:49 +01:00
Richard Mathot 7b763176ba [REM] modelines: Gotta catch 'em all 2015-01-08 11:38:58 +01:00
Géry Debongnie 265ba55646 [FIX] web: add missing icon, add warning, fix deferred
* ir_actions_common should return a deferred : some widgets
  do not return a deferred in start, so it could be undefined.
  it now is always a deferred.
* add icon for diagram view + breadcrumb support. diagram view
  is so rare that it wasn't tested in the client refactoring.
  This patch adds an icon for diagram view, and better support for
  breadcrumbs
* add warning in debug mode print workflow: when no record is
  selected, display a warning instead of failing silently
2014-12-11 10:07:26 +01:00
Xavier Morel 184f396ea0 [FIX] web_diagram: can't mark empty strings for translations, gettext does not like empty msgids 2014-12-02 09:40:59 +01:00
Christophe Matthieu fff2660c0c [FIX] web_diagram: don't try to load raphael.js lib. The lib is already loaded in the js asset 2014-07-07 14:58:12 +02:00
Antony Lesuisse 9e81c5aa07 [FIX] web_kanban_gauge needs raphaeljs temporarly back in assets_backend
bzr revid: al@openerp.com-20140501191831-mhsrpgza1x00ysy4
2014-05-01 21:18:31 +02:00
Fabien Meghazi 79ce95638d [IMP] async require of raphael.js
bzr revid: fme@openerp.com-20140430142025-nbvwk5ggzo1bro0q
2014-04-30 16:20:25 +02:00
Cedric Snauwaert e95ca69113 [REF]add bootstrap modal window based, cleaned, refactored from trunk-ui-to-boostrap-modal branch
bzr revid: csn@openerp.com-20140410100631-5v6a71oi5wyunbda
2014-04-10 12:06:31 +02:00
niv-openerp 906ceba948 [IMP] lot of small improvements to better detect when a view has finished loading
bzr revid: nicolas.vanhoren@openerp.com-20121213140914-8d1u01h17r2x4fpu
2012-12-13 15:09:14 +01:00
Fabien Meghazi 6637e05898 [FIX] Fixed diagram view
bzr revid: fme@openerp.com-20121206095123-4nybio4m9dtb9z9o
2012-12-06 10:51:23 +01:00
Fabien Meghazi 2994db89ca [MERGE] trunk
bzr revid: fme@openerp.com-20121105093013-31veb91zkdeiuddh
2012-11-05 10:30:13 +01:00
Fabien Meghazi ca6c49becf [IMP] jQuery deferred API changes refactoring. Changed 'then's in 'done'/'fail' and 'pipe's in 'then'
bzr revid: fme@openerp.com-20121030140630-gf20ye8fou1ebxft
2012-10-30 15:06:30 +01:00
Bharat Devnani (OpenERP) 74bac211fc [MERGE] merged hsa's branch lp:~openerp-dev/openerp-web/trunk-diagramview-imp-bde-diagram-pager-hsa
bzr revid: bde@tinyerp.com-20121023084031-wfy713bfbs0kaclv
2012-10-23 14:10:31 +05:30
Hardik 1435e6faeb [IMP]Diagram view pager is working and display in header
bzr revid: hsa@tinyerp.com-20121023073150-ozao4l0wca96cgmp
2012-10-23 13:01:50 +05:30
Fabien Meghazi 7dc44d561f [IMP] Improved pus/load state in diagram
bzr revid: fme@openerp.com-20121022083617-j1xuwhtywmxcqh3k
2012-10-22 10:36:17 +02:00
Fabien Meghazi b8ba7b389c [IMP] Improved state in diagram
bzr revid: fme@openerp.com-20121022083538-ua6fq20x5qkdwcwy
2012-10-22 10:35:38 +02:00
vta vta@openerp.com baf6526de5 [MERGE] Latest trunk.
bzr revid: vta@openerp.com-20121018130820-c95a4bsxsjq0vzxw
2012-10-18 15:08:20 +02:00
vta vta@openerp.com 1e70837161 [FIX] Fixed on_loaded in all different views.
bzr revid: vta@openerp.com-20121018114950-svqy0gje04vw2ysc
2012-10-18 13:49:50 +02:00
RGA(OpenERP) 564c9066fa [FIX] diagram view record not reload on refresh
bzr revid: rgaopenerp-20121015115214-cdw5ca6d24fgakir
2012-10-15 17:22:14 +05:30
vta vta@openerp.com 49c1c88962 [FIX] Fixed naming related to selected_elements.
bzr revid: vta@openerp.com-20121012131044-w4afp0shefzwlo7t
2012-10-12 15:10:44 +02:00
vta vta@openerp.com 885f9c4042 [MERGE] Latest trunk.
bzr revid: vta@openerp.com-20121012090105-d6ggjdyjh70zxbdv
bzr revid: vta@openerp.com-20121012091841-cg9ief3mm8jrnjhq
2012-10-12 11:18:41 +02:00
Vishmita 31a42989a7 [IMP]Improve Code
bzr revid: vja@tinyerp.com-20121012084900-zja87nszeh3q1ree
2012-10-12 14:19:00 +05:30
Vishmita 833c7bdc52 [FIX]Change name of the event and 'on_pager_action' function
bzr revid: vja@tinyerp.com-20121012062004-2an59ci8z5o9ijpu
2012-10-12 11:50:04 +05:30
Vishmita a31de511b6 [FIX]change event name
bzr revid: vja@tinyerp.com-20121011100301-nc4en7cn431zkgp6
2012-10-11 15:33:01 +05:30
Vishmita a0d781264c [MERGE]Merge Trunk
bzr revid: vja@tinyerp.com-20121011100113-pm14yibib3qw8nqx
2012-10-11 15:31:13 +05:30
Vidhin Mehta (OpenERP) 43217cc2b4 [IMP]replace callbackenable from on_select_elements.
bzr revid: vme@tinyerp.com-20121011070439-vzcua4yoiwlz2evk
2012-10-11 12:34:39 +05:30
vta vta@openerp.com 40eceb20a3 [FIX] Fixed on_record_loaded.
bzr revid: vta@openerp.com-20121010100233-tulf3c1fvnt2s85e
2012-10-10 12:02:33 +02:00
Vidhin Mehta (OpenERP) 91f9776979 [rem]console
bzr revid: vme@tinyerp.com-20121009125647-zwx4fj95fjs0y34u
2012-10-09 18:26:47 +05:30
Vidhin Mehta (OpenERP) abac1cae45 [IMP]improvements to record load event.
bzr revid: vme@tinyerp.com-20121009123532-bwlrg4ldtprd1w2d
2012-10-09 18:05:32 +05:30
Vidhin Mehta (OpenERP) 8888431f0d [MERGE]trunk.
bzr revid: vme@tinyerp.com-20121008131256-4vgny02tb70auj6d
bzr revid: vme@tinyerp.com-20121009102258-g0bjc2wj0etpivlk
2012-10-09 15:52:58 +05:30
Vishmita f44f548f06 [IMP]replace callenabled for on_write
bzr revid: vja@tinyerp.com-20121009071954-jojvmfs7cjuc0elg
2012-10-09 12:49:54 +05:30