From 63e54d7d76a3ea1869d40cfd1562ecf2626150cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=83=D8=A9=20=D8=AE=D8=A8=D9=8A=D8=B1=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D8=AD=D8=AF=D9=88=D8=AF=D8=A9?= Date: Tue, 30 Jul 2024 23:16:26 +0300 Subject: [PATCH 01/12] Update github action file --- .github/workflows/ensan-project.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ensan-project.yml b/.github/workflows/ensan-project.yml index cb81a85d8..cca317363 100644 --- a/.github/workflows/ensan-project.yml +++ b/.github/workflows/ensan-project.yml @@ -29,12 +29,12 @@ jobs: deploy_master_server: name: Deploy to Master runs-on: ensan-client-project-runner - if: github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0') + if: github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' steps: - name: Checkout And Restart Project run: | echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}" - sudo chmod +x ${{ secrets.ENSAN_PROJECT_PATH }}/scripts/pull_code.sh - sudo ${{ secrets.ENSAN_PROJECT_PATH }}/scripts/pull_code.sh ${{ secrets.ENSAN_PROJECT_USER }} ${{ secrets.ENSAN_PROJECT_PATH }} ${{ secrets.ENSAN_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} + sudo chmod +x ${{ secrets.ENSAN_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh + sudo ${{ secrets.ENSAN_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.ENSAN_PROJECT_USER }} ${{ secrets.ENSAN_STANDARD_FOLDER_PATH }} ${{ secrets.ENSAN_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} From 7fa9e09ca38f81b0f90bd4144fa0c1778790b90b Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:14:52 +0300 Subject: [PATCH 02/12] Update barcode.py --- .../cm_odex_barcode/models/barcode.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/odex25_transactions/cm_odex_barcode/models/barcode.py b/odex25_transactions/cm_odex_barcode/models/barcode.py index 1f30baf53..6e32b40ec 100644 --- a/odex25_transactions/cm_odex_barcode/models/barcode.py +++ b/odex25_transactions/cm_odex_barcode/models/barcode.py @@ -43,13 +43,6 @@ class Transaction(models.Model): img = Image.new("RGBA", (500, 420), "white") draw = ImageDraw.Draw(img) font = ImageFont.truetype(font_path, font_size) - - transaction_text = " رقم المعاملة : " + (self.name or '') - subject_text = " موضوع : " + (self.subject or '') - 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(100)+"\n"+h_date+'\n'+datem+'\n'+rank.center(60) def draw_text(draw, text, position, font, alignment="left"): text_size = draw.textsize(text, font=font) @@ -61,9 +54,10 @@ class Transaction(models.Model): draw.text(position, text, "black", font=font) - - draw_text(draw, full_text, (10, 20), font) - + draw_text(draw, " رقم المعاملة : " + (self.name or ''), (10, 20), font) + draw_text(draw, " تاريخ المعاملة الهجري : " + (self.transaction_date_hijri or '').replace('-', '/'), (10, 60), font) + draw_text(draw, " تاريخ المعاملة الميلادي : " + (str(self.transaction_date) if self.transaction_date else '').replace('-', '/'), (10, 100), font) + draw_text(draw, " الموضوع : " + (str(self.subject) if self.subject else ''), (120, 140), font) # Generate barcode From bbffa8022879a011f46af7f8bd7584e337573d53 Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:16:04 +0300 Subject: [PATCH 03/12] Update transcation_common_view.xml --- .../exp_transaction_documents/views/transcation_common_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odex25_transactions/exp_transaction_documents/views/transcation_common_view.xml b/odex25_transactions/exp_transaction_documents/views/transcation_common_view.xml index 973589639..6f0cc6212 100644 --- a/odex25_transactions/exp_transaction_documents/views/transcation_common_view.xml +++ b/odex25_transactions/exp_transaction_documents/views/transcation_common_view.xml @@ -51,7 +51,7 @@ attrs="{'required':True,'readonly':[('state','not in', ['draft'])]}" options="{'no_create':True}"/> - + From 3936cad4b334453748d282dd764bc5321c09540b Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:18:46 +0300 Subject: [PATCH 04/12] Update outgoing.xml --- .../exp_transaction_documents/views/outgoing.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odex25_transactions/exp_transaction_documents/views/outgoing.xml b/odex25_transactions/exp_transaction_documents/views/outgoing.xml index 0805f68af..7da79953c 100644 --- a/odex25_transactions/exp_transaction_documents/views/outgoing.xml +++ b/odex25_transactions/exp_transaction_documents/views/outgoing.xml @@ -9,6 +9,7 @@ + @@ -43,6 +44,7 @@ + From 2177d76b235fd38896a207ae57e60b67f25e3ade Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:19:16 +0300 Subject: [PATCH 05/12] Update outgoing_transaction.py --- .../exp_transaction_documents/models/outgoing_transaction.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py b/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py index 8388e82eb..f0853631b 100644 --- a/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py +++ b/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py @@ -17,6 +17,8 @@ class OutgoingTransaction(models.Model): incoming_transaction_id = fields.Many2one('incoming.transaction', string='Related Incoming') to_ids = fields.Many2many(comodel_name='cm.entity', relation='outgoing_entity_rel', column1='outgoing_id' , column2='entity_id', string='Send To') + company_name = fields.Many2one('res.partner',string='Delivery Company') + tran_tag = fields.Many2many(comodel_name='transaction.tag', string='Tags') tran_tag_unit = fields.Many2many(comodel_name='transaction.tag', string='Business unit', relation='outgoing_tag_rel', From a73ff3e40dc6dd24a05cfc5d54e37c6574a93bcf Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:21:32 +0300 Subject: [PATCH 06/12] Update outgoing_transaction.py --- .../exp_transaction_documents/models/outgoing_transaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py b/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py index f0853631b..fdd7aa829 100644 --- a/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py +++ b/odex25_transactions/exp_transaction_documents/models/outgoing_transaction.py @@ -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() 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 07/12] 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() From 041a2cbf21355995c84f031219eb3c15a6d97029 Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:22:55 +0300 Subject: [PATCH 08/12] Update entity.py --- odex25_transactions/exp_transaction_documents/models/entity.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/models/entity.py b/odex25_transactions/exp_transaction_documents/models/entity.py index 93ed0d330..7ba9193bd 100644 --- a/odex25_transactions/exp_transaction_documents/models/entity.py +++ b/odex25_transactions/exp_transaction_documents/models/entity.py @@ -16,8 +16,7 @@ class Entity(models.Model): _description = 'Transactions Contacts' _order = 'name' - employee_id = fields.Char(string='Delivery Employee') - company_name = fields.Char('Delivery Company') + def _normalize_arabic_text(self, text): translation_map = str.maketrans({ # Define a dictionary to replace different forms of characters From 7972b49fc6fb7957643b33a1373e81925216cfaa Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:23:25 +0300 Subject: [PATCH 09/12] Update entity.xml --- .../exp_transaction_documents/views/entity.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/views/entity.xml b/odex25_transactions/exp_transaction_documents/views/entity.xml index 795325655..919a31d94 100644 --- a/odex25_transactions/exp_transaction_documents/views/entity.xml +++ b/odex25_transactions/exp_transaction_documents/views/entity.xml @@ -49,11 +49,7 @@ - - - + From 3f7054d21f53b55063747522360f926d09eecadc Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:31:20 +0300 Subject: [PATCH 10/12] Update configuration.py --- .../models/configuration.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/odex25_transactions/exp_transaction_documents/models/configuration.py b/odex25_transactions/exp_transaction_documents/models/configuration.py index 8032d48b4..40394ead9 100644 --- a/odex25_transactions/exp_transaction_documents/models/configuration.py +++ b/odex25_transactions/exp_transaction_documents/models/configuration.py @@ -96,7 +96,17 @@ class AttachmentRule(models.Model): if record.file_save: file_size = len(base64.b64decode(record.file_save)) if file_size > max_size: - raise ValidationError(_('Attachment %s exceeds the maximum allowed size of 10 MB.') % record.attachment_filename) + raise ValidationError(_('Attachment %s exceeds the maximum allowed size of 4 MB.') % record.attachment_filename) + + @api.onchange('file_save') + def _onchange_file_save(self): + max_size = 4 * 1024 * 1024 # 4 MB + for record in self: + if record.file_save: + file_size = len(base64.b64decode(record.file_save)) + if file_size > max_size: + record.file_save = False + raise UserError(_('Attachment %s exceeds the maximum allowed size of 4 MB.') % record.attachment_filename) class TransactionTrace(models.Model): _name = 'cm.transaction.trace' From e948dd5029f289ff1b8ace9b7c2a09e43b9e6dc7 Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:39:11 +0300 Subject: [PATCH 11/12] Update receiver_transaction_report_template.xml --- .../receiver_transaction_report_template.xml | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/odex25_transactions/exp_transaction_documents/reports/receiver_transaction_report_template.xml b/odex25_transactions/exp_transaction_documents/reports/receiver_transaction_report_template.xml index 765325751..ae75a2568 100644 --- a/odex25_transactions/exp_transaction_documents/reports/receiver_transaction_report_template.xml +++ b/odex25_transactions/exp_transaction_documents/reports/receiver_transaction_report_template.xml @@ -172,20 +172,22 @@ paperformat="paperformat_transaction_receive_report" menu="True"/> - - - - - - - - - - - - - - + + + Custom Paper + + custom + 95 + 60 + Landscape + 5.00 + 5.00 + 5.0 + 5.0 + + 35 + 125 +