diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-03-07 20:49:33 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-03-07 20:49:33 +0700 |
| commit | 521cc20f38fe4571f51345fbd7b5134c292f6fe0 (patch) | |
| tree | ce8851f6f23f5a21a7d427e38509d9c3034f6c70 | |
| parent | 8ae02f541b23a2d224094419333ed76f46eab402 (diff) | |
<Miqdad> cannot cancel invoice if already paid (ask finance to cancel payment)
| -rw-r--r-- | fixco_custom/models/account_move.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py index aa6d474..7cf030d 100644 --- a/fixco_custom/models/account_move.py +++ b/fixco_custom/models/account_move.py @@ -158,6 +158,8 @@ class AccountMove(models.Model): def button_cancel(self): if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 11]: raise UserError('Hanya Accounting yang bisa Cancel') + if self.state == 'posted' and self.payment_state == 'paid': + raise UserError('Invoice Sudah Lunas, Jika Ingin Cancel Hubungi Finance/Accounting untuk cancel pembayaran') res = super(AccountMove, self).button_cancel() return res |
