From 1f2c7f5e56bb6011f8f3a13d6892c2995e334404 Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:11:58 +0300 Subject: [PATCH 1/3] Update barcode.py --- odex25_transactions/cm_odex_barcode/models/barcode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odex25_transactions/cm_odex_barcode/models/barcode.py b/odex25_transactions/cm_odex_barcode/models/barcode.py index 703b69270..ae5440001 100644 --- a/odex25_transactions/cm_odex_barcode/models/barcode.py +++ b/odex25_transactions/cm_odex_barcode/models/barcode.py @@ -49,7 +49,7 @@ class Transaction(models.Model): h_date =" تاريخ المعاملة الهجري : " +(str(self.transaction_date) if self.transaction_date else '') datem = " تاريخ المعاملة الميلادي : "+ (str(self.transaction_date) if self.transaction_date else '') rank = " رتبة المعاملة : "+(str(self.attachment_num) if self.attachment_num else '0') - full_text = transaction_text + "\n" + subject_text.center(30)+"\n"+h_date+'\n'+datem+'\n'+rank.center(50) + full_text = transaction_text + "\n" + subject_text.center(60)+"\n"+h_date+'\n'+datem+'\n'+rank.center(50) def draw_text(draw, text, position, font, alignment="left"): text_size = draw.textsize(text, font=font) From 008eef4e7c456ec6cd072fd7ea47a6ea7d04b4c8 Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:18:24 +0300 Subject: [PATCH 2/3] Update outgoing_transaction.py --- .../models/outgoing_transaction.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py b/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py index 6c14516e5..8388e82eb 100644 --- a/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py +++ b/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py @@ -92,6 +92,12 @@ class OutgoingTransaction(models.Model): #################################################### # # + def unlink(self): + for record in self: + if record.state == 'send': + raise ValidationError(_('Cannot delete a sent transaction!')) + return super(InternalTransaction, self).unlink() + def action_draft(self): for record in self: """her i need to review code for to_ids""" From 9a98f1c04d1196feeb30e05b666e835faf173d07 Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:29:11 +0300 Subject: [PATCH 3/3] Update configuration.py --- .../exp_transaction_documents/models/configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odex25_transactions/exp_transaction_documents/models/configuration.py b/odex25_transactions/exp_transaction_documents/models/configuration.py index 263dd15e3..8032d48b4 100644 --- a/odex25_transactions/exp_transaction_documents/models/configuration.py +++ b/odex25_transactions/exp_transaction_documents/models/configuration.py @@ -91,7 +91,7 @@ class AttachmentRule(models.Model): @api.constrains('file_save') def _check_attachment_size(self): - max_size = 10 * 1024 * 1024 # 10 MB + max_size = 4 * 1024 * 1024 # 4 MB for record in self: if record.file_save: file_size = len(base64.b64decode(record.file_save))