summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views.js
AgeCommit message (Collapse)Author
2015-03-18[REF] web: add module system to the web clientGéry Debongnie
This commit introduces a new module system for the javascript code. Instead of using global (namespaced) variables everywhere (like openerp.web.whatever, ...), each file declare one (or more) module with its dependencies. Each module will be loaded after its dependencies, and will be given a reference to the return values. This change is a massive departure from the way the client worked previously. It will sadly break some/most history, but I am sure that the future git ecosystem will allow you to easily browse the history past this revision (one can dream). This commit feature: * main namespace is now odoo instead of openerp * a way to define modules and dependencies (inspired by requirejs) * many files have been splitted in simpler subfiles * basic support for debugging in odoo.__DEBUG__ * no global variable (i.e. nothing in window.openerp) * many bug fixes, many new bugs Future vision: this modularization should simplify future code development, simplify debugging and will allow a serious testing effort
2015-03-10[MERGE] forward port of branch 8.0 up to c0496edChristophe Simonis
2015-03-10[FIX] mass mailing: keep menu when back in backendNicolas Lempereur
The menu was not present in 8.0 when going back from the mass mailing email composer to the backend. This fix adds the current action id as a return_action query string parameter and return to the correct action. fixes #5591 opw-629526
2015-02-23[MERGE] forward port of branch 8.0 up to 5d9fb7fChristophe Simonis
2015-02-23[MERGE] forward port of branch saas-3 up to 56c73bfDenis Ledoux
2015-02-23[MERGE] forward port of branch 7.0 up to 0bbd835Denis Ledoux
2015-02-23[FIX] web: on_item_action_clicked, self.dataset is not always defined.Denis Ledoux
27a48f8026f824f62955d5bf2a83b2799ad98db1 introduced the use of self.dataset It appears it is not always defined. Few lines above, self.getParent().dataset is used, and looks to be always defined. We therefore now use this dataset in order to get the context, to correctly pass the current session language. Closes #5416
2015-02-20[MERGE] forward port of branch 8.0 up to d350f5bChristophe Simonis
2015-02-20[MERGE] forward port of branch saas-3 up to aae75f1Denis Ledoux
2015-02-20[MERGE] forward port of branch 7.0 up to 27a48f8Denis Ledoux
2015-02-20[FIX] web: action translation (menuitems & more menu)Denis Ledoux
This rev. reverts partially 1d76586a1b0fff766581871cd277332bbfec030a This rev. is related to #3462 Regarding addons/web/controllers/main.py --- name of model ir.actions.actions is not translated it's the name of server actions, client actions and window actions that are translated. Meaning the name of the ir.actions.actions will always be in English, even when passing the user language within the context. Regarding addons/web/static/src/js/views.js --- There is no reason to pass the field values within the context of the /web/action/load call: The read methods of actions are not overidden to use the field values. Besides, it pollutes the context of the action, leading to unwanted behavior, such as the translation of the action name within the lang available in the fields of the form view (e.g. the partner form). Initially, the field values added in the context has been added within the rev. 542928adde6f74269f51d24e18896b2e8bb44fc2 Indeed, sidebar_context (or sidebar_eval_context nowadays), contains the field values, and the additional_context passed to /web/action/load is an extension of this sidebar_context. We are not sure the reasons why the sidebar_context was passed to the /web/action/load, but we believe it was to pass the session/user context containing the lang, timezone, and so on, not to pass the fields values.
2015-02-11[MERGE] forward port of branch 8.0 up to 33a8989Christophe Simonis
2015-02-05[FIX] web: reset dataset orderby on groupby filter.Denis Ledoux
If the list view had a default order, for instance, default_order="create_date desc", setting a groupby filter kept this default order and the groupby list was therefore not ordered on the groupby field In general, when setting a groupby filter on a list we expect the list to be grouped by the groupby field The reset of the orderby is done only when the list is not grouped and a first groupby filter is applied. The orderby is not reset when adding a new groupby, when one was already applied. It doesn't reset either when passing from 2 groupby clause to 1. It doesn't reset either when passing from 1 groupby clause to none. opw-627233
2015-02-02[FIX] web: correctly use function actionsGéry Debongnie
actions can be defined by a function, but the action manager was changed to try to instantiate it instead of simply executing it.
2015-02-02[FIX]History Back: Fixed the issue of history back, when calling action ↵Mohammed Shekha
history_back it always redirect to home page, instead of previous view
2015-01-30[FIX] web: correctly initialize view $containersGéry Debongnie
Problem could happen when clicking in views in dashboards. The $container was looked up depth first when the view is created, but in some case, it is wrong (the correct order is actually breadth first). A better way to proceed is to get the reference when the view manager is created, so we don't have the problem at all.
2015-01-28[FIX] Web: views.js: use initial_mode editAaron Bohy
Use the option initial_mode of views when openning a view in 'edit' mode at first rendering. This fixes a bug with FieldOne2Many widgets whose buttons were not displayed at first rendering in 'edit' mode (e.g. in the Sales Team FormView).
2015-01-28[FIX] Web: views.js: view switching: hide view.$containerAaron Bohy
Without hidding view.$container, when coming back to Kanban or List views, it was no more possible to click anywhere on those views. Fixes the bug introduced by rev c465605049bdce16621e4e5f57c52ebab23de813
2015-01-27[FIX] Web: views.js and view_pivot.js: sidebarAaron Bohy
The sidebar in view pivot was not hidden when switching from view pivot to another view. Thus, the sidebar content of view pivot was still in a dropdown of the sidebar of the new view (when this new view has a sidebar as well). Also changed the way of switching between views: we now first hide the current view before creating and displaying the new one. This prevents weird rendering in the header as well. Moreover, the task of hidding/showing the view's buttons is left to the view instead of the ViewManager.
2015-01-19[FIX] web: remove typo in views.jsGéry Debongnie
2015-01-16[FIX] web: fix breadcrumbs duplicate form viewsGéry Debongnie
and prevent the last breadcrumb to be clickable (revert of 61dec05). The last breadcrumb clickable to refresh the view is no longer necessary with the form view icon available. The weird code on the click handler for switching views is due to the fact that most views refresh with a do_search but the form view is refreshed with a do_show. A more generic way to update the view seems necessary to prevent such artifacts.
2015-01-09[FIX] web: usability issue: display form view iconGéry Debongnie
form view icon should always be displayed in the view manager. This is useful in some situations: * switch to form view from editable list view * refresh a form view
2015-01-08[REM] modelines: Gotta catch 'em allRichard Mathot
2014-12-30[FIX] web: fix various syntax problems in views.jsGéry Debongnie
linting views.js revealed some problems. Most of them minor, but some of them more serious: redeclared variables in if clauses can shadow the outer variable, or not. It is fragile, and will cause bugs if the code is refactored.
2014-12-30[FIX] web: makes last breadcrumb item clickableGéry Debongnie
clicking on last breadcrumb item should reload the current view
2014-12-22[FIX] web: correctly show/hide container divValentin Lab
view manager should hide/show divs even if you don't have a controller set.
2014-12-19[FIX] web: clicking on view buttons now refresh viewGéry Debongnie
clicking on a view button should load the view, even if it is the active view.
2014-12-19[IMP] web: new pivot view, full rewrite of graph viewGéry Debongnie
This commit is a split of the former graphview into a pivot view (the tabular view) and graph view (the various charts). The code was fully rewritten. * pivot view should be faster (better underlying data structure and better algorithm) * better integration with the web client (use of sidebar, of menu buttons, bettor style) * new feature: pivot view can be sorted * new feature: pivot view cells can be clicked to open a list view with the corresponding domain * web_graph addon was removed, and the graph view code has been moved to the addon web. * the interaction with the searchbar was changed (no more column facet) * better and simpler code for graph view * mary corner cases in graph charts have been corrected (for ex, pie chart with positive and negative numbers) * graph/pivot correctly save their state when added to dashboard/saved (state such as current measure, chart mode, column groupbys, ...)
2014-12-19[IMP] web: add fade in effect when switching viewsGéry Debongnie
2014-12-11[FIX] web: add missing icon, add warning, fix deferredGéry Debongnie
* 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-02[FIX] fix reloading problem (crash) in web clientGéry Debongnie
The previous viewmanager (before its refactoring in sept/oct 2014) was ignoring some promises in its do_load_state method. The refactoring actually fixed that, but of course, some other code was dependent on the broken implementation. This commit removes the use of promises in do_load_state, which is functionally equivalent to the previous code. As a result, it relies on some subtle timing of the creation and initialization of various views. It is somewhat fragile, but it is actually what the former code did, only in a more explicit way.
2014-11-20[FIX] update tests and change search logic (webclient)Géry Debongnie
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[FIX] web client fix: crash when loading translationGéry Debongnie
Problem happens when the user from the website tries to load a translation, it opens up a modal window without an action. But the modal has a (hidden) searchview which tries to load custom filters corresponding to that non-existing action. Another problem at the same time was that the view manager could not display the breadcrumbs for a non-existing breadcrumb.
2014-11-06[IMP] various improvements to the action manager (web client)Géry Debongnie
* add a replace_breadcrumb option to actionmanager * correctly calls on_reverse_breadcrumbs when needed * add a semi-protected way to manipulate breadcrumbs (get_widgets) * calls do_show when changing widgets
2014-11-05[MERGE] forward port of branch 8.0 up to 491372eChristophe Simonis
2014-11-04[MERGE] forward port of branch saas-3 up to f7a76cbDenis Ledoux
2014-11-04[MERGE] forward port of branch 7.0 up to be7c894Denis Ledoux
2014-11-04[FIX] web: keep pager in popup list viewMartin Trigaux
When an action opens records in list (or other) mode in a popup (target:new), the pager should be kept. It can be removed in form view. Fixes #742
2014-11-04[FIX] readd get_view_id to viewmanager (webclient)Géry Debongnie
it was removed in the refactoring of the action/viewmanager, but somehow was not readded. This is now done, and should prevent a few crashes.
2014-10-31[IMP] display breadcrumbs content in browser tabsGéry Debongnie
this change is simple, except that many actions display a form view in 'create' mode to edit some stuff (for example, most settings forms or the 'Your session' action in point of sale). As a work around, we use a simple heuristic (nice word for horrible hack): the title displayed is the title of the action if we have a single form view.
2014-10-31[FIX] fixes modal window layout bugs (addon web)Géry Debongnie
2014-10-29[FIX] correct a layout issue in viewmanager (webclient)Géry Debongnie
problem was that the pager was not displayed/hidden at the correct moment Result is that when switching views, the header sometimes takes an extra line. The pager is now hidden just before creating the view
2014-10-29[FIX] make sure that breadcrumbs are generic (web client)Géry Debongnie
breadcrumbs incorrectly assumed that they were made with views inside viewmanagers. But client actions can be used in breadcrumbs, so the action manager should play nice with these widgets.
2014-10-29[FIX] properly destroy client widgets (web client)Géry Debongnie
The new action manager only destroyed viewmanager widgets instead of any old widget. It now checks for the widget class. Also, minor improvement to clear_widgets: vms used to stand for view_managers, but it can destroy any widget.
2014-10-29[IMP] change webclient structure: remove tableGéry Debongnie
This is a small change if measured in lines of code, but is a large change: it removes the table structure from the web client and use divs instead. It will likely break a lot of things (some css selectors will not work), but it should simplify our lives in the future: closer to being responsive, easier layout computations for the browsers (and hopefully less discrepencies between the results), simpler html, ...
2014-10-21[IMP] better variable/function names in action managerGéry Debongnie
2014-10-21[FIX] css and layout fix in advanced search viewGéry Debongnie
* make sure the searchbar allows text selection * revert back to col-md (from col-lg) classes => looks better
2014-10-21[IMP] xml, css and js tweaks in advanced search viewGéry Debongnie
2014-10-21[REM] remove instance.web.ViewManagerActionGéry Debongnie
ViewManager takes over all duties of ViewManagerAction, it can now be safely removed.
2014-10-21[IMP] various code improvementsGéry Debongnie
mostly styling, and related micro-changes