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.
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.
A unique main ControlPanel is instantiated by the ActionManager and it
is updated each time the state changes (i.e. when an action is performed
on the ActionManager or when switch_mode() is called on the ViewManager).
Introduction of State classes to facilitate the way of restoring
previously rendered states in ControlPanel. The notion of widgets
previously used in the ActionManager is now encapsulated in the notion
of states.
The search() function has been moved from ControlPanel to ViewManager as
it makes more sense like this.
The ViewManager doesn't have the reference to the ControlPanel but
rather communicate with it through a dedicated bus.
Some refactoring has been done on the ControlPanel as well so that it
doesn't need to know the ActionManager and the current Action anymore
(it communicates with the AM with events, and it updates itself using
information passed in arguments).
Improves the way the ViewManager requests the ControlPanel to
instantiate a SearchView, and how it waits for this SearchView to be
corretly loaded.
Move back the views logic to the ViewManager which directly asks
the ControlPanel to render the buttons and switch-buttons areas with
the views passed in arguments.
Removes option replace_breadcrumb in push_state() of ActionManager as it
is not used.
Side changes:
* Account: account_widget.js:
Adapt code to retrieve the current state of the ActionManager.
Required due to the introduction of State classes that encapsulate
the notions of widgets and inner_widget in the ActionManager.
* Board: dashboard.js:
Some refactoring to adapt the code according to the new Widgets
structure. Several dependencies (e.g. searchview, action) were
unnecessary. Do not append the "add to dashboard" option to the
Favorite menu if there is no ViewManager available (e.g. in
Messaging) instead of hidding it with a CSS rule, as a ViewManager
required to retrieve the active_view.
* Google_spreadsheet: search.js:
Change the way to retrieve the list_view_id s.t. it does not rely on
parent of the SearchView anymore.
* Web: search.js:
Change the way to retrieve the title in search.js for Favorites s.t.
it does not rely on the parent of the SearchView anymore. Doing so,
the ControlPanel does not need the title attribute anymore.
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
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.
* toggleClass('class', undefined) behaves as if no second argument was
passed: a classic toggle
* toggleClass('class', !undefined) will only add the class if not
present, as the second argument is a boolean (!undefined is true)
This leads to an inconsistent state in the previous implementation of
multiple toggle methods (the`closed-menu` class was never toggled). We
now only use the not operator when the variable is not undefined.
Also, fix the toggle `closed-menu`/`open-menu` logic in dashboard.js,
where it was applied to the `a` instead of the `li`.
* dashboard did not display properly kanban in ie
* kanban did not extend to the bottom of the available screen
* custom filters did not display anything different when they were
public (not private)
* some small css problems
With the search view refactoring, the add to dashboard functionality was unavailable. Weep no longer, it is fixed. The dashboard button is now an action in the favorites submenu instead of a search input
In case we have no defined action (e.g. redirection by python code), adding a dashboard should not be possible as the rendering based on the action.
This patch hides the 'Add to Dashboard' button in search view (opw 611288)
The widget AddToDashboard used to make an ajax call every time the
search view is loaded. This is often useless and can be annoying when
that request is long. With this patch, the request is only done when
the user click on the widget AddToDashboard
[MERGP] Inline Searchview
This task split the searchview in two parts: SearchView and SearchViewDrawer. The drawer is displayed inside the main view and the searchview stays in place. It also changes the scrolling behavior of the web client: the main view area can scroll without affecting the UI (so the various menus stays in place)
Because of this, other large changes have been made:
the drawer has been redesigned,
the Custom Filter widget has been split in two (Custom Report and SaveCurrentFilter),
the main view is now scrollable, so the UI stays in place and only the view can change
The text 'Group By...' has been changed into 'Group By' (most addons had to be modified)
bootstrap classes are used when it makes sense (for example, badge)
the left menu is also scrollable (separately from the main view)
It is likely that some stupid bugs have been introduced. Please don't hurt me.
The dashboard widget didn't work because it tried to look for its
parent view, but the searchview has been split in searchview and drawer.
This patch makes sure it looks for the data in the correct place.
the searchview has been split in two: searchview and searchviewdrawer.
The widget addtodashboard need to get the name from the searchview and
not from the drawer.
The search view has been split into two widgets: SearchView
and SearchViewDrawer. The addons board and google_spreadsheet need
to be updated to append their input widget to SearchViewDrawer and
not to SearchView.