This question has been flagged
1 Reply
10533 Views

I am developing a report by inherit it stock picking report "Operation", i want to add a table on every page of report.

Below IS My Table Data:

Source Location Store Manager Document No Received Date Printing Date State

Partner Locations/Vendors Administrator SR/IN/00002 07/11/2018 05:43:39 11/07/2018 Ready

Avatar
Discard
Best Answer

Not sure which version you are using, but in Odoo 11

The report action is defined in file 'stock/report/stock_report_views.xml', which calls template 'report_picking' in file 'stock/report/report_stockpicking_operations.xml'

The header is pulled by line 8, <t t-call="web.external_layout">

So to add content on every page, you can make new external_layout in your own module, and define headers/footers there, just like the original code.
Remember to either override existing action with proper attributes such as naming and paperformat if needed.  Also, override the template 'report_picking' with <t t-call="mymodule.external_layout">

The original external_layout code is located at 'web/views/report_templates.xml', you can use that as a reference to make your own layout or just override external_layout but by doing so, all other reports will be changed as well.  Basically, in Odoo setting there's a style you can choose, external_layout by default reads which style and pass it to another template of style.  The headers/footers are different in each style.

FYI, there's also a great addon by OCA called 'Report Qweb Element Page Visibility' , this addon adds javascript for new classes such as last-page or not-first-page, for your header/footer needs.  For Odoo 11, you need to rename 'report' to 'web' for all the references in the code, since Odoo 11 change naming from Odoo 10.  It supports down to v8 as well.


Avatar
Discard