Automatically save PDFs

Hello everyone,

  1. How do I make so Logistical form PDF is saved in axelor « Documents »?
  2. How do I make so Stock move PDF is saved in axelor « Documents »?

I would expect it to work similar to Invoices, once invoice is ventilated it is automatically saved and I can find the PDF document in axelor « Documents ».

1 « J'aime »

Hello,

You can override the java method that call the ReportFactory in order to add a call of the method « toAttach(Model record) »

You can see the following example :

ReportFactory.createReport(IReport.SALES_ORDER, this.getFileName(saleOrder) + "-${date}")
    .addParam("SaleOrderId", saleOrder.getId())
    .addParam("...
    .toAttach(saleOrder)
    .generate()
    .getFileLink();

Regards