diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-08-16 16:56:23 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-08-16 16:56:23 +0700 |
| commit | cf6d56ae71c8c45dbbc88c48bf83677ce5111eb7 (patch) | |
| tree | 67ac16274d9d66c31d334d0247575531764f92a9 | |
| parent | 7bbabfe4f79c2128a389890f4be593b98df7a44a (diff) | |
Update account move hanya bisa di delete jika status nya bukan posted
| -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): |
