| Age | Commit message (Collapse) | Author |
|
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
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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.
|
|
|
|
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
|
|
actions can be defined by a function, but the action manager was changed
to try to instantiate it instead of simply executing it.
|
|
history_back it always redirect to home page, instead of previous view
|
|
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.
|
|
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).
|
|
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
|
|
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.
|
|
|
|
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.
|
|
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
|
|
|
|
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.
|
|
clicking on last breadcrumb item should reload the current view
|
|
view manager should hide/show divs even if you don't have a controller set.
|
|
clicking on a view button should load the view, even if it is the
active view.
|
|
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, ...)
|
|
|
|
* 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
|
|
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.
|
|
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.
|
|
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.
|
|
* 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
|
|
|
|
|
|
|
|
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
|
|
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.
|
|
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.
|
|
|
|
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
|
|
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.
|
|
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.
|
|
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, ...
|
|
|
|
* make sure the searchbar allows text selection
* revert back to col-md (from col-lg) classes => looks better
|
|
|
|
ViewManager takes over all duties of ViewManagerAction, it can now be
safely removed.
|
|
mostly styling, and related micro-changes
|