Launchpad automatic translations update.
[odoo/odoo.git] / bin / tools / test_reports.py
index 0e5d418..6e4b08e 100644 (file)
@@ -79,8 +79,8 @@ def try_report(cr, uid, rname, ids, data=None, context=None, our_module=None):
             res_text = tools.ustr(fp.read())
             os.unlink(rfname)
         except Exception:
-            log.warning("Cannot extract report's text:", exc_info=True)
-        
+            log.debug("Unable to parse PDF report: install pdftotext to perform automated tests.")
+
         if res_text is not False:
             for line in res_text.split('\n'):
                 if ('[[' in line) or ('[ [' in line):
@@ -197,6 +197,15 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None,
                 view_data.update(wiz_data)
             log.debug("View data is: %r", view_data)
 
+            for fk, field in view_res.get('fields',{}).items():
+                # Default fields returns list of int, while at create()
+                # we need to send a [(6,0,[int,..])]
+                if field['type'] in ('one2many', 'many2many') \
+                        and view_data.get(fk, False) \
+                        and isinstance(view_data[fk], list) \
+                        and not isinstance(view_data[fk][0], tuple) :
+                    view_data[fk] = [(6, 0, view_data[fk])]
+
             action_name = action.get('name')
             try:
                 from xml.dom import minidom
@@ -297,4 +306,4 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None,
 
     return True
 
-#eof
\ No newline at end of file
+#eof