forked from OpenG2P/openg2p-program
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,616 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": """OpenG2P Import: DCI API""", | ||
"summary": """RESTful API routes for OpenG2P""", | ||
"category": "", | ||
"version": "15.0.1.1.0", | ||
"author": "OpenG2P", | ||
"development_status": "Alpha", | ||
"external_dependencies": {"python": ["PyLD", "pyjwt>=2.4.0"]}, | ||
"website": "https://openg2p.org", | ||
"license": "LGPL-3", | ||
"depends": [ | ||
"base", | ||
"g2p_programs", | ||
"g2p_registry_base", | ||
"g2p_registry_individual", | ||
"spp_registry_data_source", | ||
], | ||
"data": [ | ||
"security/fetch_social_registry_security.xml", | ||
"security/ir.model.access.csv", | ||
"views/fetch_social_registry_beneficiary_views.xml", | ||
], | ||
"application": True, | ||
"auto_install": False, | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from . import individual | ||
from . import eligibility_manager | ||
from . import constants | ||
from . import fetch_social_registry_beneficiary | ||
from . import group | ||
from . import group_membership | ||
from . import imported_individuals | ||
from . import res_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
PREDICATE = "predicate" | ||
|
||
GRAPHQL = "graphql" | ||
|
||
OPERATION_MAPPING = { | ||
"=": "eq", | ||
">": "gt", | ||
"<": "lt", | ||
">=": "ge", | ||
"<=": "le", | ||
"in": "in", | ||
} | ||
|
||
FIELD_MAPPING = { | ||
"birthdate": "birthdate", | ||
"location": "birthplace", | ||
} | ||
|
||
DATA_SOURCE_NAME = "Social Registry" | ||
DATA_SOURCE_SEARCH_PATH_NAME = "Registry Sync Search" | ||
DATA_SOURCE_AUTH_PATH_NAME = "Authentication" | ||
|
||
DEFAULT_YEAR = 2023 | ||
DEFAULT_MONTH = 11 | ||
DEFAULT_DAY = 15 | ||
|
||
REQUEST_TIMEOUT = 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import logging | ||
|
||
from odoo import api, fields, models | ||
|
||
from ..models.constants import DATA_SOURCE_NAME | ||
from ..tools import field_onchange | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
class G2PDefaultEligibilityManager(models.Model): | ||
_inherit = "g2p.program_membership.manager.default" | ||
|
||
data_source_id = fields.Many2one("spp.data.source") | ||
is_social_registry_data_source = fields.Boolean() | ||
|
||
@api.onchange("data_source_id") | ||
def onchange_data_source_id(self): | ||
field_onchange(self, "data_source_id.name", "data_source_id.name") | ||
if self.data_source_id and self.data_source_id.name == DATA_SOURCE_NAME: | ||
self.is_social_registry_data_source = True | ||
else: | ||
self.is_social_registry_data_source = False |
Oops, something went wrong.