From 694f2d4b207739b8a095688782cebe59e73bb935 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 29 Mar 2018 15:28:07 +0200 Subject: [PATCH] [FIX] doc: report with xmlrpc The feature was removed in commit 3425752eaca236c1e. Closes #22540 opw-1824272 --- doc/webservices/odoo.rst | 84 ---------------------------------------- 1 file changed, 84 deletions(-) diff --git a/doc/webservices/odoo.rst b/doc/webservices/odoo.rst index dca8a317625..cabc6f87647 100644 --- a/doc/webservices/odoo.rst +++ b/doc/webservices/odoo.rst @@ -1295,90 +1295,6 @@ activated as actual fields on the model. } ] -Report printing ---------------- - -Available reports can be listed by searching the ``ir.actions.report`` -model, fields of interest being - -``model`` - the model on which the report applies, can be used to look for available - reports on a specific model -``name`` - human-readable report name -``report_name`` - the technical name of the report, used to print it - -Reports can be printed over RPC with the following information: - -* the name of the report (``report_name``) -* the ids of the records to include in the report - -.. container:: doc-aside - - .. switcher:: - - .. code-block:: python - - invoice_ids = models.execute_kw( - db, uid, password, 'account.invoice', 'search', - [[('type', '=', 'out_invoice'), ('state', '=', 'open')]]) - report = xmlrpclib.ServerProxy('{}/xmlrpc/2/report'.format(url)) - result = report.render_report( - db, uid, password, 'account.report_invoice', invoice_ids) - report_data = result['result'].decode('base64') - - .. code-block:: php - - $invoice_ids = $models->execute_kw( - $db, $uid, $password, - 'account.invoice', 'search', - array(array(array('type', '=', 'out_invoice'), - array('state', '=', 'open')))); - $report = ripcord::client("$url/xmlrpc/2/report"); - $result = $report->render_report( - $db, $uid, $password, - 'account.report_invoice', $invoice_ids); - $report_data = base64_decode($result['result']); - - .. code-block:: ruby - - require 'base64' - invoice_ids = models.execute_kw( - db, uid, password, - 'account.invoice', 'search', - [[['type', '=', 'out_invoice'], ['state', '=', 'open']]]) - report = XMLRPC::Client.new2("#{url}/xmlrpc/2/report").proxy - result = report.render_report( - db, uid, password, - 'account.report_invoice', invoice_ids) - report_data = Base64.decode64(result['result']) - - .. code-block:: java - - final Object[] invoice_ids = (Object[])models.execute( - "execute_kw", asList( - db, uid, password, - "account.invoice", "search", - asList(asList( - asList("type", "=", "out_invoice"), - asList("state", "=", "open"))) - )); - final XmlRpcClientConfigImpl report_config = new XmlRpcClientConfigImpl(); - report_config.setServerURL( - new URL(String.format("%s/xmlrpc/2/report", url))); - final Map result = (Map)client.execute( - report_config, "render_report", asList( - db, uid, password, - "account.report_invoice", - invoice_ids)); - final byte[] report_data = DatatypeConverter.parseBase64Binary( - (String)result.get("result")); - - .. note:: - - the report is sent as PDF binary data encoded in base64_, it must be - decoded and may need to be saved to disk before use .. _PostgreSQL: http://www.postgresql.org .. _XML-RPC: http://en.wikipedia.org/wiki/XML-RPC