Skip to content

Commit d77d3ac

Browse files
committed
[FIX] developer/tutorials/importable_modules: no self in actions
In ir.actions.server, the variable containing the record(s) is not `self`, but `record` and `records`. Also, since there is a word about `store` attribute for computed fields, this commit specifies the behaviour of `readonly` attribute. closes #11484 Signed-off-by: Vallaeys Valentin (vava) <[email protected]>
1 parent b81d1a6 commit d77d3ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

content/developer/tutorials/importable_modules.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ Python code).
524524

525525
Unlike in Python modules, computed fields are stored by default. If you wish for a computed field to
526526
not be stored (e.g., for performance reasons or to avoid database bloat), you can set the ``store``
527-
attribute to ``False``.
527+
attribute to ``False``. The same applies to ``readonly``: if you want your computed field to not be
528+
editable, you need to set the ``readonly`` attribute to ``True``.
528529

529530
The `CDATA` section is used to specify to XML parsers that the content is a string and not XML;
530531
this prevents the parser from trying to interpret the Python code as XML, or the addition of
@@ -594,11 +595,11 @@ sandboxed environment.
594595

595596
This environment contains several utilities to help you interact with the Odoo database:
596597

597-
- ``self``: the record on which the action is executed
598598
- ``env``: the environment of the record
599599
- ``model``: the model of the record
600600
- ``user`` and ``uid``: the current user and their id
601-
- ``datetime``, ``dateutil``, ``timezone`` and ``time``: libraries to help with date/time calculations
601+
- ``datetime``, ``dateutil``, ``timezone`` and ``time``: libraries to help with date/time
602+
calculations
602603
- ``float_compare``: a utility function to compare two float values with a given precision
603604
- ``b64encode`` and ``b64decode``: utility functions to encode and decode values in base64
604605
- ``Command``: a utility class to help build complex expressions and commands (see the `Command`

0 commit comments

Comments
 (0)