From e04a1699622de38fc4360719abfefb536f003733 Mon Sep 17 00:00:00 2001 From: shashikala1998 Date: Fri, 15 Nov 2024 18:54:12 +0530 Subject: [PATCH 1/5] [ADD] spp_custom_farmer_registry --- spp_custom_filter_farmer_registry/README.rst | 116 +++++ spp_custom_filter_farmer_registry/__init__.py | 1 + .../__manifest__.py | 12 + .../spp_custom_filter_farmer_registry.pot | 59 +++ .../models/__init__.py | 1 + .../models/res_partner.py | 17 + .../pyproject.toml | 3 + .../readme/DESCRIPTION.md | 35 ++ .../static/description/index.html | 456 ++++++++++++++++++ spp_farmer_registry_demo/models/farm.py | 2 +- spp_farmer_registry_demo/models/farmer.py | 4 +- 11 files changed, 703 insertions(+), 3 deletions(-) create mode 100644 spp_custom_filter_farmer_registry/README.rst create mode 100644 spp_custom_filter_farmer_registry/__init__.py create mode 100644 spp_custom_filter_farmer_registry/__manifest__.py create mode 100644 spp_custom_filter_farmer_registry/i18n/spp_custom_filter_farmer_registry.pot create mode 100644 spp_custom_filter_farmer_registry/models/__init__.py create mode 100644 spp_custom_filter_farmer_registry/models/res_partner.py create mode 100644 spp_custom_filter_farmer_registry/pyproject.toml create mode 100644 spp_custom_filter_farmer_registry/readme/DESCRIPTION.md create mode 100644 spp_custom_filter_farmer_registry/static/description/index.html diff --git a/spp_custom_filter_farmer_registry/README.rst b/spp_custom_filter_farmer_registry/README.rst new file mode 100644 index 000000000..649206c07 --- /dev/null +++ b/spp_custom_filter_farmer_registry/README.rst @@ -0,0 +1,116 @@ +===================================== +OpenSPP Custom Filter Farmer Registry +===================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:dd00856445c395a846d81f4165af1980684728e1abf2e25e82ede60c05cad815 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OpenSPP%2Fopenspp--modules-lightgray.png?logo=github + :target: https://github.com/OpenSPP/openspp-modules/tree/17.0/spp_custom_filter_farmer_registry + :alt: OpenSPP/openspp-modules + +|badge1| |badge2| |badge3| + +OpenSPP Custom Filter Farmer Registry +===================================== + +Overview +-------- + +The **SPP Custom Filter Farmer Registry** module customizes the user interface (UI) +for filtering in specific OpenSPP modules, enhancing usability and +simplifying data management. It builds upon the +`spp_custom_filter_farmer_registry `__ module, which +provides the underlying functionality for controlling which fields are displayed in +filter dropdown menus. + +This module is specifically designed to customize the filtering UI for the **Res Partner** model, +which is widely used within OpenSPP to represent registrants. By selectively exposing only the +most relevant fields for filtering, the module seeks to streamline user workflows and enhance +the overall experience within the OpenSPP system. + +Purpose +------- + +The primary purpose of the **SPP Custom Filter Farmer Registry** module is to: + +- **Enhance Usability**: Simplify the filtering process for users by presenting a more focused + and relevant set of filterable fields, minimizing visual clutter and reducing cognitive overload. +- **Improve Efficiency**: Enable users to find and filter data more quickly and efficiently, + especially when working with models that contain a large number of fields. +- **Customize UI for OpenSPP**: Customize the filtering UI to align with the + specific data structures and user workflows within the OpenSPP platform. + +Module Dependencies and Integration +----------------------------------- + +1. `spp_custom_filter_ui `__: This module directly + depends on the **SPP Custom Filter Farmer Registry** module, inheriting + its core functionality for managing the visibility of fields in filter + dropdown menus. The **SPP Custom Filter Farmer Registry** module leverages this capability + to configure the UI for specific models. + +2. `spp_base `__: This module utilizes functionalities from the **OpenSPP Base** module + +3. `spp_farmer_registry_base `__: The module interacts with the + **OpenSPP Farmer Registry Base** module + +4. `spp_mis_demo `__: The module interacts with the **OpenSPP Demo** module + +Additional Functionality +------------------------ + +-The **OpenSPP Custom Filter Farmer Registry"** module provides the following additional +functionality: + +-**UI Configuration for Res Partner**: The module specifically customizes the filter UI for +the **Res Partner** model, which is central to OpenSPP's registrant management system. +It selectively enables the "Show on Custom Filter" option for relevant fields within this model, +ensuring that only those fields appear in the filter dropdown menus. + + +Conclusion +---------- + +The **OpenSPP Custom Filter Farmer Registry"** module plays a vital role in enhancing the +usability and efficiency of the OpenSPP platform. By customizing the filtering UI for key +models like *Res Partner*, it streamlines data management tasks, especially for users working +with registrant information in the context of social protection programs. Its seamless integration +with other core OpenSPP modules ensures a cohesive and user-centric experience across the platform. + + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Credits +======= + +Authors +------- + +* OpenSPP.org + +Maintainers +----------- + +Current maintainer: + +This module is part of the `OpenSPP/openspp-modules `_ project on GitHub. + +You are welcome to contribute. diff --git a/spp_custom_filter_farmer_registry/__init__.py b/spp_custom_filter_farmer_registry/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/spp_custom_filter_farmer_registry/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/spp_custom_filter_farmer_registry/__manifest__.py b/spp_custom_filter_farmer_registry/__manifest__.py new file mode 100644 index 000000000..f56689281 --- /dev/null +++ b/spp_custom_filter_farmer_registry/__manifest__.py @@ -0,0 +1,12 @@ +{ + "name": "OpenSPP Custom Filter Farmer Registry", + "category": "OpenSPP", + "version": "17.0.1.0.0", + "summary": "Customizes the OpenSPP UI to enhance filtering for Farmer Registry, improving usability and efficiency in managing registrants within social protection programs.", + "author": "OpenSPP.org", + "website": "https://github.com/OpenSPP/openspp-modules", + "license": "LGPL-3", + "depends": ["spp_custom_filter_ui", "spp_base", "spp_farmer_registry_base"], + "auto_install": False, + "application": False, +} diff --git a/spp_custom_filter_farmer_registry/i18n/spp_custom_filter_farmer_registry.pot b/spp_custom_filter_farmer_registry/i18n/spp_custom_filter_farmer_registry.pot new file mode 100644 index 000000000..92c9ef839 --- /dev/null +++ b/spp_custom_filter_farmer_registry/i18n/spp_custom_filter_farmer_registry.pot @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * spp_custom_filter_farmer_registry +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: spp_custom_filter_farmer_registry +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_g2p_program_membership__tags_ids +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_partner__tags_ids +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_users__tags_ids +msgid "Registrant Tags" +msgstr "" + +#. module: spp_custom_filter_farmer_registry +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_g2p_program_membership__farmer_national_id +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_partner__farmer_national_id +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_users__farmer_national_id +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_spp_farmer__farmer_national_id +msgid "National ID Number" +msgstr "" + +#. module: spp_custom_filter_farmer_registry +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_g2p_program_membership__farmer_postal_address +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_partner__farmer_postal_address +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_users__farmer_postal_address +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_spp_farmer__farmer_postal_address +msgid "Postal Address" +msgstr "" + +#. module: spp_custom_filter_farmer_registry +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_g2p_program_membership__marital_status +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_partner__marital_status +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_users__marital_status +msgid "Marital Status" +msgstr "" + +#. module: spp_custom_filter_farmer_registry +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_g2p_program_membership__highest_education_level +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_partner__highest_education_level +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_users__highest_education_level +msgid "Highest Educational Level" +msgstr "" + +#. module: spp_custom_filter_farmer_registry +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_g2p_program_membership__farmer_household_size +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_partner__farmer_household_size +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_res_users__farmer_household_size +#: model:ir.model.fields,field_description:spp_custom_filter_farmer_registry.field_spp_farmer__farmer_household_size +msgid "Farmer Household Size" +msgstr "" diff --git a/spp_custom_filter_farmer_registry/models/__init__.py b/spp_custom_filter_farmer_registry/models/__init__.py new file mode 100644 index 000000000..91fed54d4 --- /dev/null +++ b/spp_custom_filter_farmer_registry/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/spp_custom_filter_farmer_registry/models/res_partner.py b/spp_custom_filter_farmer_registry/models/res_partner.py new file mode 100644 index 000000000..3b26aba02 --- /dev/null +++ b/spp_custom_filter_farmer_registry/models/res_partner.py @@ -0,0 +1,17 @@ +from odoo import fields, models + + +class ResPartner(models.Model): + _name = "res.partner" + _inherit = ["res.partner", "custom.filter.mixin"] + + tags_ids = fields.Many2many("g2p.registrant.tags", allow_filter=True) + farmer_national_id = fields.Char(allow_filter=True) + farmer_postal_address = fields.Char(allow_filter=True) + marital_status = fields.Selection(allow_filter=True) + highest_education_level = fields.Selection(allow_filter=True) + household_size = fields.Integer(allow_filter=True) + z_cst_indv_medical_condition = fields.Integer(allow_filter=True) + z_ind_grp_is_single_head_hh = fields.Boolean(allow_filter=True) + z_ind_grp_is_hh_with_medical_condition = fields.Boolean(allow_filter=True) + z_ind_grp_is_hh_with_children = fields.Boolean(allow_filter=True) diff --git a/spp_custom_filter_farmer_registry/pyproject.toml b/spp_custom_filter_farmer_registry/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/spp_custom_filter_farmer_registry/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/spp_custom_filter_farmer_registry/readme/DESCRIPTION.md b/spp_custom_filter_farmer_registry/readme/DESCRIPTION.md new file mode 100644 index 000000000..712817b12 --- /dev/null +++ b/spp_custom_filter_farmer_registry/readme/DESCRIPTION.md @@ -0,0 +1,35 @@ +# OpenSPP Custom Filter Farmer Registry + +## Overview + +The **OpenSPP Custom Filter Farmer Registry"** module customizes the user interface (UI) for filtering in specific OpenSPP modules, enhancing usability and simplifying data management. It builds upon the [spp_custom_filter UI](spp_custom_filter_ui) module, which provides the underlying functionality for controlling which fields are displayed in filter dropdown menus. + +This module is designed to tailor the filtering interface for the Res Partner model, which is widely utilized within OpenSPP to represent registrants. By selectively exposing relevant fields for filtering, the module aims to streamline user workflows and enhance the overall user experience within the OpenSPP system. + +## Purpose + +The primary purpose of the **SPP Custom Filter Farmer Registry** module is to: + +* **Enhance Usability**: Simplify the filtering process for users by presenting a more focused and relevant set of filterable fields, minimizing visual clutter and reducing cognitive overload. +* **Improve Efficiency**: Enable users to find and filter data more quickly and efficiently, especially when working with models that contain a large number of fields. +* **Customize UI for OpenSPP**: Customize the filtering UI to align with the specific data structures and user workflows within the OpenSPP platform. + +## Module Dependencies and Integration + +1. **[spp_custom_filter UI](spp_custom_filter_ui)**: This module directly depends on the **SPP Custom Filter UI** module, inheriting its core functionality for managing the visibility of fields in filter dropdown menus. The **SPP Custom Filter UI** module leverages this capability to configure the UI for specific models. + +2. **[OpenSPP Base](spp_base)**: This module utilizes functionalities from the **OpenSPP Base** module + +3. **[OpenSPP Farmer Registry Base](spp_farmer_registry_base)**: The module interacts with the **OpenSPP Farmer Registry Base** module + +4. **[OpenSPP Demo](spp_mis_demo)**: The module interacts with the **OpenSPP Demo** module + +## Additional Functionality + +The **OpenSPP Custom Filter Farmer Registry** module provides the following additional functionality: + +* **UI Configuration for Res Partner**: The module specifically customizes the filter UI for the **Res Partner** model, which is central to OpenSPP's registrant management system. It selectively enables the "Show on Custom Filter" option for relevant fields within this model, ensuring that only those fields appear in the filter dropdown menus. + +## Conclusion + +The **OpenSPP Custom Filter Farmer Registry"** module plays a vital role in enhancing the usability and efficiency of the OpenSPP platform. By customizing the filtering UI for key models like *Res Partner*, it streamlines data management tasks, especially for users working with registrant information in the context of social protection programs. Its seamless integration with other core OpenSPP modules ensures a cohesive and user-centric experience across the platform. diff --git a/spp_custom_filter_farmer_registry/static/description/index.html b/spp_custom_filter_farmer_registry/static/description/index.html new file mode 100644 index 000000000..bf069c27c --- /dev/null +++ b/spp_custom_filter_farmer_registry/static/description/index.html @@ -0,0 +1,456 @@ + + + + + +OpenSPP Custom Filter Farmer Registry + + + +
+

