This forum is now just an archive. Use the new Q&A website
It is currently Sat Apr 19, 2014 1:14 am

All times are UTC + 2 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 15 posts ] 
Author Message
 Post subject: Send email with default email client
PostPosted: Wed Nov 16, 2011 2:13 pm 
Offline

Joined: Wed Sep 15, 2010 8:04 pm
Posts: 9
Hello
I want sending email with attached document (sale order or invoice) to customer with default email client like thunderbird or ms Outlook.
Any solution? Thx


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Sat Mar 24, 2012 8:34 am 
Offline

Joined: Wed Jan 18, 2012 12:57 pm
Posts: 322
Location: cochin
this is possible with smtp-client but i dont know the case of ms outlook and thunderbird......

_________________
Regards,
Nightfury


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Sun Apr 01, 2012 11:14 am 
Offline

Joined: Mon Feb 21, 2011 5:38 pm
Posts: 20
Can you please help me how to send email with PDF attachment (eg. Sales order, Invoice ) with email_sales and smtp_client module.

Its working OK but can not attach any pdf.

Can you please help. Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Sun Apr 01, 2012 2:01 pm 
Offline

Joined: Sun Apr 01, 2012 6:01 am
Posts: 13
Location: Brazil
HI Arif,

So, when you configure OPenerp using gtk-client and or web-client (more easy way) you have the option to install the plugin for integration of M$ Outlook or Thunderbird and or Evolution emails client, once you install this plugin you will be integrating your email client with Openerp-Server via CalDav and WebDav, understood?

So, any email you has already setup on Openerp-server will be integrated, it means, if you send an email using your client the same message will be available on Openerp-server and by another hand any e-mail that you receive,if you setup according to action server rule can became and lead on synchronize with openerp or another kind of according your action server config.

Hope you can go ahead

Regards,

RootNuts

_________________
Image
Sandro Regis Cardoso
+55 11 4376-2818


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Mon Apr 02, 2012 6:14 am 
Offline

Joined: Wed Jan 18, 2012 12:57 pm
Posts: 322
Location: cochin
while configuring the server action at administration->customization->low level objects->server actions. there is a field to add reports. in that select Quotation / Order report to attach sale_order report.

_________________
Regards,
Nightfury


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Mon Apr 02, 2012 12:35 pm 
Offline

Joined: Thu Mar 29, 2012 5:49 pm
Posts: 8
Location: Lviv, Ukraine
arif_marias wrote:
Can you please help me how to send email with PDF attachment (eg. Sales order, Invoice ) with email_sales and smtp_client module.

Its working OK but can not attach any pdf.

Can you please help. Thanks in advance.


Faced the same issue when upgraded to v 6.1. There is bug in v6.1 where this part of functionality is missed in email_template wizard code. I have fixed this functionality, I am posting fixed code there today - https://bugs.launchpad.net/openobject-a ... bug/941428

In addition I have fixed this issue with attachment file names in base/ir.mail_server - topic31148.html

Let me know if this wworks for you?
Thanks!


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Mon Jun 25, 2012 6:56 pm 
Offline

Joined: Mon Feb 21, 2011 5:38 pm
Posts: 20
Thanks everyone. Helping me out.
Configured smtp and can send invoice, sales order, purchase order.
Need a bit twix in wizard/wizard_send_email.py file.
Here is the changed file for wizard_send_email.py file contents: (email_purchase Module)


import wizard
import pooler
import tools

from tools.translate import _
from osv import osv
import netsvc

email_send_form = '''<?xml version="1.0" encoding="utf-8"?>
<form string="Send purchase order/s by Email">
<field name="to" colspan="4"/>
<newline/>
<field name="subject" colspan="4"/>
<newline/>
<separator string="Message:" colspan="4"/>
<field name="text" nolabel="1" colspan="4"/>
</form>'''

email_send_fields = {
'to': {'string':"To", 'type':'char', 'size':512, 'required':True},
'subject': {'string':'Subject', 'type':'char', 'size':512, 'required':True},
'text': {'string':'Message', 'type':'text_tag', 'required':True}
}

email_done_form = '''<?xml version="1.0" encoding="utf-8"?>
<form string="Send purchase order/s by Email">
<field name="email_sent"/>
</form>'''

email_done_fields = {
'email_sent': {'string':'Quantity of Emails sent', 'type':'integer', 'readonly': True},
}


