From 6e5463dc8e5bd3a4fba111a0318dc43f140dc02d Mon Sep 17 00:00:00 2001 From: zainab2097 <149927291+zainab2097@users.noreply.github.com> Date: Mon, 22 Jul 2024 13:12:09 +0300 Subject: [PATCH] Update barcode.py --- .../cm_odex_barcode/models/barcode.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/odex25_transactions/cm_odex_barcode/models/barcode.py b/odex25_transactions/cm_odex_barcode/models/barcode.py index 46e3d6f21..df3eaff48 100644 --- a/odex25_transactions/cm_odex_barcode/models/barcode.py +++ b/odex25_transactions/cm_odex_barcode/models/barcode.py @@ -55,11 +55,15 @@ class Transaction(models.Model): draw.text(position, text, "black", font=font) # Draw text elements - # Draw text elements - 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.attachment_num) if self.attachment_num else '0'), (10, 140), 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.attachment_num) if self.attachment_num else '0')+ "رتبة المعاملة: " , (10, 140), 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.attachment_num) if self.attachment_num else '0'), (10, 140), font) # Generate barcode barcode = self.env['ir.actions.report'].barcode('Code11', self.name, width=250, height=100, humanreadable=0)