From f3cb424a49fc68d3795f2400f795a256aa70a83e Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:22:33 +0300 Subject: [PATCH] Update internal_transaction.py --- .../exp_transaction_documents/models/internal_transaction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/models/internal_transaction.py b/odex25_transactions/exp_transaction_documents/models/internal_transaction.py index e786b8e1c..c8a121419 100644 --- a/odex25_transactions/exp_transaction_documents/models/internal_transaction.py +++ b/odex25_transactions/exp_transaction_documents/models/internal_transaction.py @@ -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()