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

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

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