Skip to content

Commit 50c9b59

Browse files
fix(spp_dci_openg2p): use canonical registry_type URI in SR-import wizard
The wizard's data_source_id domain filtered on the short alias 'SR', which only exists in the dispatcher's URI-to-alias routing map — not as a stored field value. spp.dci.data.source.registry_type is a Selection over URIs from spp_dci.schemas.constants.RegistryType, so the filter never matched and the Source Registry dropdown rendered empty. Switch the domain, the _default_data_source search, and the seeded data XML to 'ns:org:RegistryType:Social' so the dropdown picks up the Social Registry source on fresh installs and the operator sees the configured source pre-filled.
1 parent 2983985 commit 50c9b59

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

spp_dci_openg2p/data/openg2p_data_source.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<record id="openg2p_dr_source" model="spp.dci.data.source">
2424
<field name="name">Social Registry</field>
2525
<field name="code">openg2p_dr</field>
26-
<field name="registry_type">SR</field>
26+
<field name="registry_type">ns:org:RegistryType:Social</field>
2727
<field name="vendor">openg2p</field>
2828
<field name="base_url">https://partner-registry.play.openg2p.org</field>
2929
<field name="search_endpoint">/dci/registry/sync/search</field>

spp_dci_openg2p/wizards/sr_import_wizard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class SppDciSrImportWizard(models.TransientModel):
6060
"spp.dci.data.source",
6161
string="Source Registry",
6262
required=True,
63-
domain="[('registry_type', '=', 'SR'), ('vendor', '=', 'openg2p'), ('active', '=', True)]",
63+
domain="[('registry_type', '=', 'ns:org:RegistryType:Social'), ('vendor', '=', 'openg2p'), ('active', '=', True)]",
6464
default=lambda self: self._default_data_source(),
6565
help="DCI data source to query. Restricted to active Social Registry "
6666
"(SR) sources configured with the vendor-specific request semantics "
@@ -136,7 +136,7 @@ def _default_data_source(self):
136136
"""
137137
return self.env["spp.dci.data.source"].search(
138138
[
139-
("registry_type", "=", "SR"),
139+
("registry_type", "=", "ns:org:RegistryType:Social"),
140140
("vendor", "=", "openg2p"),
141141
("active", "=", True),
142142
],

0 commit comments

Comments
 (0)