odoo_model_generator 2.0.0
odoo_model_generator: ^2.0.0 copied to clipboard
Build full Odoo modules in seconds using a fluent Dart API. Generate models, views, manifests, and security files automatically.
Changelog #
All notable changes to odoo_model_generator are documented here.
Format follows Keep a Changelog.
Versions follow Semantic Versioning.
2.0.0 — 2024-12-01 #
Added #
- Dart 3.0 records syntax for
Float.digits—digits: (10, 2)instead of a list. NameFieldconvenience class — shorthand forChar('name', required: true).Monetaryfield type —fields.Monetarywith currency field support.Imagefield type —fields.ImagewithmaxWidth/maxHeight.Referencefield type — dynamic model reference.ComputeDefinition— register compute method bodies directly on the model.OnchangeDefinition— register onchange method bodies.ConstraintDefinition— register Python constraint methods.- SQL constraints via
.sqlConstraint(id, expr, msg). _ordersupport onOdooModel.InheritModeenum — distinguishes mixin vs extension inheritance.OdooGenerator.dryRun()— returns all file contents without I/O.ParallelGenerator— concurrent multi-model generation withconcurrencycap.GeneratorCache— LRU in-memory cache for generated content.ModuleExporter— ZIP and TAR.GZ archive export.OdooCLIIntegration— bridge toodoo-binfor direct installs.ServerAction— metadata forir.actions.serverrecords.GenerationReport— ASCII table summary of a generation run.CodeFormatter— post-processes Python and XML output.FieldTemplates— per-field rendering helpers and Markdown table generator.GeneratorConfig.copyWith— immutable config updates.GeneratorConfig.extraDependencies— inject dependencies via config.- Full CLI (
oomg) —generate,validate,dry-run,export,version. - JSON schema input for CLI — describe models in JSON.
- Comprehensive test suite — unit + integration tests, > 95% coverage.
- 5 complete examples in
example/. - Auto-create module sub-directories (wizards, reports, controllers, etc.).
- Chatter integration — emits
<div class="oe_chatter">whenmail.threadis inherited. - Tree decorations —
decoration-success/decoration-mutedfromSelectionfields. - Search view group-by suggestions for
Many2onefields. - Notebook pages for
One2many,Many2many,Text,Htmlfields. - Status bar for the first
Selectionfield. - Two-column form layout auto-split.
- Shadow timestamp fields (
create_date_display,write_date_display). - Sequence auto-assign in
create()whencreateSequence=true.
Changed #
OdooFieldis nowsealed— exhaustiveswitchworks correctly.Many2onefield name is now the first positional parameter (instead of second).generate()now returnsGenerationResult(wasvoid).- Module structure now includes all standard Odoo subdirectories.
models.pynow split intomodels/<modelName>.pyfor better organisation.- Security CSV now generates both
_userand_managerrows. - Manifest now uses Python dict literal (
.py) not YAML.
Fixed #
- Trailing commas in generated Python field kwargs no longer appear.
- Blank line collapsing is now deterministic.
_rec_namevalidation now triggers before any file is written.
Removed #
OdooModel.docstringis no longer a required parameter (now optional).Many2one.cascadeDeleteremoved in favour ofondelete: 'cascade'.
1.0.0 — 2024-06-01 #
Added #
- Initial public release.
OdooModelfluent builder.- Basic field types:
Char,Text,Integer,Float,Boolean,Date,Datetime,Selection,Binary. - Relational fields:
Many2one,One2many,Many2many. ComputedField(basic).generate()producingmodels.py,__manifest__.py,views.xml,security/ir.model.access.csv.- Basic form / tree / search view generation.
- Method chaining API.
ValidationException,GenerationExceptionerror types.