[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:
Victor Feyens 2022-11-21 16:29:59 +00:00
parent 387cf15e7f
commit b2121b7891
7 changed files with 62 additions and 62 deletions

View File

@ -355,8 +355,8 @@ complete list):
.. code-block:: xml
<tree decoration-success="is_partner==True">
<field name="name">
<field name="is_partner" invisible="1">
<field name="name"/>
<field name="is_partner" invisible="1"/>
</tree>
The records where ``is_partner`` is ``True`` will be displayed in green.

View File

@ -152,7 +152,6 @@ After that, you have to write your code inside a ``<odoo>`` tag.
.. code-block:: xml
[XML]
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
@ -164,7 +163,6 @@ Almost every element and option that you create has to be placed inside a ``<tem
.. code-block:: xml
[XML]
<template id="my_title" name="My title">
<h1>This is an HTML block</h1>
<h2 class="lead">And this is a subtitle</h2>

View File

@ -1394,7 +1394,7 @@ merge all those contexts before sending them to the server.
@api.model
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}
You can see the dictionary in the argument ``context`` contains some keys that

View File

@ -419,7 +419,7 @@ Actions triggered automatically on a predefined frequency.
Number of *interval_type* uom between two executions of the action
``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``
Number of times this action has to be run.
@ -438,7 +438,7 @@ Actions triggered automatically on a predefined frequency.
.. code-block:: python
model.<method_name>()
model.<method_name>()
``nextcall``
Next planned execution date of this action (date/time format)

View File

@ -20,11 +20,11 @@ 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"?>
<!-- the root elements of the data file -->
<odoo>
<operation/>
...
<operation/>
...
</odoo>
Data files are executed sequentially, operations can only refer to the result
@ -39,15 +39,15 @@ of operations defined previously
.. code-block:: xml
<odoo>
<data noupdate="1">
<!-- Only loaded when installing the module (odoo-bin -i module) -->
<operation/>
</data>
<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>
<!-- (Re)Loaded at install and update (odoo-bin -i/-u) -->
<operation/>
</odoo>
Core operations
===============
@ -173,24 +173,24 @@ values).
.. code-block:: xml
<odoo>
<data noupdate="1">
<record name="partner_1" model="res.partner">
<field name="name">Odude</field>
</record>
<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.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>
<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>
<record id="model_form_view" model="ir.ui.view">
...
</record>
</odoo>
.. ignored assert

View File

@ -114,9 +114,9 @@ an impact on all view types.
.. code-block:: xml
<tree decoration-info="state == 'draft'"
decoration-danger="state == 'help_needed'"
decoration-bf="state='busy'">
<TREE_VIEW_CONTENT>
decoration-danger="state == 'help_needed'"
decoration-bf="state='busy'">
<!-- TREE_VIEW_CONTENT -->
</tree>
.. warning::
@ -1739,6 +1739,8 @@ root can have the following attributes:
.. code-block:: xml
<tree default_order="sequence,name desc">
...
</tree>
``decoration-{$name}``
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>
<field name="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
will depend on the value currently selected for the field ``department_id``.

View File

@ -1369,36 +1369,36 @@ integer (FieldInteger)
<field name="int_value" options='{"format": false}'/>
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
set on *number* (so user can benefit the native support, especially on
mobile). In this case, the default formatting is disabled to avoid incompability.
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
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
(only for input of type number, 1 by default)
- 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)
.. 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)
@ -1545,15 +1545,15 @@ phone (FieldPhone)
- Supported field types: *char*
url (UrlWidget)
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.
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.
Also, the text of the anchor tag can be customized with the *text* attribute
(it won't change the href value).
Also, the text of the anchor tag can be customized with the *text* attribute
(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:
@ -2068,7 +2068,7 @@ one2many (FieldOne2Many)
.. code-block:: xml
<field name="turtles" options="{\'create_text\': \'Add turtle\'}">
<field name="turtles" options="{\'create_text\': \'Add turtle\'}"/>
statusbar (FieldStatus)
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
<widget name="week_days">
<widget name="week_days"/>
Client actions
==============