summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2011-10-11 19:11:48 +0200
committerOlivier Dony <odo@openerp.com>2011-10-11 19:11:48 +0200
commit76c702ca3cd271ec69a2be99660bdf6ff6a9a483 (patch)
treef32f831604e0ea6a1625a1fb9ddc20cb767ac2ad
parent4140e3546a9741d225369beddaa36beb76cd8704 (diff)
[FIX] Model.import_data docstring: cleanup + clear RST warnings for autodoc
The pipe character is taken as an inline substitution marker, and is easy to avoid in most cases except within literal blocks. bzr revid: odo@openerp.com-20111011171148-rluwokcsx7i38i6e
-rw-r--r--openerp/osv/orm.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py
index 2f924aceeb6..ad40ac66093 100644
--- a/openerp/osv/orm.py
+++ b/openerp/osv/orm.py
@@ -1175,8 +1175,7 @@ class BaseModel(object):
return {'datas': datas}
def import_data(self, cr, uid, fields, datas, mode='init', current_module='', noupdate=False, context=None, filename=None):
- """
- Import given data in given module
+ """Import given data in given module
This method is used when importing data via client menu.
@@ -1191,21 +1190,26 @@ class BaseModel(object):
order_line/product_uom_qty,
order_line/product_uom/id (=xml_id)
- This method returns a 4-tuple with the following structure:
+ This method returns a 4-tuple with the following structure::
- * The first item is a return code, it returns either ``-1`` in case o
+ (return_code, errored_resource, error_message, unused)
- :param cr: database cursor
- :param uid: current user id
- :param fields: list of fields
+ * The first item is a return code, it is ``-1`` in case of
+ import error, or the last imported row number in case of success
+ * The second item contains the record data dict that failed to import
+ in case of error, otherwise it's 0
+ * The third item contains an error message string in case of error,
+ otherwise it's 0
+ * The last item is currently unused, with no specific semantics
+
+ :param fields: list of fields to import
:param data: data to import
:param mode: 'init' or 'update' for record creation
:param current_module: module name
:param noupdate: flag for record creation
- :param context: context arguments, like lang, time zone,
:param filename: optional file to store partial import state for recovery
- :returns: 4-tuple of a return code, an errored resource, an error message and ???
- :rtype: (int, dict|0, str|0, ''|0)
+ :returns: 4-tuple in the form (return_code, errored_resource, error_message, unused)
+ :rtype: (int, dict or 0, str or 0, str or 0)
"""
if not context:
context = {}