+1 to any effort that tries to simplify management of XML files.
About the proposal I wonder how hard it will be to guess the IDs that will be created by such methods. It seems that it could be somewhat harder to find the IDs that ones need to refer to in “inheriting” modules.
Although the proposal is about templating, I’ve also thought in the past about simplifying XMLs. Maybe I’m the only one but I find XMLs somewhat hard to read and write and I’ve lately been used to YAML syntax.
If that was considered there are many ways to establish the structure of such file. One of them could be as follows (a fragment of sale/sale.xml translated into sale/sale.yml):
- model: res.group
name: Sales Administration
- model: res.user-res.group
- model: ir.ui.icon
- model: ir.ui.view
- model: ir.action.act_window
- model: ir.action.act_window.view
- model: ir.action.act_window.domain
eval: [('state', '=', 'draft')]
eval: [('state', '=', 'quotation')]
eval: [('state', '=', 'processing')]
This makes several assumptions such as:
- It takes advantage of the fact that many consecutive records are from the same model
- Assumes that most of the time m2o fields use a “ref=xxx” where xxx is the ID of the related record
Of course there could be other ways of structuring it, such as:
I understand that because of the use of SAX, XML may consume less memory, and maybe others already feel comfortable with XML, but just wanted to put another option on the table.