[FIX] developer/*: code blocks linting & fixes
invalid xml invalid python correct indentation closes odoo/documentation#3001 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
parent
387cf15e7f
commit
b2121b7891
@ -355,8 +355,8 @@ complete list):
|
|||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<tree decoration-success="is_partner==True">
|
<tree decoration-success="is_partner==True">
|
||||||
<field name="name">
|
<field name="name"/>
|
||||||
<field name="is_partner" invisible="1">
|
<field name="is_partner" invisible="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
||||||
The records where ``is_partner`` is ``True`` will be displayed in green.
|
The records where ``is_partner`` is ``True`` will be displayed in green.
|
||||||
|
@ -152,7 +152,6 @@ After that, you have to write your code inside a ``<odoo>`` tag.
|
|||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
[XML]
|
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
@ -164,7 +163,6 @@ Almost every element and option that you create has to be placed inside a ``<tem
|
|||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
[XML]
|
|
||||||
<template id="my_title" name="My title">
|
<template id="my_title" name="My title">
|
||||||
<h1>This is an HTML block</h1>
|
<h1>This is an HTML block</h1>
|
||||||
<h2 class="lead">And this is a subtitle</h2>
|
<h2 class="lead">And this is a subtitle</h2>
|
||||||
|
@ -1394,7 +1394,7 @@ merge all those contexts before sending them to the server.
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def my_method(self):
|
def my_method(self):
|
||||||
print self.env.context
|
print(self.env.context)
|
||||||
// will print: {'lang': 'en_US', 'new_key': 'key_value', 'tz': 'Europe/Brussels', 'uid': 1}
|
// will print: {'lang': 'en_US', 'new_key': 'key_value', 'tz': 'Europe/Brussels', 'uid': 1}
|
||||||
|
|
||||||
You can see the dictionary in the argument ``context`` contains some keys that
|
You can see the dictionary in the argument ``context`` contains some keys that
|
||||||
|
@ -419,7 +419,7 @@ Actions triggered automatically on a predefined frequency.
|
|||||||
Number of *interval_type* uom between two executions of the action
|
Number of *interval_type* uom between two executions of the action
|
||||||
|
|
||||||
``interval_type``
|
``interval_type``
|
||||||
Unit of measure of frequency interval (``minutes``, ``hours``, ``days``, ``weeks``, ``months``,
|
Unit of measure of frequency interval (``minutes``, ``hours``, ``days``, ``weeks``, ``months``)
|
||||||
|
|
||||||
``numbercall``
|
``numbercall``
|
||||||
Number of times this action has to be run.
|
Number of times this action has to be run.
|
||||||
@ -438,7 +438,7 @@ Actions triggered automatically on a predefined frequency.
|
|||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
model.<method_name>()
|
model.<method_name>()
|
||||||
|
|
||||||
``nextcall``
|
``nextcall``
|
||||||
Next planned execution date of this action (date/time format)
|
Next planned execution date of this action (date/time format)
|
||||||
|
@ -20,11 +20,11 @@ of an XML data file is the following:
|
|||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<!-- the root elements of the data file -->
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- the root elements of the data file -->
|
||||||
<odoo>
|
<odoo>
|
||||||
<operation/>
|
<operation/>
|
||||||
...
|
...
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
||||||
Data files are executed sequentially, operations can only refer to the result
|
Data files are executed sequentially, operations can only refer to the result
|
||||||
@ -39,15 +39,15 @@ of operations defined previously
|
|||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
<data noupdate="1">
|
<data noupdate="1">
|
||||||
<!-- Only loaded when installing the module (odoo-bin -i module) -->
|
<!-- Only loaded when installing the module (odoo-bin -i module) -->
|
||||||
<operation/>
|
<operation/>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<!-- (Re)Loaded at install and update (odoo-bin -i/-u) -->
|
<!-- (Re)Loaded at install and update (odoo-bin -i/-u) -->
|
||||||
<operation/>
|
<operation/>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
||||||
Core operations
|
Core operations
|
||||||
===============
|
===============
|
||||||
@ -173,24 +173,24 @@ values).
|
|||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
<data noupdate="1">
|
<data noupdate="1">
|
||||||
<record name="partner_1" model="res.partner">
|
<record name="partner_1" model="res.partner">
|
||||||
<field name="name">Odude</field>
|
<field name="name">Odude</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<function model="res.partner" name="send_inscription_notice"
|
<function model="res.partner" name="send_inscription_notice"
|
||||||
eval="[[ref('partner_1'), ref('partner_2')]]"/>
|
eval="[[ref('partner_1'), ref('partner_2')]]"/>
|
||||||
|
|
||||||
<function model="res.users" name="send_vip_inscription_notice">
|
<function model="res.users" name="send_vip_inscription_notice">
|
||||||
<function eval="[[('vip','=',True)]]" model="res.partner" name="search"/>
|
<function eval="[[('vip','=',True)]]" model="res.partner" name="search"/>
|
||||||
</function>
|
</function>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<record id="model_form_view" model="ir.ui.view">
|
<record id="model_form_view" model="ir.ui.view">
|
||||||
|
...
|
||||||
</record>
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
||||||
.. ignored assert
|
.. ignored assert
|
||||||
|
|
||||||
|
@ -114,9 +114,9 @@ an impact on all view types.
|
|||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<tree decoration-info="state == 'draft'"
|
<tree decoration-info="state == 'draft'"
|
||||||
decoration-danger="state == 'help_needed'"
|
decoration-danger="state == 'help_needed'"
|
||||||
decoration-bf="state='busy'">
|
decoration-bf="state='busy'">
|
||||||
<TREE_VIEW_CONTENT>
|
<!-- TREE_VIEW_CONTENT -->
|
||||||
</tree>
|
</tree>
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
@ -1739,6 +1739,8 @@ root can have the following attributes:
|
|||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<tree default_order="sequence,name desc">
|
<tree default_order="sequence,name desc">
|
||||||
|
...
|
||||||
|
</tree>
|
||||||
|
|
||||||
``decoration-{$name}``
|
``decoration-{$name}``
|
||||||
allow changing the style of a row's text based on the corresponding
|
allow changing the style of a row's text based on the corresponding
|
||||||
@ -2485,7 +2487,7 @@ Possible children elements of the search view are:
|
|||||||
<searchpanel>
|
<searchpanel>
|
||||||
<field name="department_id"/>
|
<field name="department_id"/>
|
||||||
<field name="manager_id" select="multi" domain="[('department_id', '=', department_id)]"/>
|
<field name="manager_id" select="multi" domain="[('department_id', '=', department_id)]"/>
|
||||||
<searchpanel/>
|
</searchpanel>
|
||||||
|
|
||||||
In the above example, the range of values for manager_id (manager names) available at screen
|
In the above example, the range of values for manager_id (manager names) available at screen
|
||||||
will depend on the value currently selected for the field ``department_id``.
|
will depend on the value currently selected for the field ``department_id``.
|
||||||
|
@ -1369,36 +1369,36 @@ integer (FieldInteger)
|
|||||||
<field name="int_value" options='{"format": false}'/>
|
<field name="int_value" options='{"format": false}'/>
|
||||||
|
|
||||||
float (FieldFloat)
|
float (FieldFloat)
|
||||||
This is the default field type for fields of type *float*.
|
This is the default field type for fields of type *float*.
|
||||||
|
|
||||||
- Supported field types: *float*
|
- Supported field types: *float*
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
|
|
||||||
- digits: displayed precision
|
- digits: displayed precision
|
||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<field name="factor" digits="[42,5]"/>
|
<field name="factor" digits="[42,5]"/>
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
- type: setting the input type (*text* by default, can be set on *number*)
|
- type: setting the input type (*text* by default, can be set on *number*)
|
||||||
|
|
||||||
On edit mode, the field is rendered as an input with the HTML attribute type
|
On edit mode, the field is rendered as an input with the HTML attribute type
|
||||||
set on *number* (so user can benefit the native support, especially on
|
set on *number* (so user can benefit the native support, especially on
|
||||||
mobile). In this case, the default formatting is disabled to avoid incompability.
|
mobile). In this case, the default formatting is disabled to avoid incompability.
|
||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<field name="int_value" options='{"type": "number"}'/>
|
<field name="int_value" options='{"type": "number"}'/>
|
||||||
|
|
||||||
- step: set the step to the value up and down when the user click on buttons
|
- step: set the step to the value up and down when the user click on buttons
|
||||||
(only for input of type number, 1 by default)
|
(only for input of type number, 1 by default)
|
||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<field name="int_value" options='{"type": "number", "step": 0.1}'/>
|
<field name="int_value" options='{"type": "number", "step": 0.1}'/>
|
||||||
|
|
||||||
- format: should the number be formatted. (true by default)
|
- format: should the number be formatted. (true by default)
|
||||||
|
|
||||||
@ -1545,15 +1545,15 @@ phone (FieldPhone)
|
|||||||
- Supported field types: *char*
|
- Supported field types: *char*
|
||||||
|
|
||||||
url (UrlWidget)
|
url (UrlWidget)
|
||||||
This field displays an url (in readonly mode). The main reason to use it is
|
This field displays an url (in readonly mode). The main reason to use it is
|
||||||
that it is rendered as an anchor tag with the proper css classes and href.
|
that it is rendered as an anchor tag with the proper css classes and href.
|
||||||
|
|
||||||
Also, the text of the anchor tag can be customized with the *text* attribute
|
Also, the text of the anchor tag can be customized with the *text* attribute
|
||||||
(it won't change the href value).
|
(it won't change the href value).
|
||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<field name="foo" widget="url" text="Some URL"/>
|
<field name="foo" widget="url" text="Some URL"/>
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
@ -2068,7 +2068,7 @@ one2many (FieldOne2Many)
|
|||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<field name="turtles" options="{\'create_text\': \'Add turtle\'}">
|
<field name="turtles" options="{\'create_text\': \'Add turtle\'}"/>
|
||||||
|
|
||||||
statusbar (FieldStatus)
|
statusbar (FieldStatus)
|
||||||
This is a really specialized widget for the form views. It is the bar on top
|
This is a really specialized widget for the form views. It is the bar on top
|
||||||
@ -2096,7 +2096,7 @@ week_days (WeekDays)
|
|||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<widget name="week_days">
|
<widget name="week_days"/>
|
||||||
|
|
||||||
Client actions
|
Client actions
|
||||||
==============
|
==============
|
||||||
|
Loading…
Reference in New Issue
Block a user