OCA / l10n-switzerland

Odoo Swiss localization
GNU Affero General Public License v3.0
53 stars 164 forks source link

Add a way to re-use payment slip on a Qweb report #530

Closed sebastienhasa closed 2 years ago

sebastienhasa commented 5 years ago

Actually, PaymentSlip._draw_payment_slip(), in l10n_ch_payment_slip/models/payment_slip.py:828, only return a finished PDF document. This prevent payment slip to be include in a standard Qweb report.

It would be great to add a possibility to use a payment slip on a Qweb report.

yvaucher commented 5 years ago

Have you seen module https://github.com/OCA/l10n-switzerland/tree/12.0/l10n_ch_invoice_with_payment ?

By the way, note that ISR payment slip will be replaced by QR-invoice in may 2020

sebastienhasa commented 5 years ago

@yvaucher: Thanks. :)

After looking at the code of l10n_ch_invoice_with_payment, when you render the report "Invoice with payment slip", the code simply render the invoice and the payment slip, then merge it with merge_pdf_in_memory(). This method is added to the model ir.actions.report at l10n_ch_payment_slip/report/ir_action.py:L151.

So, if someone need to add a payment slip on a Qweb report, he can simply draw inspiration from the code at l10n_ch_invoice_with_payment/models/report.py:L11.

It would by nice to document it, somewhere easy to find. ;)

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.