Odoo web client UI related addons
 
 
 
 
 
Go to file
Dmytro Katyukha 2f5ddbfd08 [FIX] search_panel view: Do not apply model domain to comodel
Description
-----------

This commit fixes incorrect bechavior (error thrown) in case when
additional `domain` provided to action (`ir.actions.act_window`)
that displays view with search panel enabled.

Before this commit
------------------

For example we have following models:
- My Category
- My Model

And in category view, we have stat-button that display number of records
of records in this category. On click, it have to open view for My
Model, with domain like `[('category_id', '=', 42)]`.
In this case, following error will be raised:

```tracaback
Error:
Odoo Server Error

Traceback (most recent call last):
  ...
  File "/opt/odoo/custom_addons/web_view_searchpanel/models/base.py", line 60, in search_panel_select_range
    hierarchical_naming=False).search_read(model_domain, fields),
  File "/opt/odoo/odoo/odoo/models.py", line 4615, in search_read
    records = self.search(domain or [], offset=offset, limit=limit, order=order)
  File "/opt/odoo/odoo/odoo/models.py", line 1581, in search
    res = self._search(args, offset=offset, limit=limit, order=order, count=count)
  File "/opt/odoo/odoo/odoo/models.py", line 4147, in _search
    query = self._where_calc(args)
  File "/opt/odoo/odoo/odoo/models.py", line 3939, in _where_calc
    e = expression.expression(domain, self)
  File "/opt/odoo/odoo/odoo/osv/expression.py", line 673, in __init__
    self.parse()
  File "/opt/odoo/odoo/odoo/osv/expression.py", line 854, in parse
    raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))
ValueError: Invalid field 'category_id' in leaf "<osv.ExtendedLeaf: ('category_id', '=', 26) on bureaucrat_knowledge_category (ctx: )>"
```

Diagnostics
-----------

It seems that model domain was passed to comodel, thus system cannot
find field related to model in comodel. See code
(web_view_searchpanel/models/base.py", line 60, in
search_panel_select_range)

As tested, the `search_domain` causes this bug.

