[WIP][ADD] base_xmlify: assist generation of demo data
The purpose of this module is to facilitate the generation of demo data during a module's development. During a module's development, there are usually user tests through the standard interface, with the aim of simulating the complete flows. These generate entirely real data, as opposed to test data, which can always differ slightly because they may have skipped some onchanges, etc. However this data is lost, as opposed to test data, unless it is manually encoded, which doubles the effort. Furthermore if somewhat decently done, demo data can fill in for missing documentation (it is certainly a crutch, but in all realistic expectations the gap in documentation is not going to be filled any time soon). One more caveat: it is intended to be an assistive module, so that the coder would go over the data before committing.
This implementation provides the user with a wizard (accessible in debug mode) to export to XML. This wizard essentially requires a model, a domain, and the root module for which the user whishes to export the data. If the root module is provided, only the fields that are in the module's dependencies (including itself) are exported. The file name/path can be skipped, and defaults to demo_model_name.xml in the current directory. It is furthermore possible to specify the default export(s) for the model (without, it default to all fields except magic ones)
Possible improvements:
- Add a one2many on the wizard to specify a list of exports per model. For instance, if interested in exporting a product with a new field model_x_id, you could directly specify the export for model_x.
- add some option to have more control over date(time) fields (e.g. specify "today" as a date). Maybe using resolvers?
- add an option add inherited fields (for existing xml_ids)
- better error catching (e.g. if the file cannot be created in the default directory).
Note that it also extracts the views on ir.exports in another module, since that functionality is also in base_jsonify.
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.