Help

How to select an openerp attachment to send a new e-mail

Closed
Avatar
Felipe

The question has been closed

by
Felipe
on 08/12/2013 17:07:19

I have installed the document module, now I can manage the attachments and documents, but.

In the "compose a new message wizard", there is an attach button, but I can only select files from my local PC, and I want to be able to select an attachment from my openerp attachments repository(previously uploaded), how can I enable this option?

Avatar
Discard
3 Answers
2
Avatar
Felipe
Best Answer

As I did not found any configuration to make this, a simple code modification made the trick.

In the form view of the wizard replace

<field name="attachment_ids" widget="many2many_binary"/>

with

<field name="attachment_ids"/>

That's all

You can also have both options(widgets) if you create another attachment_ids2 field and add their values in the post_values inside function send_mail.

'attachments': [(attach.datas_fname or attach.name,base64.b64decode(attach.datas)) for attach in wizard.attachment_ids]+[(attach.datas_fname or attach.name, base64.b64decode(attach.datas)) for attach in  wizard.attachment_ids2],

Modifying the source code is not recommended, the good practice is to create a custom module than implements this.

Avatar
Discard
0
Avatar
Borni DHIFI
Best Answer

why not use the function share ? go to menu documents and share your document.

1 Comment
Avatar
Discard
Avatar
Felipe
-

that functionality is completely different, there you send a link and a username,password,database to share the openerp document and give permissions to edit or view

plus

  • share wizard doesn't have the partners relationship unlike mail.message

  • share wizard is not shown in every form view unlike mail.message

  • share wizard does not have the templates features

  • share wizard does not have the wysiwyg editor

  • you should be able to select more than one attachment per email

0
Avatar
Martin
Best Answer

Have a look at Settings >> Technical >> Low Level Objects >> Attachments.

That will allow you to edit existing attachments.

This might help too:

Can i attach existing file from google docs?

1 Comment
Avatar
Discard
Avatar
Felipe
-

yes, in that menu I can edit and manage the attachments, but that is not the question.