spec_driven_model
Databinding framework that bridges XML schemas and Odoo models so XML bindings can be turned into concrete Odoo records and exported back to XML bindings.
Key Features
- spec.mixin: Provides schema-aware helpers, context-based schema/version resolution, and a register hook that turns remaining abstract spec mixins into concrete models with default access rules.
- spec.model: When used as a base model, remaps relational spec fields to the concrete Odoo models they've been injected into and softens display names for auto-generated records.
- spec.model (StackedModel): Stacks nested many2one spec mixins into a single denormalized model by walking the XML hierarchy and injecting inherited mixins while skipping configured stacking points.
- spec.mixin_import: Recursively builds Odoo records from xsdata-generated binding objects, converting simple types, handling many2one/one2many relations with match-or-create logic, and applying related-field defaults.
- spec.mixin_export: Serializes Odoo records into xsdata binding instances with schema-driven field selection, nested relation handling, timezone-aware datetimes, and XSD decimal formatting for numeric fields.
- spec.mixin_view: Dynamically augments form views with groups/tabs of spec fields derived from stacked mixins or injected schemas, setting modifiers to hide choice-dependent sections.