commit
5bf83d74b3
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue