Update forward_trasaction.py

This commit is contained in:
zainab2097 2024-08-13 13:33:16 +03:00 committed by GitHub
parent 9abefd6b0f
commit 4f6a2dcd35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 7 deletions

View File

@ -48,13 +48,8 @@ class ForwardTransactionWizard(models.TransientModel):
# Handle attachment rule
if self.forward_attachment_id:
attachment = self.env['ir.attachment'].browse(self.forward_attachment_id.id)
transaction.attachment_rule_ids.create({
'file_save': attachment.datas, # Ensure this is binary data
'name': transaction.id,
'description': self.att_description,
'attachment_filename': attachment.name,
})
attachment = self.env['ir.attachment'].browse(self.forward_attachment_id.ids)
transaction.file_save = [(6, 0, attachment.ids)] # Ensure the attachment IDs are set correctly
# Create trace record
transaction.trace_ids.create({