0

I want to attach Zip file in openerp. I see purchase order like that pdf is auto attached when the email widzard form is coming. But No idea how to create Email Widzard with attached file. I can create Zip file at backend but no idea how to put inside the widzard together with form.

Please guide if soemone have already done.

Thanks in advance. Phyo

1 Answers1

1

All attachments to emails are stored in the ir.attachments model. The basic procedure is to create your attachment in whatever binary format you like (png, zip, gzip etc...), then you base64 encode it. All attachments stored in OpenERP are base 64 encoded and the standard attachment functionality with encode and decode as required. If you are doing it by hand you must encode yourself. Emails have a many2many relationship with ir.attachments IIRC so you create a values dictionary for ir.attachments and write it along with the email using the magic numbers (6, 0, [list_of_value_dictionaries])

Adrian Merrall
  • 2,509
  • 12
  • 9