OpenSPP Custom Filter Farmer Registry

+ + +

Beta License: LGPL-3 OpenSPP/openspp-modules

+
+

OpenSPP Custom Filter Farmer Registry

+
+

Overview

+

The OpenSPP Custom Filter Farmer Registrymodule customizes the user interface (UI) +for filtering in specific OpenSPP modules, enhancing usability and simplifying data management. It builds upon +the SPP Custom Filter Farmer Registry module, which provides the underlying functionality for controlling which +fields are displayed in filter dropdown menus +

+

This module is designed to tailor the filtering interface for the Res Partner model, which is widely utilized +within OpenSPP to represent registrants. By selectively exposing relevant fields for filtering, the module aims +to streamline user workflows and enhance the overall user experience within the OpenSPP system. +

+
+
+

Purpose

+

The primary purpose of the SPP Custom Filter Farmer Registry module is to:

+
    +
  • Enhance Usability: Simplify the filtering process for users by presenting a +more focused and relevant set of filterable fields, minimizing visual clutter and reducing cognitive overload.
  • +
  • Improve Efficiency: Enable users to find and filter data more quickly and efficiently, +especially when working with models that contain a large number of fields.
  • +
  • Customize UI for OpenSPP: Customize the filtering UI to align with the specific data +structures and user workflows within the OpenSPP platform. +
  • +
