Update internal_transaction.py

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

View File

@ -59,7 +59,7 @@ class InternalTransaction(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()
@ -239,7 +239,7 @@ class InternalTransaction(models.Model):
return super(InternalTransaction, self).create(vals)
#
# def unlink(self):
# def (self):
# if self.env.uid != 1:
# raise ValidationError(_("You can not delete transaction....."))
# return super(InternalTransaction, self).unlink()