Search 1.9 billion lines of Odoo code on GitHub

rpc_helper

Author: Camptocamp, Odoo Community Association (OCA)
License: LGPL-3
Branch: 14.0
Repository: acsone/server-tools
Dependencies: base, and base_sparse_field
Languages: HTML (366, 58.0%), Python (166, 26.3%), XML (19, 3.0%), and reStructuredText (80, 12.7%)
Other branches: 14.0-mass_mailing_mail_server-mle, and 14.0-session_db-sbi
Other repositories: AITIC/server-tools, Change2improve/server-tools, Digital5-Odoo/server-tools, ForgeFlow/server-tools, Jarsa/server-tools, LevelPrime/server-tools, OCA/server-tools, Rad0van/server-tools, StefanRijnhart/server-tools, Tecnativa/server-tools, Vauxoo/server-tools, YannickB/server-tools, akretion/server-tools, anhvu-sg/server-tools, aurestic/server-tools, blooparksystems/server-tools, brain-tec/server-tools, camptocamp/server-tools, coopiteasy/server-tools, ecosoft-odoo/server-tools, grindtildeath/server-tools, gurneyalex/server-tools, initOS/server-tools, invitu/server-tools, kmee/server-tools, legalsylvain/server-tools, modoolar/server-tools, petrus-v/server-tools, praxigento/oca-server-tools, sodexis/server-tools, sunflowerit/server-tools, tafaRU/server-tools, tegin/server-tools, trevi-software/server-tools, ursais/server-tools, and zarumaru/server-tools

<h1 class="title">Disable RPC</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-tools/tree/14.0/rpc_helper"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-rpc_helper"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/149/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>Provide helpers to authorize RPC calls.</p> <div class="admonition important"> <p class="first admonition-title">Important</p> <p class="last">This is an alpha version, the data model and design can change at any time without warning. Only for development or testing purpose, do not use in production. <a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p> </div> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id1">Usage</a><ul> <li><a class="reference internal" href="#via-code" id="id2">Via code</a></li> <li><a class="reference internal" href="#via-ir-model-configuration" id="id3">Via <cite>ir.model</cite> configuration</a></li> </ul> </li> <li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id5">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id6">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li> </ul> </li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id1">Usage</a></h2> <a name="via-code"></a> <h3><a class="toc-backref" href="#id2">Via code</a></h3> <p>Decorate an Odoo model class like this:</p> <pre> <code>from odoo.addons.rpc_helper.decorator import disable_rpc &#64;disable_rpc() class AverageModel(models.Model): _inherit = &quot;avg.model&quot;</code> </pre> <p>This will disable ALL calls.</p> <p>To selectively disable only some methods:</p> <pre> <code>&#64;disable_rpc(&quot;create&quot;, &quot;write&quot;, &quot;any_method&quot;) class AverageModel(models.Model): _inherit = &quot;avg.model&quot;</code> </pre> <a name="via-ir-model-configuration"></a> <h3><a class="toc-backref" href="#id3">Via <cite>ir.model</cite> configuration</a></h3> <p>See &quot;Configuration&quot; section.</p> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id4">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed <a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20rpc_helper%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id5">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id6">Authors</a></h3> <ul class="simple"> <li>Camptocamp</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id7">Contributors</a></h3> <ul class="simple"> <li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id8">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/simahawk"><img alt="simahawk" src="https://github.com/simahawk.png?size=40px" /></a></p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/14.0/rpc_helper">OCA/server-tools</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>