+
+
+

Module Dependencies and Integration

+
    +
  1. spp_custom_filter_ui: This module directly +depends on the SPP Custom Filter UI module, inheriting its core +functionality for managing the visibility of fields in filter +dropdown menus. The SPP Custom Filter UI module leverages this +capability to configure the UI for specific models.
  2. +
  3. spp_base: This module utilizes +functionalities from the OpenSPP Base module
  4. +
  5. spp_farmer_registry_base: The module interacts with +the OpenSPP Farmer Registry Base module
  6. +
  7. spp_mis_demo: The module interacts with +the OpenSPP Demo module
  8. +
+
+
+

Additional Functionality

+

The OpenSPP Custom Filter Farmer Registry module provides the following additional +functionality:

+
    +
  • UI Configuration for Res Partner: The module specifically +customizes the filter UI for the Res Partner model, which is +central to OpenSPP’s registrant management system. It selectively +enables the “Show on Custom Filter” option for relevant fields within +this model, ensuring that only those fields appear in the filter +dropdown menus.
  • +
+
+
+

Conclusion

+

The OpenSPP Custom Filter Farmer Registry module plays a vital role in enhancing the usability +and efficiency of the OpenSPP platform. By customizing the filtering UI for key models like Res Partner, +it streamlines data management tasks, especially for users working with registrant information in the context of +social protection programs. Its seamless integration with other core OpenSPP modules ensures a cohesive and +user-centric experience across the platform.

