[IMP] developer: add notes on entity references & fix illegal XML

Using `<` inside XML elements will result in a parsing error,
an entity reference should be used instead: `&lt;`.

closes odoo/documentation#5180

X-original-commit: a7743d513b
Signed-off-by: Levi Siuzdak (sile) <sile@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Levi Siuzdak (sile) 2023-07-19 11:44:00 +00:00
parent d07250afb9
commit eab4bb492b
2 changed files with 14 additions and 1 deletions

View File

@ -2340,11 +2340,14 @@ Possible children elements of the search view are:
<filter domain="[('state', '=', 'draft')]"/>
<separator/>
<filter domain="[('delay', '<', 15)]"/>
<filter domain="[('delay', '&lt;', 15)]"/>
if both filters are selected, will select the records whose ``state``
is ``draft`` **and** ``delay`` is below 15.
.. note:: XML does not allow ``<`` to be used within XML elements,
an entity reference (``&lt;``) should be used instead.
``separator``
can be used to separates groups of filters in simple search views

View File

@ -218,6 +218,16 @@ services *OR* have a unit price which is *NOT* between 1000 and 2000'::
('unit_price', '>=', 1000),
('unit_price', '<', 2000)]
.. note:: XML does not allow ``<`` and ``&`` to be used inside XML
elements. To avoid parsing errors, entity references should be used:
``&lt;`` for ``<`` and ``&amp;`` for ``&``. Other entity references
(``&gt;``, ``&apos;`` & ``&quot;``) are optional.
.. example::
.. code-block:: xml
<filter name="negative" domain="[('test_val', '&lt;', 0)]"/>
.. exercise:: Add filter and Group By.
The following should be added to the previously created search view: