summaryrefslogtreecommitdiff
path: root/doc/reference
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2019-04-19 11:49:36 +0000
committerVictor Feyens <vfe@odoo.com>2019-09-18 08:54:51 +0000
commitffc69127f8f91e79a1263a0ab5685e67d93d569a (patch)
treeb33704c1aeca61cb22408ce94e66ad30084ec7a6 /doc/reference
parentef5251c0d720a6199b34c239344bb353c9f3d15e (diff)
[DOC] Data files : noupdate information + examples
Solves #26818
Diffstat (limited to 'doc/reference')
-rw-r--r--doc/reference/data.rst49
1 files changed, 45 insertions, 4 deletions
diff --git a/doc/reference/data.rst b/doc/reference/data.rst
index 2f13b6cf961..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,6 +172,27 @@ 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:
@@ -168,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
@@ -177,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
@@ -220,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