+

Table of contents

+
+
+
+

Credits

+
+

Authors

+
    +
  • OpenSPP.org
  • +
+
+
+

Maintainers

+

Current maintainer:

+

This module is part of the OpenSPP/openspp-modules project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/spp_farmer_registry_demo/models/farm.py b/spp_farmer_registry_demo/models/farm.py index 8af915d7e..fd42a46c5 100644 --- a/spp_farmer_registry_demo/models/farm.py +++ b/spp_farmer_registry_demo/models/farm.py @@ -4,4 +4,4 @@ class Farm(models.Model): _inherit = "res.partner" - household_size = fields.Integer() + household_size = fields.Integer(allow_filter=True) diff --git a/spp_farmer_registry_demo/models/farmer.py b/spp_farmer_registry_demo/models/farmer.py index dc0d020a5..9ecdca070 100644 --- a/spp_farmer_registry_demo/models/farmer.py +++ b/spp_farmer_registry_demo/models/farmer.py @@ -9,7 +9,7 @@ class Farmer(models.Model): ("married_monogamous", "Married Monogamous"), ("married_polygamous", "Married Polygamous"), ] - ) + , allow_filter=True) highest_education_level = fields.Selection( selection_add=[ ("none", "None"), @@ -19,7 +19,7 @@ class Farmer(models.Model): ("diploma", "Diploma"), ("university", "University"), ("tertiary", "Tertiary"), - ], + ], allow_filter=True ) From 8cc2eb9308fa48e39ba84f554d9cb3b10174a5a5 Mon Sep 17 00:00:00 2001 From: shashikala1998 Date: Tue, 19 Nov 2024 11:04:24 +0530 Subject: [PATCH 2/5] [IMP]spp_custom_filter_farmer_registry: filter --- spp_base/__manifest__.py | 1 + spp_base/models/registrant.py | 2 +- spp_custom_filter_farmer_registry/README.rst | 6 +----- spp_custom_filter_farmer_registry/__manifest__.py | 2 +- spp_custom_filter_farmer_registry/models/res_partner.py | 6 ------ spp_custom_filter_farmer_registry/readme/DESCRIPTION.md | 6 +----- .../static/description/index.html | 4 ---- spp_farmer_registry_demo/__manifest__.py | 1 + spp_mis_demo/__manifest__.py | 1 + spp_mis_demo/models/group.py | 3 +++ spp_mis_demo/models/individual.py | 2 +- 11 files changed, 11 insertions(+), 23 deletions(-) diff --git a/spp_base/__manifest__.py b/spp_base/__manifest__.py index 340b1eca5..50d8b4ade 100644 --- a/spp_base/__manifest__.py +++ b/spp_base/__manifest__.py @@ -28,6 +28,7 @@ "spp_hide_menus", "spp_programs", "spp_user_roles", + "spp_custom_filter_ui" ], "excludes": [ "spp_farmer_registry_base", diff --git a/spp_base/models/registrant.py b/spp_base/models/registrant.py index 37b09b1c0..cf3da67a3 100644 --- a/spp_base/models/registrant.py +++ b/spp_base/models/registrant.py @@ -9,5 +9,5 @@ class OpenSPPResPartner(models.Model): _inherit = "res.partner" - tags_ids = fields.Many2many("g2p.registrant.tags", string="Registrant Tags") + tags_ids = fields.Many2many("g2p.registrant.tags", string="Registrant Tags", allow_filter=True) kind_as_str = fields.Char(related="kind.name", string="String Kind") diff --git a/spp_custom_filter_farmer_registry/README.rst b/spp_custom_filter_farmer_registry/README.rst index 649206c07..49b8cd0e2 100644 --- a/spp_custom_filter_farmer_registry/README.rst +++ b/spp_custom_filter_farmer_registry/README.rst @@ -61,13 +61,9 @@ Module Dependencies and Integration dropdown menus. The **SPP Custom Filter Farmer Registry** module leverages this capability to configure the UI for specific models. -2. `spp_base `__: This module utilizes functionalities from the **OpenSPP Base** module - -3. `spp_farmer_registry_base `__: The module interacts with the +2. `spp_farmer_registry_base `__: The module interacts with the **OpenSPP Farmer Registry Base** module -4. `spp_mis_demo `__: The module interacts with the **OpenSPP Demo** module - Additional Functionality ------------------------ diff --git a/spp_custom_filter_farmer_registry/__manifest__.py b/spp_custom_filter_farmer_registry/__manifest__.py index f56689281..92eb272b3 100644 --- a/spp_custom_filter_farmer_registry/__manifest__.py +++ b/spp_custom_filter_farmer_registry/__manifest__.py @@ -6,7 +6,7 @@ "author": "OpenSPP.org", "website": "https://github.com/OpenSPP/openspp-modules", "license": "LGPL-3", - "depends": ["spp_custom_filter_ui", "spp_base", "spp_farmer_registry_base"], + "depends": ["spp_custom_filter_ui", "spp_farmer_registry_base"], "auto_install": False, "application": False, } diff --git a/spp_custom_filter_farmer_registry/models/res_partner.py b/spp_custom_filter_farmer_registry/models/res_partner.py index 3b26aba02..175bfd7b0 100644 --- a/spp_custom_filter_farmer_registry/models/res_partner.py +++ b/spp_custom_filter_farmer_registry/models/res_partner.py @@ -5,13 +5,7 @@ class ResPartner(models.Model): _name = "res.partner" _inherit = ["res.partner", "custom.filter.mixin"] - tags_ids = fields.Many2many("g2p.registrant.tags", allow_filter=True) farmer_national_id = fields.Char(allow_filter=True) farmer_postal_address = fields.Char(allow_filter=True) marital_status = fields.Selection(allow_filter=True) highest_education_level = fields.Selection(allow_filter=True) - household_size = fields.Integer(allow_filter=True) - z_cst_indv_medical_condition = fields.Integer(allow_filter=True) - z_ind_grp_is_single_head_hh = fields.Boolean(allow_filter=True) - z_ind_grp_is_hh_with_medical_condition = fields.Boolean(allow_filter=True) - z_ind_grp_is_hh_with_children = fields.Boolean(allow_filter=True) diff --git a/spp_custom_filter_farmer_registry/readme/DESCRIPTION.md b/spp_custom_filter_farmer_registry/readme/DESCRIPTION.md index 712817b12..3bccb44bf 100644 --- a/spp_custom_filter_farmer_registry/readme/DESCRIPTION.md +++ b/spp_custom_filter_farmer_registry/readme/DESCRIPTION.md @@ -18,11 +18,7 @@ The primary purpose of the **SPP Custom Filter Farmer Registry** module is to: 1. **[spp_custom_filter UI](spp_custom_filter_ui)**: This module directly depends on the **SPP Custom Filter UI** module, inheriting its core functionality for managing the visibility of fields in filter dropdown menus. The **SPP Custom Filter UI** module leverages this capability to configure the UI for specific models. -2. **[OpenSPP Base](spp_base)**: This module utilizes functionalities from the **OpenSPP Base** module - -3. **[OpenSPP Farmer Registry Base](spp_farmer_registry_base)**: The module interacts with the **OpenSPP Farmer Registry Base** module - -4. **[OpenSPP Demo](spp_mis_demo)**: The module interacts with the **OpenSPP Demo** module +2. **[OpenSPP Farmer Registry Base](spp_farmer_registry_base)**: The module interacts with the **OpenSPP Farmer Registry Base** module ## Additional Functionality diff --git a/spp_custom_filter_farmer_registry/static/description/index.html b/spp_custom_filter_farmer_registry/static/description/index.html index bf069c27c..63547eff7 100644 --- a/spp_custom_filter_farmer_registry/static/description/index.html +++ b/spp_custom_filter_farmer_registry/static/description/index.html @@ -405,12 +405,8 @@

