[FIX]FIX issue in reply
This commit is contained in:
parent
4eef9217e2
commit
f033fba071
|
|
@ -40,19 +40,21 @@ class TransactionReturnWizard(models.TransientModel):
|
|||
transaction.forward_user_id = transaction.employee_id.user_id.id
|
||||
transaction.state = 'reply'
|
||||
forward_entity = self.env['cm.entity'].search([('user_id', '=', transaction.forward_user_id.id)],limit=1)
|
||||
attachment = self.env['ir.attachment'].create({
|
||||
'name': self.filename,
|
||||
'datas': self.attachment_id,
|
||||
'type': 'binary',
|
||||
'res_model': 'cm.attachment.rule',
|
||||
'res_id': transaction.id,
|
||||
})
|
||||
transaction.attachment_rule_ids.create({
|
||||
'file_save': [(4, attachment.id)],
|
||||
# 'name': transaction.id,
|
||||
'description': self.att_description,
|
||||
'attachment_filename': self.filename,
|
||||
})
|
||||
# Check if attachment_id and filename are not empty before creating attachment
|
||||
if self.attachment_id and self.filename:
|
||||
attachment = self.env['ir.attachment'].create({
|
||||
'name': self.filename,
|
||||
'datas': self.attachment_id,
|
||||
'type': 'binary',
|
||||
'res_model': 'cm.attachment.rule',
|
||||
'res_id': transaction.id,
|
||||
})
|
||||
transaction.attachment_rule_ids.create({
|
||||
'file_save': [(4, attachment.id)],
|
||||
# 'name': transaction.id,
|
||||
'description': self.att_description,
|
||||
'attachment_filename': self.filename,
|
||||
})
|
||||
|
||||
transaction.trace_ids.create({
|
||||
'action': 'reply',
|
||||
|
|
|
|||
Loading…
Reference in New Issue