Community mailing list archives

community@mail.odoo.com

Attaching local emails through Boolean fields

by
OpusVL, Peter Alabaster
- 01/28/2015 10:55:28
Hi developers, I have come across a problem.

On quotations and sales orders, we have several boolean fields. We also 
have several PDF attachments which correspond to these boolean fields.

When a tickbox is set to true on sale.order, we would like 
attachment_ids field in mail.message to not only include the drafted 
quotation pdf, but the pdf linked to the checkbox too..

e.g
Boolean field in sale.order 'include_new_user_form'

When true, clicking 'Send by email' will auto-attach new_user_form.pdf 
located on the server, to the quotation email.

Is there a simple way to do this?

I looked in Settings -> Technical -> email -> templates -> advanced 
settings -> optional report to print and attach

But these are restricted to reports generated in odoo itself.

The files we wish to attach are pdfs we cannot convert into generated 
Odoo reports.

Is there even a way to link a local pdf to a state where you can call it 
in python?

Many thanks.

Peter