Module Dependencies and Integration

functionality for managing the visibility of fields in filter dropdown menus. The SPP Custom Filter UI module leverages this capability to configure the UI for specific models. -
  • spp_base: This module utilizes -functionalities from the OpenSPP Base module
  • spp_farmer_registry_base: The module interacts with the OpenSPP Farmer Registry Base module
  • -
  • spp_mis_demo: The module interacts with -the OpenSPP Demo module
  • diff --git a/spp_farmer_registry_demo/__manifest__.py b/spp_farmer_registry_demo/__manifest__.py index b91cd99e5..89a0faa32 100644 --- a/spp_farmer_registry_demo/__manifest__.py +++ b/spp_farmer_registry_demo/__manifest__.py @@ -20,6 +20,7 @@ "spp_farmer_registry_default_ui", "spp_base_demo", "queue_job", + "spp_custom_filter_farmer_registry" ], "excludes": [ "spp_base", diff --git a/spp_mis_demo/__manifest__.py b/spp_mis_demo/__manifest__.py index e85a27e16..eea290614 100644 --- a/spp_mis_demo/__manifest__.py +++ b/spp_mis_demo/__manifest__.py @@ -28,6 +28,7 @@ "g2p_programs", "product", "stock", + "spp_custom_filter_ui" ], "external_dependencies": {"python": ["faker"]}, "data": [ diff --git a/spp_mis_demo/models/group.py b/spp_mis_demo/models/group.py index 0142c6ae4..12cda03e9 100644 --- a/spp_mis_demo/models/group.py +++ b/spp_mis_demo/models/group.py @@ -77,6 +77,7 @@ class G2PGroup(models.Model): compute="_compute_ind_grp_is_hh_with_children", store=True, recompute_daily=True, + allow_filter=True ) # z_ind_grp_is_hh_with_disabled = fields.Boolean("HHs with disabled (mental or physical) members", @@ -110,6 +111,7 @@ class G2PGroup(models.Model): compute="_compute_ind_grp_is_hh_with_medical_condition", help="HHs with members that have chronic illness/medical conditions", store=True, + allow_filter=True ) z_ind_grp_is_single_head_hh = fields.Boolean( @@ -117,6 +119,7 @@ class G2PGroup(models.Model): compute="_compute_ind_grp_is_single_head_hh", help="Single-headed HH - extracted from demographic data of " "HH adult members", store=True, + allow_filter=True ) z_ind_grp_is_woman_head_hh = fields.Boolean( "Is female-headed household", diff --git a/spp_mis_demo/models/individual.py b/spp_mis_demo/models/individual.py index 0623f46d2..431c98f1a 100644 --- a/spp_mis_demo/models/individual.py +++ b/spp_mis_demo/models/individual.py @@ -9,7 +9,7 @@ class G2PIndividual(models.Model): _inherit = "res.partner" - z_cst_indv_medical_condition = fields.Integer("chronic illness/medical conditions level") # 0-100 + z_cst_indv_medical_condition = fields.Integer("chronic illness/medical conditions level", allow_filter=True) # 0-100 z_cst_indv_disability_level = fields.Integer("Disability level") # 0-100 z_cst_indv_pregnancy_start = fields.Date("Pregnancy start") # We set a date to be able to clean it later z_cst_indv_lactation_start = fields.Date("Lactation start") # We set a date to be able to clean it later From 4338263523827467c7305690fccad68074ddcbc6 Mon Sep 17 00:00:00 2001 From: shashikala1998 Date: Tue, 19 Nov 2024 15:18:50 +0530 Subject: [PATCH 3/5] [FIX]spp_custom_filter_farmer_registry: dependency correction --- spp_custom_filter_farmer_registry/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spp_custom_filter_farmer_registry/__manifest__.py b/spp_custom_filter_farmer_registry/__manifest__.py index 92eb272b3..01ce30bae 100644 --- a/spp_custom_filter_farmer_registry/__manifest__.py +++ b/spp_custom_filter_farmer_registry/__manifest__.py @@ -6,7 +6,7 @@ "author": "OpenSPP.org", "website": "https://github.com/OpenSPP/openspp-modules", "license": "LGPL-3", - "depends": ["spp_custom_filter_ui", "spp_farmer_registry_base"], + "depends": ["spp_custom_filter", "spp_farmer_registry_base"], "auto_install": False, "application": False, } From 5dcfc82e8aa93c9de70d95c1e60f6fd2dc8256e2 Mon Sep 17 00:00:00 2001 From: shashikala1998 Date: Tue, 19 Nov 2024 15:32:56 +0530 Subject: [PATCH 4/5] [FIX] spp_farmer_registry_demo: pre commits --- spp_base/__manifest__.py | 2 +- spp_farmer_registry_demo/__manifest__.py | 2 +- spp_farmer_registry_demo/models/farmer.py | 8 +++++--- spp_mis_demo/__manifest__.py | 2 +- spp_mis_demo/models/group.py | 6 +++--- spp_mis_demo/models/individual.py | 4 +++- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/spp_base/__manifest__.py b/spp_base/__manifest__.py index 50d8b4ade..2270346a6 100644 --- a/spp_base/__manifest__.py +++ b/spp_base/__manifest__.py @@ -28,7 +28,7 @@ "spp_hide_menus", "spp_programs", "spp_user_roles", - "spp_custom_filter_ui" + "spp_custom_filter_ui", ], "excludes": [ "spp_farmer_registry_base", diff --git a/spp_farmer_registry_demo/__manifest__.py b/spp_farmer_registry_demo/__manifest__.py index 89a0faa32..f323779cd 100644 --- a/spp_farmer_registry_demo/__manifest__.py +++ b/spp_farmer_registry_demo/__manifest__.py @@ -20,7 +20,7 @@ "spp_farmer_registry_default_ui", "spp_base_demo", "queue_job", - "spp_custom_filter_farmer_registry" + "spp_custom_filter_farmer_registry", ], "excludes": [ "spp_base", diff --git a/spp_farmer_registry_demo/models/farmer.py b/spp_farmer_registry_demo/models/farmer.py index 9ecdca070..edc158693 100644 --- a/spp_farmer_registry_demo/models/farmer.py +++ b/spp_farmer_registry_demo/models/farmer.py @@ -8,8 +8,9 @@ class Farmer(models.Model): selection_add=[ ("married_monogamous", "Married Monogamous"), ("married_polygamous", "Married Polygamous"), - ] - , allow_filter=True) + ], + allow_filter=True, + ) highest_education_level = fields.Selection( selection_add=[ ("none", "None"), @@ -19,7 +20,8 @@ class Farmer(models.Model): ("diploma", "Diploma"), ("university", "University"), ("tertiary", "Tertiary"), - ], allow_filter=True + ], + allow_filter=True, ) diff --git a/spp_mis_demo/__manifest__.py b/spp_mis_demo/__manifest__.py index eea290614..6d79e1e91 100644 --- a/spp_mis_demo/__manifest__.py +++ b/spp_mis_demo/__manifest__.py @@ -28,7 +28,7 @@ "g2p_programs", "product", "stock", - "spp_custom_filter_ui" + "spp_custom_filter_ui", ], "external_dependencies": {"python": ["faker"]}, "data": [ diff --git a/spp_mis_demo/models/group.py b/spp_mis_demo/models/group.py index 12cda03e9..f47bee3b0 100644 --- a/spp_mis_demo/models/group.py +++ b/spp_mis_demo/models/group.py @@ -77,7 +77,7 @@ class G2PGroup(models.Model): compute="_compute_ind_grp_is_hh_with_children", store=True, recompute_daily=True, - allow_filter=True + allow_filter=True, ) # z_ind_grp_is_hh_with_disabled = fields.Boolean("HHs with disabled (mental or physical) members", @@ -111,7 +111,7 @@ class G2PGroup(models.Model): compute="_compute_ind_grp_is_hh_with_medical_condition", help="HHs with members that have chronic illness/medical conditions", store=True, - allow_filter=True + allow_filter=True, ) z_ind_grp_is_single_head_hh = fields.Boolean( @@ -119,7 +119,7 @@ class G2PGroup(models.Model): compute="_compute_ind_grp_is_single_head_hh", help="Single-headed HH - extracted from demographic data of " "HH adult members", store=True, - allow_filter=True + allow_filter=True, ) z_ind_grp_is_woman_head_hh = fields.Boolean( "Is female-headed household", diff --git a/spp_mis_demo/models/individual.py b/spp_mis_demo/models/individual.py index 431c98f1a..1d73a090f 100644 --- a/spp_mis_demo/models/individual.py +++ b/spp_mis_demo/models/individual.py @@ -9,7 +9,9 @@ class G2PIndividual(models.Model): _inherit = "res.partner" - z_cst_indv_medical_condition = fields.Integer("chronic illness/medical conditions level", allow_filter=True) # 0-100 + z_cst_indv_medical_condition = fields.Integer( + "chronic illness/medical conditions level", allow_filter=True + ) # 0-100 z_cst_indv_disability_level = fields.Integer("Disability level") # 0-100 z_cst_indv_pregnancy_start = fields.Date("Pregnancy start") # We set a date to be able to clean it later z_cst_indv_lactation_start = fields.Date("Lactation start") # We set a date to be able to clean it later From 9864708e0ddf0104902971d39f6b344a9636bb42 Mon Sep 17 00:00:00 2001 From: shashikala1998 Date: Tue, 19 Nov 2024 17:11:59 +0530 Subject: [PATCH 5/5] [IMP] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c48de648..18df05196 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -163,7 +163,7 @@ jobs: rm -rf /opt/odoo-venv/lib/python3.10/site-packages/odoo/addons/g2p_registry_individual/tests - name: Run SP-MIS tests env: - EXCLUDE: "fastapi,g2p_auth_id_oidc,g2p_auth_oidc,g2p_bank,g2p_bank_rest_api,g2p_change_log,g2p_disable_password_login,g2p_encryption,g2p_encryption_keymanager,g2p_encryption_rest_api,g2p_entitlement_differential,g2p_entitlement_in_kind,g2p_entitlement_voucher,g2p_enumerator,g2p_formio,g2p_mis_importer,g2p_mts,g2p_notifications_base,g2p_notifications_fast2sms,g2p_notifications_voucher,g2p_notifications_wiserv,g2p_odk_importer,g2p_odk_importer_program,g2p_odk_user_mapping,g2p_openid_vci,g2p_openid_vci_programs,g2p_openid_vci_rest_api,g2p_payment_cash,g2p_payment_files,g2p_payment_g2p_connect,g2p_payment_interop_layer,g2p_payment_phee,g2p_payment_simple_mpesa,g2p_portal_auth,g2p_profile_image,g2p_program_approval,g2p_program_assessment,g2p_program_autoenrol,g2p_program_cycleless,g2p_program_documents,g2p_program_registrant_info,g2p_program_reimbursement,g2p_programs,g2p_proxy_means_test,g2p_registry_addl_info,g2p_registry_base,g2p_registry_encryption,g2p_registry_group,g2p_registry_individual,g2p_registry_membership,g2p_registry_rest_api,g2p_service_provider_beneficiary_management,g2p_service_provider_portal_base,g2p_social_registry_importer,g2p_superset_dashboard,g2p_theme,mts_connector,muk_product,muk_web_appsbar,muk_web_chatter,muk_web_colors,muk_web_dialog,muk_web_theme,spp_user_roles,spp_change_request_add_farmer,spp_farmer_registry_base,spp_farmer_registry_dashboard,spp_farmer_registry_default_ui,spp_farmer_registry_demo" + EXCLUDE: "fastapi,g2p_auth_id_oidc,g2p_auth_oidc,g2p_bank,g2p_bank_rest_api,g2p_change_log,g2p_disable_password_login,g2p_encryption,g2p_encryption_keymanager,g2p_encryption_rest_api,g2p_entitlement_differential,g2p_entitlement_in_kind,g2p_entitlement_voucher,g2p_enumerator,g2p_formio,g2p_mis_importer,g2p_mts,g2p_notifications_base,g2p_notifications_fast2sms,g2p_notifications_voucher,g2p_notifications_wiserv,g2p_odk_importer,g2p_odk_importer_program,g2p_odk_user_mapping,g2p_openid_vci,g2p_openid_vci_programs,g2p_openid_vci_rest_api,g2p_payment_cash,g2p_payment_files,g2p_payment_g2p_connect,g2p_payment_interop_layer,g2p_payment_phee,g2p_payment_simple_mpesa,g2p_portal_auth,g2p_profile_image,g2p_program_approval,g2p_program_assessment,g2p_program_autoenrol,g2p_program_cycleless,g2p_program_documents,g2p_program_registrant_info,g2p_program_reimbursement,g2p_programs,g2p_proxy_means_test,g2p_registry_addl_info,g2p_registry_base,g2p_registry_encryption,g2p_registry_group,g2p_registry_individual,g2p_registry_membership,g2p_registry_rest_api,g2p_service_provider_beneficiary_management,g2p_service_provider_portal_base,g2p_social_registry_importer,g2p_superset_dashboard,g2p_theme,mts_connector,muk_product,muk_web_appsbar,muk_web_chatter,muk_web_colors,muk_web_dialog,muk_web_theme,spp_user_roles,spp_change_request_add_farmer,spp_farmer_registry_base,spp_farmer_registry_dashboard,spp_farmer_registry_default_ui,spp_farmer_registry_demo,spp_custom_filter_farmer_registry" run: oca_run_tests - name: Initialize farmer_registry db env: