Guidance on adding an additional invoice/quote print option


Hi all,

I would like so guidance on the best way to achieve the following.
We have two different invoice/quote formats that get used depending on which brand the quote/sales happened via. We would therefore like to be able to print/email the correct invoice format for each sale. In our current system a sales can be assigned to a brand and this is used to generate the correct invoice/quote.

What we know so far
From what we have gathered so far there are two options.

  1. Create a template file that uses xpath to customise an existing report layout,
  2. Create a new module

1 looks like it can only be used to override an existing report rather than create a new report option? So there will be no new option to print/email Invoice1 or Invoice2 format?

2 Looks like we could just copy the existing invoice/quote report and make our modifications. Looks like the best option would be to generate a custom module with “flectra scaffold Invoice1 ./addons” and “flectra scaffold Invoice2 ./addons” and create a report directory and place some xml files in there. (We are still trying to figure out what the name of the file should be to integrate etc.)

If 2 is the correct way to go we need to be able to change the external_layout header to display a different log/slogan etc. but this is called in the report template so how do we override the header template just for report invoice1 and report invoice2? The body of the quote/invoice can remain unchanged. I think we can pass a parameter in the qweb t-call tag but this would mean we would need to modify the external_layout header file.

We are still trying to figure out how all the files in a module integrate with the felctra system in terms of menu integration, how files are found(by id?) etc so if the above questions make no sense please feel free to provide some hints. We are not sure why some xml files are under view directory and others under report when they both look like reports?


We would then need to create a reports folder and create a reports.xml file.