From 843cd4c471f9c15ac94b33e53cd1621c84393c04 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 7 Mar 2023 17:37:53 +0000 Subject: [PATCH] [UPD] README.rst --- rpc_helper/README.rst | 27 ++++++++++++ rpc_helper/static/description/index.html | 55 +++++++++++++++++------- 2 files changed, 66 insertions(+), 16 deletions(-) diff --git a/rpc_helper/README.rst b/rpc_helper/README.rst index d2aba0e21..1bdacfa87 100644 --- a/rpc_helper/README.rst +++ b/rpc_helper/README.rst @@ -37,6 +37,33 @@ Provide helpers to authorize RPC calls. .. contents:: :local: +Configuration +============= + +Enable debug mode and go to "Technical -> Database Structure -> Models". + +Open the model that you like to configure and go to the tab "RPC config". + +There you see a text field which supports JSON configuration. + +The configuration is the same you can pass via decorator. +The only difference is that you have to wrap values in a dictionary +like `{"disable": [...values...]}`. + +To disable all calls:: + + { + "disable": ["all"], + } + +To disable only some methods:: + + { + "disable": ["create", "write", "another_method"], + } + +NOTE: on the resulting JSON will be automatically formatted on save for better readability. + Usage ===== diff --git a/rpc_helper/static/description/index.html b/rpc_helper/static/description/index.html index b288563f2..654fc69c5 100644 --- a/rpc_helper/static/description/index.html +++ b/rpc_helper/static/description/index.html @@ -378,24 +378,47 @@ Only for development or testing purpose, do not use in production.

Table of contents

+
+

Configuration

+

Enable debug mode and go to “Technical -> Database Structure -> Models”.

+

Open the model that you like to configure and go to the tab “RPC config”.

+

There you see a text field which supports JSON configuration.

+

The configuration is the same you can pass via decorator. +The only difference is that you have to wrap values in a dictionary +like {“disable”: […values…]}.

+

To disable all calls:

+
+{
+    "disable": ["all"],
+}
+
+

To disable only some methods:

+
+{
+    "disable": ["create", "write", "another_method"],
+}
+
+

NOTE: on the resulting JSON will be automatically formatted on save for better readability.

+
-

Usage

+

Usage

-

Via code

+

Via code

Decorate an Odoo model class like this:

 from odoo.addons.rpc_helper.decorator import disable_rpc
@@ -413,12 +436,12 @@ class AverageModel(models.Model):
 
-

Via ir.model configuration

+

Via ir.model configuration

See “Configuration” section.

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. 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 @@ -426,21 +449,21 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Camptocamp
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose