Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Odoo Development Cookbook

You're reading from   Odoo Development Cookbook Build effective applications by applying Odoo development best practices

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher Packt
ISBN-13 9781785883644
Length 400 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Holger Brunn Holger Brunn
Author Profile Icon Holger Brunn
Holger Brunn
Alexandre Fayolle Alexandre Fayolle
Author Profile Icon Alexandre Fayolle
Alexandre Fayolle
Daniel Reis Daniel Reis
Author Profile Icon Daniel Reis
Daniel Reis
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Installing the Odoo Development Environment FREE CHAPTER 2. Managing Odoo Server Instances 3. Creating Odoo Modules 4. Application Models 5. Basic Server Side Development 6. Advanced Server Side Development Techniques 7. Debugging and Automated Testing 8. Backend Views 9. Module Data 10. Access Security 11. Internationalization 12. Automation and Workflows 13. Web Server Development 14. CMS Website Development 15. Web Client Development 16. Server Deployment Index

Loading data using YAML files


A third format for data import is YAML, which gives you less overhead than XML, but still more control than CSV. Traditionally, it was used for tests rather than for data import, which is why you have more possibilities to call code here.

How to do it...

Take the following steps to translate the first recipe in this chapter to YAML:

  1. Add in a file called data/demo.yml to your manifest, in the demo section:

        'demo': [
            'data/demo.yml',
        ],
  2. 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image