Skip to Content
Menu
This question has been flagged
3 Replies
1541 Views

Hello Community,

first I have to thank for this community. I've found already many advices for my issues here and I am very happy and thankful for this opportunity.

Now I am a bit confused (I'm not afraid of programming, maybe, it's because of thinking in a difficult than an easy way:

When I'm about to send an eMail via Odoo, I can select attachments to be uploaded and sent. I'd like to put exactly this "module" into my contacts, to handle any attachments to any contact (also below as tab "attachments"). But I am struggling with how to do that.


Sorry for this kind of foolish question. I would be very thankful to get some help from you.

Best regards from Germany

Vale 

Avatar
Discard

You want to select an existing attachment or want to add new one?

Best Answer

Hello Valentino,

You need to create a button to add the attachment to the mail as you get in the sale module of Odoo Core(https://prnt.sc/rbsxmk)
You can create a button via XML:

<button name="send_mail" string="Send Email" type="object"/>

After that you need to call the method:

Py File:

def send_mail(self):

    return {

                'type'                : 'ir.actions.act_window',

                'view_mode'     : 'form',

                'res_model'      : 'mail.compose.message',

                'views'              : [(False, 'form')],

                'view_id'           : False,

                'target'             : 'new',

                'context'           : {},

            }

You can also take the reference from https://github.com/odoo/odoo/blob/6f036e7580005afc4aca7f938b45dd81d1b2e2ad/addons/sale/models/sale.py#L684

Avatar
Discard
Author Best Answer

Hi Muhammed,

it is for new attachments. The database is empty as I am starting completely new to work with CE.

Hi Anisha,

tnank you for your reply. Think, it was a misunderstanding, sorry.
I don't want to send an eMail with an attachment. There should be only the page for attachments in my contacts, where I can upload and manage the files per contact. There is per se no need for the mail action. It should only be a storage for documents without any big DMS module. Just a simple solution for me. :-)

Like this:
https://de.share-your-photo.com/img/fd9b3f7f6c.jpg


Avatar
Discard

Hi Valentino,

To add tab you can override "mail.email_compose_message_wizard_form" view which is present inside mail model.

If you still have any doubt then you can mail us at support@webkul.com ; Our technical team will core assist you there.

Regards

Anisha