Update internal_transaction.py
This commit is contained in:
parent
a73ff3e40d
commit
f3cb424a49
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue