Merge pull request #6276 from expsa/samir_aladawi_add_cancel_button_history

[UPD] odex_takaful
This commit is contained in:
SamirLADOUI-sa 2026-01-20 20:56:15 +01:00 committed by GitHub
commit 54683766f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -257,6 +257,16 @@ class DonationExtensionHistory(models.Model):
'type': 'ir.actions.act_window',
}
def action_cancel_invoice(self):
self.ensure_one()
self.sudo().invoice_id.button_draft()
self.sudo().invoice_id.button_cancel()
self.write({
'state': 'cancel'
})
def action_print_extension_receipt(self):
"""Print the extension receipt PDF report."""
self.ensure_one()

View File

@ -31,6 +31,7 @@
<header>
<field name="state" widget="statusbar" statusbar_visible="active,paid,cancel" />
<button string="Pay" name="action_pay_invoice" type="object" class="oe_highlight" states="active"/>
<button string="Cancel" name="action_cancel_invoice" type="object" states="active"/>
<button
name="action_print_extension_receipt"
type="object"