diff options
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index b188285d..9e7266b1 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -31,7 +31,8 @@ class AccountMove(models.Model): def unlink(self): res = super(AccountMove, self).unlink() - raise UserError('Data Hanya Bisa Di Cancel') + if self.state == 'posted': + raise UserError('Data Hanya Bisa Di Cancel') return res def button_cancel(self): |
