When I generate a report in pdf I create an attachment and I don't want it. I looked at the report module and found this:
# Save the pdf in attachment if marked
if reporthtml[0] is not False and save_in_attachment.get(reporthtml[0]):
with open(pdfreport_path, 'rb') as pdfreport:
attachment = {
'name': save_in_attachment.get(reporthtml[0]),
'datas': base64.encodestring(pdfreport.read()),
'datas_fname': save_in_attachment.get(reporthtml[0]),
'res_model': save_in_attachment.get('model'),
'res_id': reporthtml[0],
}
try:
self.env['ir.attachment'].create(attachment)
except AccessError:
_logger.info("Cannot save PDF report %r as attachment", attachment['name'])
else:
_logger.info('The PDF document %s is now saved in the database',
attachment['name'])
pdfdocuments.append(pdfreport_path)
except:
raise
# Save the pdf in attachment if marked
That means there's a check button that enables or disables the option, right?
EDIT: I would like to know how to disable it in both odoo 8 and odoo 10