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

Add security access to models


It's common for the addon modules to add new models. For example, in the previous chapter we had examples adding a new Library Books model.

It is easy to miss the creation of security access for the new models defined in an addon module if you test it using the convenient admin user, because admin bypasses all the security checks.

However, models with no ACLs will trigger a warning log message on loading, informing about the missing ACL definitions: The model library.book has no access rules, consider adding one. To avoid that, you should watch for such messages during tests, and before publishing your code make sure you run the tests with the demo user rather than admin.

So, for new models to be usable by non-admin users, we need to define their security access control lists, so that Odoo knows how it should access them and what operations each user group should be allowed.

Getting ready

We will take the module created in Chapter 3, Creating Odoo Modules and add...