Update outgoing_transaction.py

This commit is contained in:
zainab2097 2024-07-31 17:21:32 +03:00 committed by GitHub
parent 2177d76b23
commit a73ff3e40d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ class OutgoingTransaction(models.Model):
#
def unlink(self):
for record in self:
if record.state == 'send':
if record.state != 'draft':
raise ValidationError(_('Cannot delete a sent transaction!'))
return super(InternalTransaction, self).unlink()