def _get_defaults(self, cr, uid, data, context):
p = pooler.get_pool(cr.dbname)
user = p.get('res.users').browse(cr, uid, uid, context)
orders = p.get(data['model']).browse(cr, uid, data['ids'], context)

# Calculate 'subject'
# Ensure subject is tranlated into partner's language.
current_lang = context.get('lang')
context['lang'] = orders[0].partner_id.lang or current_lang
subject = user.company_id.name + _('. Purchase Num.')
context['lang'] = current_lang

# Calculate 'text'
text = '\n--\n' + user.signature

# Calculate 'to'
adr_ids = []
partner_id = orders[0].partner_id.id
for o in orders:
if partner_id != o.partner_id.id:
raise osv.except_osv(_('Warning'), _('You have selected documents for different partners.'))
if o.name:
subject = subject + ' ' + o.name
if o.partner_ref:
text = o.partner_ref + '\n' + text
if o.partner_address_id.id not in adr_ids:
adr_ids.append(o.partner_address_id.id)
addresses = p.get('res.partner.address').browse(cr, uid, adr_ids, context)
to = []
for adr in addresses:
if adr.email:
name = adr.name or adr.partner_id.name
# The adr.email field can contain several email addresses separated by ,
to.extend(['%s <%s>' % (name, email) for email in adr.email.split(',')])
to = ','.join(to)

return {'to': to, 'subject': subject, 'text': text}


def create_report(cr, uid, res_ids, report_name=False, file_name=False):
if not report_name or not res_ids:
return (False, Exception('Report name and Resources ids are required !!!'))
try:
ret_file_name = 'C:\DOCUME~1\Arif\LOCALS~1\Temp'+file_name+'.pdf'
service = netsvc.LocalService("report."+report_name);
(result, format) = service.create(cr, uid, res_ids, {'model': 'purchase.order'}, {})
fp = open(ret_file_name, 'wb+');
try:
fp.write(result);
finally:
fp.close();
except Exception,e:
print 'Exception in create report:',e
return (False, str(e))
return (True, ret_file_name)


def _send_mails(self, cr, uid, data, context):
import re
p = pooler.get_pool(cr.dbname)

user = p.get('res.users').browse(cr, uid, uid, context)
file_name = user.company_id.name.replace(' ','_')+'_'+_('Purchase_Order')
purchase_smtpserver_id = p.get('email.smtpclient').search(cr, uid, [('type','=','purchase'),('state','=','confirm'),('active','=',True)], context=False)
if not purchase_smtpserver_id:
default_smtpserver_id = p.get('email.smtpclient').search(cr, uid, [('type','=','default'),('state','=','confirm'),('active','=',True)], context=False)
smtpserver_id = purchase_smtpserver_id or default_smtpserver_id
if smtpserver_id:
smtpserver_id = smtpserver_id[0]
else:
raise osv.except_osv(_('Error'), _('No SMTP Server has been defined!'))

# Create report to send as file attachments
report = create_report(cr, uid, data['ids'], data['model'], file_name)
attachments = report[0] and [report[1]] or []

nbr = 0
for email in data['form']['to'].split(','):
#print email, data['form']['subject'], data['ids'], data['model'], file_name, data['form']['text']
state = p.get('email.smtpclient').send_email(cr, uid, smtpserver_id, email, data['form']['subject'], data['form']['text'], attachments)
if not state:
raise osv.except_osv(_('Error sending email'), _('Please check the Server Configuration!'))
nbr += 1

# Add a partner event
docs = p.get(data['model']).browse(cr, uid, data['ids'], context)
partner_id = docs[0].partner_id.id
c_id = p.get('res.partner.canal').search(cr ,uid, [('name','ilike','EMAIL'),('active','=',True)])
c_id = c_id and c_id[0] or False
p.get('res.partner.event').create(cr, uid,
{'name': _('Email sent through purchase order wizard'),
'partner_id': partner_id,
'description': _('To: ').encode('utf-8') + data['form']['to'] +
_('\n\nSubject: ').encode('utf-8') + data['form']['subject'] +
_('\n\nText:\n').encode('utf-8') + data['form']['text'],
'document': data['model']+','+str(docs[0].id),
'canal_id': c_id,
'user_id': uid, })
return {'email_sent': nbr}


