3
0
Fork 0
Commit Graph

19 Commits (17b12abcbc3914de8fff9f8f7b7f9158b8b4ca58)

Author SHA1 Message Date
Weblate 56970eb241 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: web-12.0/web-12.0-web_view_searchpanel
Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_view_searchpanel/
2023-10-09 20:18:14 +00:00
OCA-git-bot 356621df21 [UPD] README.rst 2023-09-03 17:50:30 +00:00
Marcel Savegnago c93530940d Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (6 of 6 strings)

Translation: web-12.0/web-12.0-web_view_searchpanel
Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_view_searchpanel/pt_BR/
2021-03-15 06:45:53 +00:00
Marcel Savegnago ee4e8c3e9f Added translation using Weblate (Portuguese (Brazil)) 2021-03-15 04:06:28 +00:00
claudiagn 017a7db5f3 Translated using Weblate (Catalan)
Currently translated at 100.0% (6 of 6 strings)

Translation: web-12.0/web-12.0-web_view_searchpanel
Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_view_searchpanel/ca/
2021-02-17 13:45:27 +00:00
claudiagn 904aa60dfc Translated using Weblate (Spanish)
Currently translated at 100.0% (6 of 6 strings)

Translation: web-12.0/web-12.0-web_view_searchpanel
Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_view_searchpanel/es/
2021-02-17 13:45:27 +00:00
claudiagn 79ee2546fd Added translation using Weblate (Catalan) 2021-02-17 11:15:17 +00:00
claudiagn 98b41fb7c6 Added translation using Weblate (Spanish) 2021-02-17 11:00:09 +00:00
OCA-git-bot 5368e7a11d web_view_searchpanel 12.0.1.0.2 2021-02-12 10:03:19 +00:00
oca-travis 960a54006c [UPD] Update web_view_searchpanel.pot 2021-02-12 09:50:07 +00:00
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
OCA-git-bot 5362480ab0 web_view_searchpanel 12.0.1.0.1 2020-07-27 14:06:20 +00:00
Enric Tobella 6858c998f2
[FIX] web_view_searchpanel: Typo error on JS 2020-07-27 15:41:23 +02:00
OCA-git-bot 5b099ca76c [UPD] README.rst 2020-07-14 05:30:40 +00:00
OCA-git-bot e91957559d [UPD] README.rst 2020-07-13 05:30:37 +00:00
OCA-git-bot 58e264bdd3 [UPD] README.rst 2020-07-06 09:49:00 +00:00
oca-travis 9f7ed18a23 [UPD] Update web_view_searchpanel.pot 2020-07-06 09:39:28 +00:00
Enric Tobella f385402573
[MIG] web_view_searchpanel: from muk_web to OCA 2020-07-06 10:18:40 +02:00
MuK IT GmbH 1002138a45
publish muk_web_searchpanel - 12.0 2020-07-03 12:06:43 +02:00