Skip to content

Commit a74af0a

Browse files
Pirolsaj-fuentes
andcommitted
[IMP] fix docstring syntax
Some {warning,tip,example} blocks were not being rendered. Part-of: #72 Co-authored-by: Alvaro Fuentes <[email protected]>
1 parent 3fb94fe commit a74af0a

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/util/misc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ def version_between(a, b):
7575
See also :func:`~odoo.upgrade.util.misc.version_gte`
7676
7777
.. note::
78-
79-
Bounds are inclusive.
78+
The bounds are inclusive.
8079
8180
:param str a: Odoo version, lower bound
8281
:param str b: Odoo version, upper bound

src/util/pg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def explode_execute(cr, query, table, alias=None, bucket_size=10000, logger=_log
308308
:return: the sum of `cr.rowcount` for each query run
309309
:rtype: int
310310
311-
.. warning:
311+
.. warning::
312312
It's up to the caller to ensure the queries do not update the same records in
313313
different buckets. It is advised to never use this function for `DELETE` queries on
314314
tables with self references due to the potential `ON DELETE` effects.

src/util/records.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def remove_record(cr, name):
314314
"""
315315
Remove a record and its references corresponding to the given :term:`xml_id <external identifier>`.
316316
317-
:param str name: record xml_id, under the format `module`.`name`
317+
:param str name: record xml_id, under the format `module.name`
318318
"""
319319
if isinstance(name, basestring):
320320
if "." not in name:
@@ -630,8 +630,8 @@ def rename_xmlid(cr, old, new, noupdate=None, on_collision="fail"):
630630
.. note::
631631
This function does not remove records, it only updates xml_ids.
632632
633-
:param str old: current xml_id of the record, under the format `module`.`name`
634-
:param str new: new xml_id of the record, under the format `module`.`name`
633+
:param str old: current xml_id of the record, under the format `module.name`
634+
:param str new: new xml_id of the record, under the format `module.name`
635635
:param bool or None noupdate: value to set on the `noupdate` flag of the xml_id,
636636
ignored if `None`
637637
:param str on_collision: how to proceed if the xml_id already exists, the options are
@@ -707,7 +707,7 @@ def ref(cr, xmlid):
707707
"""
708708
Return the id corresponding to the given :term:`xml_id <external identifier>`.
709709
710-
:param str xml_id: record xml_id, under the format `module`.`name`
710+
:param str xml_id: record xml_id, under the format `module.name`
711711
:return: ID of the referenced record, `None` if not found.
712712
:rtype: int or `None`
713713
"""
@@ -734,7 +734,7 @@ def force_noupdate(cr, xmlid, noupdate=True, warn=False):
734734
"""
735735
Update the `noupdate` flag of a record.
736736
737-
:param str xmlid: record xml_id, under the format `module`.`name`
737+
:param str xmlid: record xml_id, under the format `module.name`
738738
:param bool noupdate: value to set on the `noupdate` flag
739739
:param warn: whether to output a warning in the logs when the flag was switched from
740740
`True` to `False`
@@ -769,10 +769,11 @@ def ensure_xmlid_match_record(cr, xmlid, model, values):
769769
found record. When no matching record is found, nothing is done. In all cases the
770770
referenced record, after a possible update, of the xml_id is returned.
771771
772-
:param str xmlid: record xml_id, under the format `module`.`name`
772+
:param str xmlid: record xml_id, under the format `module.name`
773773
:param str model: model name of the record
774774
:param dict values: mapping of field names to values the record must fulfill
775-
.. example:
775+
776+
.. example::
776777
777778
.. code-block:: python
778779
@@ -782,7 +783,7 @@ def ensure_xmlid_match_record(cr, xmlid, model, values):
782783
:return: the ID of the matched record, `None` if no record found
783784
:rtype: int or None
784785
785-
.. tip:
786+
.. tip::
786787
This function is useful when migrating in-database records into a custom module, to
787788
create the xml_ids before the module is updated and avoid duplication.
788789
"""
@@ -872,7 +873,7 @@ def update_record_from_xml(
872873
873874
Optionally this function can reset the translations of some fields.
874875
875-
:param str xmlid: record xml_id, under the format `module`.`name`
876+
:param str xmlid: record xml_id, under the format `module.name`
876877
:param bool reset_write_metadata: whether to update the `write_date` of the record
877878
:param bool force_create: whether the record is created if it does not exist
878879
:param str from_module: name of the module from which to update the record, necessary
@@ -882,12 +883,12 @@ def update_record_from_xml(
882883
:param bool ensure_references: whether referred records via `ref` XML attributes
883884
should also be updated.
884885
885-
.. warning:
886+
.. warning::
886887
This functions uses the ORM, therefore it can only be used after **all** models
887888
referenced in the data specs of the record are already **loaded**. In practice this
888889
means that this function should be used in `post-` or `end-` scripts.
889890
890-
.. note:
891+
.. note::
891892
The standard behavior of ORM is to create the record if it doesn't exist, including
892893
its xml_id. That will happen on this function as well.
893894
"""

0 commit comments

Comments
 (0)