O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required