Hi,
Create a QWeb template for your PDF report
<?xml version="1.0"?>
<odoo>
<template id="report_account_move_custom">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<div class="page">
<h2>Account Move Report</h2>
<table class="table table-bordered">
<thead>
<tr>
<th>Customer Name</th>
<th>Invoice Number</th>
<th>Invoice Date</th>
<th>Due Date</th>
<th>Payment Status</th>
<th>Payment Date</th>
</tr>
</thead>
<tbody>
<tr>
<td><t t-esc="http://o.partner_id.name" target="_blank">o.partner_id.name"/></td>
<td><t t-esc="o.invoice_number"/></td>
<td><t t-esc="o.invoice_date"/></td>
<td><t t-esc="o.due_date"/></td>
<td><t t-esc="o.payment_status"/></td>
<td><t t-esc="o.payment_date"/></td>
</tr>
</tbody>
</table>
</div>
</t>
</t>
</t>
</template>
</odoo>
python:
from odoo import models, api
class AccountMoveCustomReport(models.AbstractModel):
_name = 'report.account_move_custom.report_account_move_custom'
_description = 'Account Move Custom Report'
@api.model
def _get_report_values(self, docids, data=None):
docs = self.env['account.move'].browse(docids)
return {
'doc_ids': docids,
'doc_model': 'account.move',
'docs': docs,
}
menu:
<record id="action_account_move_custom_report" model="ir.actions.act_window">
<field name="name">Account Move Custom Report</field>
<field name="type">ir.actions.act_url</field>
<field name="url">/report/pdf/account.move_custom_report</field>
<field name="target">new</field>
</record>
Hope it helps