Merge pull request #2103 from expsa/transaction_12_1

Fix Bug in letters
This commit is contained in:
enagahh 2025-01-12 14:58:38 +02:00 committed by GitHub
commit b54a4cbdf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 4 deletions

View File

@ -90,12 +90,9 @@ class Letters(models.Model):
elif self.transaction_type == "incoming":
res_id = self.incoming_transaction_id.id
field_name = 'incoming_transaction_id'
file_exists = self.env['cm.attachment.rule'].search([(field_name, '=', res_id)])
file_exists = self.env['cm.attachment.rule'].search([(field_name, '=', res_id),('created_from_system','=',True)])
if file_exists:
file_exists.unlink()
# self.is_sign = True
# else:
# self.is_sign = False
ATTACHMENT_NAME = "Letter"
attach_id = self.env['ir.attachment'].create({
'name': ATTACHMENT_NAME + '.pdf',