@@ -103,13 +103,20 @@ YAML File Upload → Validation → Parse → Extract Entities → Create Fields
103103** Field Naming Convention** :
104104
105105```
106- YAML: "hh_id"
107- Odoo: "z_cst_hh_id"
106+ YAML Entity: "Household", Field: "hh_id"
107+ Odoo: "x_cst_grp_hh_id"
108+
109+ YAML Entity: "Individual", Field: "person_id"
110+ Odoo: "x_cst_indv_person_id"
108111
109112Prefix breakdown:
110- - z_ : OpenSPP custom field prefix
113+ - x_ : Odoo custom field prefix
111114- cst_ : Custom (not indicator)
112- - hh_id : Original field ID from YAML
115+ - grp_ : Group/Household fields
116+ - indv_ : Individual fields
117+ - field_id : Original field ID from YAML
118+
119+ This matches the spp_custom_fields_ui module conventions for proper UI integration.
113120```
114121
115122** Args** :
@@ -207,22 +214,24 @@ entities:
207214
208215For the above YAML, the following fields would be created in ` res.partner`:
209216
210- | YAML Field ID | Odoo Field Name | Type | Required |
211- | ------------- | --------------- | --------- | -------- |
212- | hh_id | z_cst_hh_id | Char | Yes |
213- | province | z_cst_province | Char | No |
214- | person_id | z_cst_person_id | Char | Yes |
215- | birthdate | z_cst_birthdate | Date | Yes |
216- | gender | z_cst_gender | Selection | Yes |
217+ | Entity | YAML Field ID | Odoo Field Name | Type | Required |
218+ | ---------- | ------------- | ----- --------------- | --------- | -------- |
219+ | Household | hh_id | x_cst_grp_hh_id | Char | Yes |
220+ | Household | province | x_cst_grp_province | Char | No |
221+ | Individual | person_id | x_cst_indv_person_id | Char | Yes |
222+ | Individual | birthdate | x_cst_indv_birthdate | Date | Yes |
223+ | Individual | gender | x_cst_indv_gender | Selection | Yes |
217224
218225# ## Selection Field Example
219226
220- For `gender` enum field :
227+ For `gender` enum field in Individual entity :
221228
222229` ` ` python
223- Field: z_cst_gender
230+ Field: x_cst_indv_gender
224231Type: Selection
225232Values: [('Female', 'Female'), ('Male', 'Male')]
233+ Target Type: indv
234+ Field Category: cst
226235` ` `
227236
228237---
@@ -324,17 +333,39 @@ Completed at: 2025-10-23 10:30:15
324333
325334### Field Naming
326335
327- Follows OpenSPP field naming patterns:
336+ Follows `spp_custom_fields_ui` field naming patterns:
337+
338+ - `x_`: Odoo custom field prefix (standard)
339+ - `cst_`: Custom/arbitrary fields (not indicators `ind_`)
340+ - `grp_`: Group/Household entity fields
341+ - `indv_`: Individual entity fields
328342
329- - `z_`: General prefix for custom fields
330- - `cst_`: Custom/arbitrary fields (not indicators)
331- - Example: `z_cst_hh_id`
343+ **Examples**:
344+
345+ - Group field: `x_cst_grp_hh_id`
346+ - Individual field: `x_cst_indv_person_id`
332347
333348### Why This Pattern?
334349
335- 1. **z\_**: Groups all custom fields together
336- 2. **cst\_**: Distinguishes from indicators (`ind_`)
337- 3. **Prevents conflicts**: With standard Odoo fields
350+ 1. **x\_**: Standard Odoo prefix for custom fields
351+ 2. **cst\_**: Distinguishes from computed indicators (`ind_`)
352+ 3. **grp\_/indv\_**: Entity-specific prefix for UI filtering
353+ 4. **Integration**: Matches `spp_custom_fields_ui` for proper display in registry UIs
354+ 5. **Prevents conflicts**: With standard Odoo and OpenSPP fields
355+
356+ ### spp_custom_fields_ui Integration
357+
358+ Created fields include metadata for `spp_custom_fields_ui`:
359+
360+ - `target_type`: "grp" or "indv"
361+ - `field_category`: "cst" (custom)
362+ - `draft_name`: Original field ID from YAML
363+
364+ This ensures fields appear correctly in:
365+
366+ - Group/Household forms
367+ - Individual forms
368+ - Custom field management UI
338369
339370---
340371
0 commit comments