Book Image

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
Book Image

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is also a key selling point of Odoo. It is built on a powerful framework for rapid application development, both for back-end applications and front-end websites. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Loading data using CSV files


While you can do everything you need with XML files, this format is not the most convenient when you need to provide larger amounts of data, especially given that many people are more comfortable preprocessing data in Calc, or some other spreadsheet software. Another advantage of this format is that it is what you get when you use the standard export function. In this recipe, we'll have a look at importing table-like data.

How to do it...

Traditionally, access control lists (ACLs), (refer to Chapter 10, Access Security) are a type of data that is loaded via CSV files:

  1. Add security/ir.model.access.csv to your data files:

    'data': [
        …
        'security/ir.model.access.csv',
    ],
  2. Add an ACL for our books in this file:

    "id","name","model_id:id","group_id:id","perm_read",
        "perm_write","perm_create","perm_unlink"
    "access_library_book_user","ACL for books",
        "model_library_book","base.group_user",1,0,0,0

Now we have an ACL that permits normal users to read book records...