summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/control_panel/control_panel_tests.js
AgeCommit message (Collapse)Author
2020-07-31[FIX] web: default operators for search fieldsMathieu Duckerts-Antoine
During the refactoring of the control panel (https://github.com/odoo/odoo/pull/41268) a regression concerning the operator used for the fields set as search_default was introduced: the default operator was fixed to '=' while it would have been necessary to take into consideration the optional 'operator' attribute or the field types. Moreover, the default operator associated to many2one fields when using autocompletion was also mistakenly set to 'ilike' instead of '='. The present commit restores the previous behavior. closes odoo/odoo#55099 X-original-commit: 1f8e93fc590a6c7ef6b93953058f2dcd643ac620 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Julien Mougenot <jum@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-23[IMP] *: adapt tests to Owl search panelJulien Mougenot
Adaptation of the tests to the changes regarding the refactored search panel and model. Part of task 2228968 Co-authored-by: Julien Mougenot <jum@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-06[FIX] web: do no try to render filters referencing access restricted fieldsXavier ALT
In case a field is limited to specific groups on the model, those fields are discarded from `fields_view_get()` but can still be referenced by some filters on the search view causing a traceback (see #53797) Model: ```python class MyModel(models.Model): my_field = fields.Char(groups='base.group_system') ``` Search views: ```xml <search string="My Model"> <filter name="group_myfield" context="{'group_by': 'my_field'}"/> </search> ``` This commit ensure those filter are correctly discarded. OPW-2284621 closes odoo/odoo#54112 X-original-commit: b3452a1863c36290b13e16161e2703d9a3737f0e Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-25[FIX] web: in search view, use modifiers to determine if filter is invisibleXavier ALT
In search view, the "invisible" attribute can use complex expression, and so we must rely on the "modifiers" attribute set by the ir.ui.view post-processing to determine if a filter should be invisible or not. For example, considering the context {'hide_myfilter': False}, the following view: ```xml <search> ... <filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"/> ... </search> ``` Will be returned as such by the server: ```xml <search> ... <filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')" modifiers="{&quot;invisible&quot;: false}"/> ... </search> ``` After this commit, the filter "myfilter" will correctly be shown. OPW-2243639 closes odoo/odoo#53690 X-original-commit: 00969326e24dadd9b3f6e026789a1e575dd1c8dc Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Signed-off-by: Julien Mougenot (jum) <jum@odoo.com> Signed-off-by: Xavier ALT <xavieralt@users.noreply.github.com>
2020-05-11[FIX] web: do not use groupbys in views not groupableMohammed Shekha
Before this commit: A problem occurs with kanban views that are not groupable (i.e. for which searchMenuTypes does not contain 'groupBy'): if the action has a default groupby (set in Studio for instance) then it is still applied and causes crashes. That happens in the documents kanban view for instance. More generally, if a view is not groupable, some information on groupbys can appear in the interface (in a facet) while not used/useful for the view. After this commit: - if a kanban view is not groupable, a default groupby will never be applied. - if a view is not groupable, we ensures that - the search query generated in the control panel has groupBy = [], - groupbys cannot be represented in a facet. closes odoo/odoo#51041 X-original-commit: 91c80291e90127792623476d8997fd2a67569170 Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-03-13[REF] web: Control panel testsJulien Mougenot
Use of the new helpers in control panel (and subcomponents) tests and addition of new tests. Part of task 2196029 Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>