Skip to content

Commit

Permalink
[MIG] base_custome_filter: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AungKoKoLin1997 committed May 8, 2023
1 parent a4a6e1c commit 285a0a0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
10 changes: 5 additions & 5 deletions base_custom_filter/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Add custom filters in standard filters and group by dropdowns
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/15.0/base_custom_filter
:target: https://github.com/OCA/server-ux/tree/16.0/base_custom_filter
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-15-0/server-ux-15-0-base_custom_filter
:target: https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-base_custom_filter
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/250/15.0
:target: https://runbot.odoo-community.org/runbot/250/16.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -64,7 +64,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20base_custom_filter%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20base_custom_filter%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -110,6 +110,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-AshishHirapara| |maintainer-ForgeFlow|

This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/15.0/base_custom_filter>`_ project on GitHub.
This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/16.0/base_custom_filter>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion base_custom_filter/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Add custom filters in standard filters and group by dropdowns",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Usability",
"website": "https://github.com/OCA/server-ux",
"author": "Ashish Hirpara, ForgeFlow, Odoo Community Association (OCA)",
Expand Down
8 changes: 2 additions & 6 deletions base_custom_filter/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,9 @@ def _add_grouped_groupby(self, res, custom_groupbys):
return res

@api.model
def fields_view_get(
self, view_id=None, view_type="form", toolbar=False, submenu=False
):
def get_view(self, view_id=None, view_type="form", **options):
"""Add filters in search views."""
res = super().fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu
)
res = super().get_view(view_id=view_id, view_type=view_type, **options)
if view_type == "search":
filter_groups = self.env["ir.filters.group"].search(
[
Expand Down
3 changes: 1 addition & 2 deletions base_custom_filter/models/ir_filters_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ def unlink(self):

@api.model
def _list_all_models(self):
self._cr.execute("SELECT model, name FROM ir_model ORDER BY name")
return self._cr.fetchall()
return self.env["ir.filters"]._list_all_models()
6 changes: 3 additions & 3 deletions base_custom_filter/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Add custom filters in standard filters and group by dropdowns<
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-ux/tree/15.0/base_custom_filter"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-ux-15-0/server-ux-15-0-base_custom_filter"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/250/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-ux/tree/16.0/base_custom_filter"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-base_custom_filter"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/250/16.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows to define custom filters to be shown under the standard
filters and group by menus of a model’s search view.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -416,7 +416,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20base_custom_filter%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20base_custom_filter%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -447,7 +447,7 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/AshishHirapara"><img alt="AshishHirapara" src="https://github.com/AshishHirapara.png?size=40px" /></a> <a class="reference external" href="https://github.com/ForgeFlow"><img alt="ForgeFlow" src="https://github.com/ForgeFlow.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/15.0/base_custom_filter">OCA/server-ux</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/16.0/base_custom_filter">OCA/server-ux</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion base_custom_filter/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ def test_sale_order_line(self):
"base_custom_filter.field_ir_filters_group__name"
)

filters_group_obj.fields_view_get(view_type="search")
filters_group_obj.get_view(view_type="search")
filter_group.unlink()

0 comments on commit 285a0a0

Please sign in to comment.