diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-09-24 16:59:15 +0000 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-09-24 17:45:37 +0000 |
| commit | d67b2483e5bfa5d8c1e6ef1a64fb933f5e080ad5 (patch) | |
| tree | 25a7fd39ac993f3c04c5d8408beb628b3c9948ce /doc/reference/data.rst | |
| parent | 38d8b0526f0fccc32df5a11f5d086a3522ed5fcf (diff) | |
| parent | 9ed4872ea03f28012118ed48a43d0800617a84f3 (diff) | |
[MERGE] forward port branch saas-12.4 up to 9ed4872ea03
closes odoo/odoo#37372
Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'doc/reference/data.rst')
| -rw-r--r-- | doc/reference/data.rst | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/doc/reference/data.rst b/doc/reference/data.rst index 2165a490dd0..416121b8255 100644 --- a/doc/reference/data.rst +++ b/doc/reference/data.rst @@ -22,6 +22,7 @@ of an XML data file is the following: .. code-block:: xml <!-- the root elements of the data file --> + <?xml version="1.0" encoding="UTF-8"?> <odoo> <operation/> ... @@ -30,6 +31,25 @@ of an XML data file is the following: Data files are executed sequentially, operations can only refer to the result of operations defined previously +.. note:: + + If the content of the data file is expected to be applied only once, you + can specify the odoo flag ``noupdate`` set to 1. If part of + the data in the file is expected to be applied once, you can place this part + of the file in a <data noupdate="1"> domain. + + .. code-block:: xml + + <odoo> + <data noupdate="1"> + <!-- Only loaded when installing the module (odoo-bin -i module) --> + <operation/> + </data> + + <!-- (Re)Loaded at install and update (odoo-bin -i/-u) --> + <operation/> + </odoo> + Core operations =============== @@ -152,8 +172,31 @@ Parameters can be provided using ``eval`` (should evaluate to a sequence of parameters to call the method with) or ``value`` elements (see ``list`` values). +.. code-block:: xml + + <odoo> + <data noupdate="1"> + <record name="partner_1" model="res.partner"> + <field name="name">Odude</field> + </record> + + <function model="res.partner" name="send_inscription_notice" + eval="[[ref('partner_1'), ref('partner_2')]]"/> + + <function model="res.users" name="send_vip_inscription_notice"> + <function eval="[[('vip','=',True)]]" model="res.partner" name="search"/> + </function> + </data> + + <record id="model_form_view" model="ir.ui.view"> + + </record> + </odoo> + .. ignored assert +.. _reference/data/shortcuts: + Shortcuts ========= @@ -166,7 +209,7 @@ data files provide shorter alternatives to defining them using Defines an ``ir.ui.menu`` record with a number of defaults and fallbacks: -Parent menu +``parent`` * If a ``parent`` attribute is set, it should be the :term:`external id` of an other menu item, used as the new item's parent * If no ``parent`` is provided, tries to interpret the ``name`` attribute @@ -175,10 +218,10 @@ Parent menu created * Otherwise the menu is defined as a "top-level" menu item (*not* a menu with no parent) -Menu name +``name`` If no ``name`` attribute is specified, tries to get the menu name from a linked action if any. Otherwise uses the record's ``id`` -Groups +``groups`` A ``groups`` attribute is interpreted as a comma-separated sequence of :term:`external identifiers` for ``res.groups`` models. If an :term:`external identifier` is prefixed with a minus (``-``), the group @@ -218,7 +261,7 @@ section of the view, and allowing a few *optional* attributes: ``report`` ---------- -Creates a ``ir.actions.report`` record with a few default values. +Creates a :ref:`IrActionsReport <reference/actions/report>` record with a few default values. Mostly just proxies attributes to the corresponding fields on ``ir.actions.report``, but also automatically creates the item in the @@ -263,5 +306,5 @@ For each row (record): * the third column is the ``name`` field for ``res.country.state`` * the fourth column is the ``code`` field for ``res.country.state`` -.. _base64: http://tools.ietf.org/html/rfc3548.html#section-3 -.. _csv: http://en.wikipedia.org/wiki/Comma-separated_values +.. _base64: https://tools.ietf.org/html/rfc3548.html#section-3 +.. _csv: https://en.wikipedia.org/wiki/Comma-separated_values |
