summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/control_panel
AgeCommit message (Collapse)Author
2019-04-01[IMP] web: graph view improvementsMathieu Duckerts-Antoine
This commit extends the support of comparison mode for the graph view and refine the tooltips and rendering in line mode. The graph view code has also been slightly refactored. Task ID: 1946138
2019-03-13[MERGE] forward port branch saas-12.2 up to c9f832d9f03Christophe Simonis
closes odoo/odoo#31790 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-06[REF] web: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-27[FIX] web: correctly handle (no result) selection in searchMartin Geubelle
In the recent control panel refactoring, selecting '(no result)' (when using the autocomplete on a many2one for example) was no correctly handled and was leading to a traceback. It is now correctly handled and the search bar is correctly re-rendered. Task 1936745 closes odoo/odoo#31438
2019-02-26[FIX] web: search more in many2one: filter on idsAaron Bohy
Let's assume a many2one field with a lot of possible values. The user clicks on 'Search More...'. In the opened dialog, only 160 records are available (their ids have been obtained with a name_search, with the optional text the user could have typed in the many2one input). Before 4cd379cf, that extra domain on ids was removed automatically as soon as the user interacted with the search view in the dialog. This was especially useful when there were more than 160 records. However, this was rather an happy coincidence than a designed feature. From 4cd379cf, the ids selection was added to the initial domain of the list, so they couldn't be removed from the domain afterwards. The user was thus stucked with its preselected 160 records. This rev. doesn't restore the former behavior, but rather improves the current one, as follows: - when there is no text in the many2one input (i.e. no value to filter on), we bypass the name_search, s.t. all records are available in the dialog - when there is some text in the input, we perform a name_search (as before) to get a list of record ids, and we add a special filter to the search view in the dialog (the filter on those ids), s.t. the user can remove it if he wants to access the remaining records. - finally, the limit is now set to 320, to mitigate the problem Issue reported on the saas-12.1 migration pad. closes odoo/odoo#31232
2019-02-28[MERGE] forward port branch saas-12.1 up to f9d3b5b7dfeChristophe Simonis
2019-02-22[MERGE] forward port branch saas-12.1 up to 0f4abc5c228Christophe Simonis
2019-02-21[MERGE] forward port branch 12.0 up to 84143a34b31Christophe Simonis
2019-02-12[FIX] web: quotes and backslashes in search viewMathieu Duckerts-Antoine
The commit 6d3ada178f7caf6ea159b871648ca4c440c7845b aimed to solve problems occuring whith (single or double) quotes when creating new custom filters. Unfortunately, the point was missed and bugs were still present. The present commit solves the orginial problem satisfactorily. There was also a problem in the management of backslashes. Type '\\' in the search bar would lead to a domain like [('...', 'ilike', '\\\\\\\\\\\\\\\\')]. This has also been fixed. Note that it is necessary to input "\\" if one is looking for a backslash in db (as before). A remark on the _formatAST function (py_utils.js): We deescape only the chars `'`, `"`, and `\` because it does not seem possible to produce a string in the search view that would intend a search for a line return or a tab for example. A general remark: Domains should always be in normalized form. In that way they could be manipulated and combined together without a tokenization/parsing! closes odoo/odoo#29756
2019-02-15[FIX] web: control panel load/save filter sort paramLucas Perais (lpe)
Before this commit, the wrong semantics was implemented in the webclient concerning the "sort" char field in ir.filter Loading a filter with a sort with negative order made the webclient crash This field holds a JSON string, representing a list of field names If the order of the field is inverse, there should be a "-" before it for legacy purposes After this commit, the semantics have changed for consistency that is, at save time the sql notation is preferred We support the legacy notation too for backward compatibility closes odoo/odoo#31102
2019-02-13[IMP] web: add 'Last 5 Years' as a period optionPriyanka Kakadiya
This commit adds the option 'Last 5 Years' in the list of periods available to selection in the filter menu and the time range menu for the date/datetime fields. Task: 1916017 closes odoo/odoo#29423
2019-02-11[MERGE] forward port branch saas-12.1 up to 93d736e905eChristophe Simonis
2019-02-04[FIX] web: allow user to move cursor in search barGéry Debongnie
With the control panel refactoring, the auto_complete widget was set on a different target, which caused issues with the search bar: the event handlers for the search bar were triggered before the handlers for the auto_complete widget. With this commit, we make sure they are handled in the proper order. Also, a small piece of code that was supposed to check the position of the cursor was lost. closes odoo/odoo#30795
2019-02-01[IMP] web: control panel add on_detach_callbackRomeo Fragomeli
Adding event listener in on_attach_callback need to be removed in on_detach_callback. Before this commit on_detach_callback was not implemented in control panel. After this commit we can use on_detach_callback. Needed for task ID: 1934261 closes odoo/odoo#30758
2019-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
2019-01-31[FIX] web: allow back-end to be usable with IE11Vincent Schippefilt
IE11 does not support Array.filter, so I replaced it with _.filter closes odoo/odoo#30434
2019-01-30[FIX] web: reload view when pressing enter in search barGéry Debongnie
Before the control panel refactoring, whenever a user pressed ENTER in the search bar (with no text), the current view was reloaded. This untested behaviour was changed (not on purpose) with that refactoring: instead of reloading, the search view add a useless filter in the list of facets. We restore the previous behaviour in this commit. closes odoo/odoo#30503
2019-02-04[MERGE] forward port branch saas-12.1 up to 4524ad06a8aChristophe Simonis
2019-01-18[FIX] web, *: restore `context` key on search view fieldMartin Geubelle
Since the control panel refactoring, the `context` key on a `<field>` in the search view was ignored (like <field name='pricelist' context="{'pricelist': self}". The previous behaviour has been reintroduced and modified a little bit. For way too long, an ugly hack was used to get a numerical value in self. This ugly hack was still present but wasn't working since 8.0 (at least for the numerical value). A counter hack (see odoo/odoo@4a81e8a) was then applied to avoid really using a `selection` widget. To get even more confused, `self` was replaced by the *last* user-specified value. Well, it's time to clean this mess. Now, the `self` key is replaced by an array of user-specified values (by value, we mean the field value i.e. the `id` for a many2one, or the `key` for a selection field). Task 1902826 closes odoo/odoo#30368
2018-12-18[FIX] web: backspace in empty searchbar inputMartin Geubelle
Before this rev. a crash occurred when pressing backspace in the control panel view searchbar input if there was no facet to remove. The use case is now correctly handled and nothing happens. Task 1902826 closes odoo/odoo#29602
2018-12-17[FIX] web: handle `context` in ControlPanel <filter>Martin Geubelle
The `context` key wasn't correctly taken into account when computing the search query for `filter``tags. It is now correctly handled. Task 1917628 closes odoo/odoo#29529
2018-12-11[FIX] web: do not render invisible filters in search viewGéry Debongnie
In some cases, the web client may receive a search view with invisible filters. This is due to the way field_view_get works. For example, if there is a group on a filter, then this will be transformed into an invisible attribute. In that case, the search view should simply ignore the filter and not display it. This was broken in the recent control panel refactoring (note that the search view lacked the possibility of testing that kind of situation). closes odoo/odoo#29430
2018-12-07[REF] web: move ControlPanel inside controllers/actionsGéry Debongnie
This branch introduces a large-scale reorganization of the component tree generated by the web client. The short version is that now, the control panel is a child of the view controller and no longer a sibling. Graphically (and simplified), we go from this: webClient / | \ ... ... actionManager / \ controlPanel viewController / \ to this: webClient / | \ ... ... actionManager | viewController / | \ ControlPanelController / \ CPRenderer CPModel The motivation is that this work moves the code where it should be. Before this commit, it was kind of weird to have code in the controllers to render buttons outside of their root node (in renderButtons). Also, the action manager had to take care of coordinating search view states between view transitions. So, this work simplifies the code. It also makes it easier to extend. We see day after day that Odoo needs to take care of more complex UI needs, and in many cases, these needs were quite difficult to implement (we prefer spaghettis in our plates, not in our code). The changes in this branch should open the way to implement these features. For example, - it will now be easy to add the possibility of views (for example, the search view or a new ControlPanel view) to add custom buttons (of type action or object) in the control panel. - Another need will be to serialize/ restore the state of the search view across action boundaries (needed by the dashboard). - Another example is the possibility for views to customize easily the presence/absence of sub menus (filters/groupbys/favorites/ time range/...) - Another need is an easier way for views/client action to customize their control panel. This commit also contains a large rewrite of the search view (so it is more inline with our architecture and easier to maintain). Part of task 1893568 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com>
2019-01-28[MERGE] forward port branch saas-12.1 up to d3b8422c9c4Christophe Simonis
closes odoo/odoo#30614
2019-01-09[MERGE] forward port branch saas-12.1 up to 8aa8548d8abChristophe Simonis
2019-01-06[FIX] web: do not render invisible filters in search viewGéry Debongnie
In some cases, the web client may receive a search view with invisible filters. This is due to the way field_view_get works. For example, if there is a group on a filter, then this will be transformed into an invisible attribute. In that case, the search view should simply ignore the filter and not display it. This was broken in the recent control panel refactoring (note that the search view lacked the possibility of testing that kind of situation). closes odoo/odoo#29430 cherry-pick of 13aae100e2bc0589e2313fd4105b39c0eeea4db0 closes odoo/odoo#29965
2018-12-11[FIX] *: JS doc/docstring errors & warningsXavier Morel
closes odoo/odoo#29439