Odoo 12 Development Cookbook - Third Edition
by Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis
How it works...
You can call any modal method from RPC. This helps you to perform business logic without encountering any side-effects. For example, you created the sales order from RPC and then called the action_confirm method of the sale.order method. This is equivalent to clicking on the Confirm button on a sales order form.
You can call any public method of the model, but you cannot call a private method from RPC. A method name that starts with _ is called a private method, such as _get_share_url() and _get_data().
It is safe to use these methods, as they go through the ORM and follow all security rules. If the method is accessing unauthorized records, it will generate errors.
In our example, we created a book with the state draft. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access