diff options
| -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 |
