@@ -314,7 +314,7 @@ def remove_record(cr, name):
314
314
"""
315
315
Remove a record and its references corresponding to the given :term:`xml_id <external identifier>`.
316
316
317
- :param str name: record xml_id, under the format `module`.` name`
317
+ :param str name: record xml_id, under the format `module. name`
318
318
"""
319
319
if isinstance (name , basestring ):
320
320
if "." not in name :
@@ -630,8 +630,8 @@ def rename_xmlid(cr, old, new, noupdate=None, on_collision="fail"):
630
630
.. note::
631
631
This function does not remove records, it only updates xml_ids.
632
632
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`
635
635
:param bool or None noupdate: value to set on the `noupdate` flag of the xml_id,
636
636
ignored if `None`
637
637
:param str on_collision: how to proceed if the xml_id already exists, the options are
@@ -707,7 +707,7 @@ def ref(cr, xmlid):
707
707
"""
708
708
Return the id corresponding to the given :term:`xml_id <external identifier>`.
709
709
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`
711
711
:return: ID of the referenced record, `None` if not found.
712
712
:rtype: int or `None`
713
713
"""
@@ -734,7 +734,7 @@ def force_noupdate(cr, xmlid, noupdate=True, warn=False):
734
734
"""
735
735
Update the `noupdate` flag of a record.
736
736
737
- :param str xmlid: record xml_id, under the format `module`.` name`
737
+ :param str xmlid: record xml_id, under the format `module. name`
738
738
:param bool noupdate: value to set on the `noupdate` flag
739
739
:param warn: whether to output a warning in the logs when the flag was switched from
740
740
`True` to `False`
@@ -769,10 +769,11 @@ def ensure_xmlid_match_record(cr, xmlid, model, values):
769
769
found record. When no matching record is found, nothing is done. In all cases the
770
770
referenced record, after a possible update, of the xml_id is returned.
771
771
772
- :param str xmlid: record xml_id, under the format `module`.` name`
772
+ :param str xmlid: record xml_id, under the format `module. name`
773
773
:param str model: model name of the record
774
774
:param dict values: mapping of field names to values the record must fulfill
775
- .. example:
775
+
776
+ .. example::
776
777
777
778
.. code-block:: python
778
779
@@ -782,7 +783,7 @@ def ensure_xmlid_match_record(cr, xmlid, model, values):
782
783
:return: the ID of the matched record, `None` if no record found
783
784
:rtype: int or None
784
785
785
- .. tip:
786
+ .. tip::
786
787
This function is useful when migrating in-database records into a custom module, to
787
788
create the xml_ids before the module is updated and avoid duplication.
788
789
"""
@@ -872,7 +873,7 @@ def update_record_from_xml(
872
873
873
874
Optionally this function can reset the translations of some fields.
874
875
875
- :param str xmlid: record xml_id, under the format `module`.` name`
876
+ :param str xmlid: record xml_id, under the format `module. name`
876
877
:param bool reset_write_metadata: whether to update the `write_date` of the record
877
878
:param bool force_create: whether the record is created if it does not exist
878
879
:param str from_module: name of the module from which to update the record, necessary
@@ -882,12 +883,12 @@ def update_record_from_xml(
882
883
:param bool ensure_references: whether referred records via `ref` XML attributes
883
884
should also be updated.
884
885
885
- .. warning:
886
+ .. warning::
886
887
This functions uses the ORM, therefore it can only be used after **all** models
887
888
referenced in the data specs of the record are already **loaded**. In practice this
888
889
means that this function should be used in `post-` or `end-` scripts.
889
890
890
- .. note:
891
+ .. note::
891
892
The standard behavior of ORM is to create the record if it doesn't exist, including
892
893
its xml_id. That will happen on this function as well.
893
894
"""
0 commit comments