115 lines
4.6 KiB
XML
115 lines
4.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data>
|
|
<!-- Customer Invoice Direct Print -->
|
|
<record id="action_direct_print_customer_invoice" model="ir.actions.server">
|
|
<field name="name">Direct Print Customer Invoice</field>
|
|
<field name="model_id" ref="account.model_account_move"/>
|
|
<field name="binding_model_id" ref="account.model_account_move"/>
|
|
<field name="binding_view_types">list,form</field>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
if records:
|
|
# Filter for customer invoices
|
|
invoices = records.filtered(lambda r: r.move_type in ['out_invoice', 'out_refund'])
|
|
if invoices:
|
|
action = {
|
|
'type': 'ir.actions.client',
|
|
'tag': 'direct_print',
|
|
'report_name': 'account.report_invoice',
|
|
'docids': invoices.ids,
|
|
'context': env.context,
|
|
}
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Vendor Bill Direct Print -->
|
|
<record id="action_direct_print_vendor_bill" model="ir.actions.server">
|
|
<field name="name">Direct Print Vendor Bill</field>
|
|
<field name="model_id" ref="account.model_account_move"/>
|
|
<field name="binding_model_id" ref="account.model_account_move"/>
|
|
<field name="binding_view_types">list,form</field>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
if records:
|
|
# Filter for vendor bills
|
|
bills = records.filtered(lambda r: r.move_type in ['in_invoice', 'in_refund'])
|
|
if bills:
|
|
action = {
|
|
'type': 'ir.actions.client',
|
|
'tag': 'direct_print',
|
|
'report_name': 'account.report_invoice',
|
|
'docids': bills.ids,
|
|
'context': env.context,
|
|
}
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Invoice with Payment Receipt Direct Print -->
|
|
<record id="action_direct_print_invoice_with_payments" model="ir.actions.server">
|
|
<field name="name">Direct Print Invoice with Payments</field>
|
|
<field name="model_id" ref="account.model_account_move"/>
|
|
<field name="binding_model_id" ref="account.model_account_move"/>
|
|
<field name="binding_view_types">list,form</field>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
if records:
|
|
# Filter for customer invoices
|
|
invoices = records.filtered(lambda r: r.move_type in ['out_invoice'])
|
|
if invoices:
|
|
action = {
|
|
'type': 'ir.actions.client',
|
|
'tag': 'direct_print',
|
|
'report_name': 'account.report_invoice_with_payments',
|
|
'docids': invoices.ids,
|
|
'context': env.context,
|
|
}
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Payment Receipt Direct Print -->
|
|
<record id="action_direct_print_payment_receipt" model="ir.actions.server">
|
|
<field name="name">Direct Print Payment Receipt</field>
|
|
<field name="model_id" ref="account.model_account_payment"/>
|
|
<field name="binding_model_id" ref="account.model_account_payment"/>
|
|
<field name="binding_view_types">list,form</field>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
if records:
|
|
# Filter for payments
|
|
payments = records.filtered(lambda r: r.state == 'posted')
|
|
if payments:
|
|
action = {
|
|
'type': 'ir.actions.client',
|
|
'tag': 'direct_print',
|
|
'report_name': 'account.action_report_payment_receipt',
|
|
'docids': payments.ids,
|
|
'context': env.context,
|
|
}
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Account Statement Direct Print -->
|
|
<record id="action_direct_print_account_statement" model="ir.actions.server">
|
|
<field name="name">Direct Print Account Statement</field>
|
|
<field name="model_id" ref="base.model_res_partner"/>
|
|
<field name="binding_model_id" ref="base.model_res_partner"/>
|
|
<field name="binding_view_types">list,form</field>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
if records:
|
|
# Filter for partners with accounting entries
|
|
partners = records.filtered(lambda r: r.customer_rank > 0 or r.supplier_rank > 0)
|
|
if partners:
|
|
action = {
|
|
'type': 'ir.actions.client',
|
|
'tag': 'direct_print',
|
|
'report_name': 'account.report_partnerledger',
|
|
'docids': partners.ids,
|
|
'context': env.context,
|
|
}
|
|
</field>
|
|
</record>
|
|
|
|
</data>
|
|
</odoo> |