class send_email(wizard.interface):
states = {
'init': {
'actions': [_get_defaults],
'result': {'type': 'form', 'arch': email_send_form, 'fields': email_send_fields, 'state':[('end','Cancel'), ('send','Send Email')]}
},
'send': {
'actions': [_send_mails],
'result': {'type': 'form', 'arch': email_done_form, 'fields': email_done_fields, 'state': [('end', 'End')] }
}
}
send_email('purchase.order.email_send_2')

=========================================================

Now I have a new problem now.
I want to send sales, purchase order through email but from address should be the user email address. Means, when I send you sales order then from email address should be my one (ex: arif@gmail.com) and when other user login (e.g: Mike) then when he send email customer will see email came from Mike (ex: mike@gmail.com).

How to solve this. Every user has separate email id. Have you guys any idea about it?


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Tue Jul 10, 2012 1:11 pm 
Offline

Joined: Wed Apr 06, 2011 5:54 pm
Posts: 83
regarding "Now I have a new problem now.
I want to send sales, purchase order through email but from address should be the user email address. Means, when I send you sales order then from email address should be my one (ex: arif@gmail.com) and when other user login (e.g: Mike) then when he send email customer will see email came from Mike (ex: mike@gmail.com).

How to solve this. Every user has separate email id. Have you guys any idea about it?"

I thing it's a glitch.
I set user and sales departement ...
I create (the order might be important in this case !!) first user 1 with his email1and the corresponding departement1.
Then I create user 2 with his email2 and the corresponding departement2.

Off course the smtp server are correctly assigned to each template (for user1 and user2)
.
When I try to send email from user 2 (Sales order or invoice with template 2) the From_to is correct before sending the email (in message module), but I received the email with the user's email1). not great


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Tue Jul 10, 2012 1:19 pm 
Offline

Joined: Wed Jan 18, 2012 12:57 pm
Posts: 322
Location: cochin
which is the email id you have set as email_from while you configure the smtp server?

_________________
Regards,
Nightfury


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Tue Jul 10, 2012 1:41 pm 
Offline

Joined: Wed Apr 06, 2011 5:54 pm
Posts: 83
${object.section_id.reply_to} => for departement email


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Tue Jul 10, 2012 2:23 pm 
Offline

Joined: Wed Apr 06, 2011 5:54 pm
Posts: 83
do we have any personn face with this glitch. I got 6.1


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Wed Jul 11, 2012 11:53 am 
Offline

Joined: Wed Apr 06, 2011 5:54 pm
Posts: 83
any help


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Sat Aug 11, 2012 9:16 pm 
Offline

Joined: Wed May 16, 2012 7:12 am
Posts: 55
Location: Gandhinagar
Hello,

Please find attached link for my blog which is for configuring smtp in OpenERP.

http://intellectseed.wordpress.com/2012/05/31/how-to-configure-smtp-in-openerp/

This might be helpful.
Can contact us on info@intellectseed.com

Thanks,
IntellecTSeed Technologies.
http://www.intellectseed.com
Skype: intellectseed

_________________
Thanks
Acespritech Solutions Pvt. Ltd.
www.acespritech.com
info@acespritech.com
Skype:acespritech


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Wed Aug 29, 2012 10:14 am 
Offline

Joined: Wed Apr 06, 2011 5:54 pm
Posts: 83
intellectseed wrote:
Hello,

Please find attached link for my blog which is for configuring smtp in OpenERP.

http://intellectseed.wordpress.com/2012/05/31/how-to-configure-smtp-in-openerp/

This might be helpful.
Can contact us on info@intellectseed.com

Thanks,
IntellecTSeed Technologies.
http://www.intellectseed.com
Skype: intellectseed



Nice video but useless.

There is a glitch with multiple outgoing email server and email template see here
https://bugs.launchpad.net/openobject-a ... ug/1042781


Top
 Profile  
 
 Post subject: Re: Send email with default email client
PostPosted: Tue Oct 16, 2012 2:33 pm 
Offline

Joined: Tue Oct 09, 2012 1:18 pm
Posts: 85
Location: Largo, Florida, USA
I would also like these to not only write the emails sent out to the CRM but also into Outlook's sent file. We have lots of instances where having it available in sent makes sense because we can confirm the system actually sent and didn't bounce back. My concern with using pure SMTP (with no client attached) is that anything that gets sent back via POP3 or IMAP won't be checked and thus we'd have no way of knowing it went out.

Denis


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 15 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP