Add print button on mandate

This commit is contained in:
Alexis de Lattre
2021-02-17 21:36:38 +01:00
parent 1aedb56526
commit 6416e56c4e
2 changed files with 9 additions and 0 deletions

View File

@@ -114,3 +114,9 @@ class AccountBankingMandate(models.Model):
)
else:
logger.info("0 SDD Mandates had to be set to Expired")
def print_report(self):
self.ensure_one()
xmlid = "account_banking_sepa_direct_debit.report_sepa_direct_debit_mandate"
action = self.env.ref(xmlid).report_action(self)
return action

View File

@@ -12,6 +12,9 @@
<field name="model">account.banking.mandate</field>
<field name="inherit_id" ref="account_banking_mandate.view_mandate_form" />
<field name="arch" type="xml">
<button name="validate" position="before">
<button name="print_report" type="object" string="Print" />
</button>
<field name="partner_id" position="after">
<field
name="scheme"