Take the following steps to translate the first recipe in this chapter to YAML:
- Add a file called data/demo.yml to your manifest, in the demo section:
'demo': [ 'data/demo.yml', ],
- Add content to this file:
- !record {id: author_af, model: res.partner} name: Alexandre Fayolle - !record {id: author_dr, model: res.partner} name: Daniel Reis - !record {id: author_hb, model: res.partner} name: Holger Brunn - !record {id: book_cookbook, model: library.book} name: Odoo cookbook short_name: cookbook date_release: 2016-03-01 author_ids: [(6, 0, [ref('author_af'), ref('author_dr'),
ref('author_hb')])] publisher_id: res_partner_packt
- Add a file called data/res_partner.yml to your manifest, in the data section:
'data': [ 'data/res_partner.yml', ],
- Add content to this file:
- !record {id: res_partner_packt, model: res.partner} name: Packt publishing city: Birmingham country_id: base.uk
We did the same as in the first recipe, but in YAML syntax. Note that YAML files need the .yml extension to be recognized correctly.