以编程方式将订单报告下载到Odoo中的服务器

时间:2018-01-19 01:13:07

标签: odoo-10 odoo

是否有某种端点或获取资源可用于下载quotation_order打印输出报告?

我可以使用Odoo文档中的以下代码获取帐户发票:

private void generateReport(final Object reportId) throws XmlRpcException, IOException {
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<String, Object> result = (Map<String, Object>)models.execute(
  report_config, "render_report", asList(
    db, uid, password,
    "account.report_invoice",
    invoice_ids));
final byte[] report_data = DatatypeConverter.parseBase64Binary(
  (String)result.get("result"));

File file = new File("proposal/odooOutput.pdf");
byte[] bytes = Base64.decodeBase64(report_data);
FileUtils.writeByteArrayToFile(file, report_data);
}

但我不确定如何点击quotation_order(sale.order)打印输出:

enter image description here

1 个答案:

答案 0 :(得分:0)

想出来,这是我在Java中实现这个目标的方法:

File > Settings... > Editor > Code Style > "Hard Wrap at"

and

File > Settings... > Editor > Code Style > (your language) > Wrapping and Braces > Hard wrap at