Hi,
To restrict a QWeb report to only vendor payments in Odoo 17, add a domain to your report action XML. Locate the XML ID of your report action and insert a <field name="domain"> tag with the value [('payment_type', '=', 'outbound')]. This ensures the report is only visible for payments where the payment_type is "outbound," which typically represents vendor payments.
After modifying the XML, upgrade your module. The "Cheque / Receipt" report option should now only appear in the Print menu for vendor payments, disappearing for other payment types. Ensure your account.payment records have the correct payment_type values and clear your cache if needed.
Try the following.
<record id="your_module.action_report_cheque_receipt" model="ir.actions.report">
<field name="name">Cheque / Receipt</field>
<field name="model">account.payment</field>
<field name="report_type">qweb_pdf</field>
<field name="report_name">your_module.report_cheque_receipt_template</field>
<field name="report_file">your_module.report_cheque_receipt_template</field>
<field name="binding_model_id" ref="account.model_account_payment"/>
<field name="binding_type">report</field>
<field name="domain">[('payment_type', '=', 'outbound')]</field> <!-- Add this line -->
</record>
Hope it helps