But if we look at implementation of same method
(`search_panel_select_range`) in Odoo 13.0 (see
[code](https://github.com/odoo/odoo/blob/13.0/addons/web/models/models.py#L214))
then we can see, that there is only empty domain applied for search.

Solution
--------

It seems, that variable `model_domain` could be simply removed, and
we could do the search in comodel without any extra domain in this case.

So, this commit, only makes imlementation of this method look same as in
Odoo 13.0

After this commit
-----------------

Everything is working fine.
2021-02-02 13:48:05 +02:00
setup [ADD] setup.py 2021-01-31 19:28:29 +00:00
web_action_conditionable web_action_conditionable 12.0.1.0.1 2020-12-14 21:38:22 +00:00
web_advanced_search Translated using Weblate (Danish) 2020-12-29 16:43:45 +00:00
web_advanced_search_wildcard Translated using Weblate (Spanish) 2020-07-23 14:19:48 +00:00
web_company_color Translated using Weblate (French) 2021-02-01 12:44:53 +00:00
web_decimal_numpad_dot Added translation using Weblate (Spanish) 2020-07-23 11:56:08 +00:00
web_dialog_size Translated using Weblate (French) 2021-02-01 12:44:53 +00:00
web_disable_browser_autocomplete web_disable_browser_autocomplete 12.0.1.0.1 2021-01-31 19:28:29 +00:00
web_disable_export_group Translated using Weblate (French) 2020-12-14 13:19:22 +00:00
web_drop_target web_drop_target 12.0.1.1.0 2020-08-12 10:46:14 +00:00
web_edit_user_filter Translated using Weblate (French) 2020-10-06 12:38:08 +00:00
web_editor_background_color [UPD] README.rst 2020-07-14 05:30:40 +00:00
web_environment_ribbon [UPD] README.rst 2020-07-14 05:30:40 +00:00
web_export_view Translated using Weblate (French) 2020-12-14 13:19:23 +00:00
web_favicon [UPD] README.rst 2020-07-14 05:30:40 +00:00
web_group_by_percentage Added translation using Weblate (Spanish) 2020-09-16 11:02:20 +00:00
web_group_expand Translated using Weblate (Spanish) 2020-09-16 14:00:07 +00:00
web_ir_actions_act_multi [UPD] README.rst 2020-11-10 16:38:31 +00:00
web_ir_actions_act_view_reload [UPD] README.rst 2020-11-10 16:38:31 +00:00
web_ir_actions_act_window_message [UPD] README.rst 2020-07-14 05:30:40 +00:00
web_ir_actions_close_wizard_refresh_view Added translation using Weblate (Spanish) 2020-07-23 12:01:22 +00:00
web_listview_range_select Added translation using Weblate (Spanish) 2020-07-23 12:27:47 +00:00
web_m2x_options Translated using Weblate (French) 2021-02-01 12:44:52 +00:00
web_no_bubble Added translation using Weblate (Spanish) 2020-09-16 11:16:11 +00:00
web_no_crawler Added translation using Weblate (Spanish) 2020-09-16 11:18:27 +00:00
web_notify Translated using Weblate (Spanish) 2020-09-16 14:00:06 +00:00
web_pivot_computed_measure Update translation files 2020-12-02 09:21:35 +00:00
web_pwa_oca web_pwa_oca 12.0.3.1.0 2021-01-21 11:16:03 +00:00
web_refresher Added translation using Weblate (Spanish) 2020-09-16 11:28:01 +00:00
web_responsive web_responsive 12.0.2.3.4 2021-02-02 08:35:28 +00:00
web_search_with_and Added translation using Weblate (Spanish) 2020-07-23 12:28:24 +00:00
web_searchbar_full_width Added translation using Weblate (Spanish) 2020-07-23 12:28:54 +00:00
web_send_message_popup Added translation using Weblate (Spanish) 2020-07-23 12:29:24 +00:00
web_set_single_page_hidden [ADD] icon.png 2020-12-04 15:15:49 +00:00
web_switch_context_warning Translated using Weblate (Spanish) 2020-07-23 14:19:49 +00:00
web_timeline Translated using Weblate (French) 2021-02-01 12:44:52 +00:00
web_translate_dialog Translated using Weblate (French) 2021-02-01 12:44:53 +00:00
web_tree_duplicate Translated using Weblate (French) 2021-02-01 12:44:53 +00:00
web_tree_dynamic_colored_field Added translation using Weblate (Spanish) 2020-07-23 13:41:35 +00:00
web_tree_image_tooltip Added translation using Weblate (Spanish) 2020-07-23 14:02:13 +00:00
web_tree_many2one_clickable Added translation using Weblate (Spanish) 2020-09-16 11:29:29 +00:00
web_tree_resize_column Added translation using Weblate (Spanish) 2020-09-16 11:29:47 +00:00
web_view_calendar_list [UPD] Update web_view_calendar_list.pot 2020-07-19 12:58:34 +00:00
web_view_searchpanel [FIX] search_panel view: Do not apply model domain to comodel 2021-02-02 13:48:05 +02:00
web_widget_bokeh_chart Added translation using Weblate (Spanish) 2020-09-16 11:30:07 +00:00
web_widget_color Added translation using Weblate (Spanish) 2020-08-06 09:44:25 +00:00
web_widget_digitized_signature Update translation files 2020-08-16 12:23:16 +00:00
web_widget_domain_editor_dialog [UPD] README.rst 2020-07-14 05:30:40 +00:00
web_widget_dropdown_dynamic [UPD] README.rst 2020-11-10 16:38:31 +00:00
web_widget_dropdown_dynamic_example [UPD] README.rst 2020-11-10 16:38:31 +00:00
web_widget_float_formula Added translation using Weblate (Catalan) 2021-01-20 19:09:32 +00:00
web_widget_image_download Translated using Weblate (Spanish) 2020-08-06 11:59:52 +00:00
web_widget_image_url Translated using Weblate (Spanish) 2020-08-06 11:59:52 +00:00
web_widget_image_webcam Translated using Weblate (Spanish) 2020-08-06 11:59:52 +00:00
web_widget_json_graph [UPD] Update web_widget_json_graph.pot 2020-12-01 08:57:41 +00:00
web_widget_many2many_tags_multi_selection Update translation files 2020-12-15 23:02:51 +00:00
web_widget_mermaid Translated using Weblate (French) 2021-02-01 12:44:53 +00:00
web_widget_model_viewer Translated using Weblate (Spanish) 2020-09-16 14:00:08 +00:00
web_widget_mpld3_chart Added translation using Weblate (Spanish) 2020-09-16 11:42:35 +00:00
web_widget_numeric_step web_widget_numeric_step 12.0.1.2.0 2020-12-30 08:10:16 +00:00
web_widget_one2many_product_picker web_widget_one2many_product_picker 12.0.1.4.0 2021-01-25 14:09:44 +00:00
web_widget_open_tab Translated using Weblate (Spanish) 2020-09-16 14:00:08 +00:00
web_widget_plotly_chart Added translation using Weblate (Spanish) 2020-09-16 11:46:23 +00:00
web_widget_timepicker [UPD] Update web_widget_timepicker.pot 2020-12-16 11:13:58 +00:00
web_widget_url_advanced [UPD] README.rst 2020-11-10 16:38:31 +00:00
web_widget_url_translatable Added translation using Weblate (Spanish) 2020-08-06 11:53:39 +00:00
web_widget_x2many_2d_matrix [UPD] README.rst 2020-11-10 16:38:31 +00:00
web_widget_x2many_2d_matrix_example Translated using Weblate (Spanish) 2020-09-28 13:00:15 +00:00
.editorconfig [ADD] .editorconfig [ci skip] 2019-11-19 21:18:33 +01:00
.gitignore [MIG] Add metafiles 2018-09-27 02:40:55 +02:00
.travis.yml [MIG] .travis.yml: Upgrade to Postgres 9.6 2018-10-01 09:31:42 +02:00
README.md [MIG] Add metafiles 2018-09-27 02:40:55 +02:00
requirements.txt add web_widget_mpld3_chart 2020-03-17 09:50:30 +01:00

README.md

Runbot Status Build Status Coverage Status

Web addons for Odoo

This project aims to deal with modules related to the webclient of Odoo. You'll find modules that:

  • Add facilities to the UI
  • Add widgets
  • Ease the import/export features
  • Generally add clientside functionality