[FIX[ portal_sale: fixed second call to amil_mail.send_mail()
bzr revid: tde@openerp.com-20130226173138-3z3lq00nceo46vdp
This commit is contained in:
@@ -119,12 +119,11 @@ class account_invoice(osv.Model):
|
||||
# fetch the partner's id and subscribe the partner to the invoice
|
||||
document = self.browse(cr, uid, ids[0], context=context)
|
||||
partner = document.partner_id
|
||||
# TDE note: this code should be improved: used a real invite wizard instead of an ugly email
|
||||
if partner.id not in document.message_follower_ids:
|
||||
self.message_subscribe(cr, uid, ids, [partner.id], context=context)
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
mail_values = {
|
||||
'email_from': user.partner_id.email,
|
||||
'email_to': partner.email,
|
||||
'recipient_ids': [(4, partner.id)],
|
||||
'subject': 'Invitation to follow %s' % document.name_get()[0][1],
|
||||
'body_html': 'You have been invited to follow %s' % document.name_get()[0][1],
|
||||
'auto_delete': True,
|
||||
@@ -132,7 +131,7 @@ class account_invoice(osv.Model):
|
||||
}
|
||||
mail_obj = self.pool.get('mail.mail')
|
||||
mail_id = mail_obj.create(cr, uid, mail_values, context=context)
|
||||
mail_obj.send(cr, uid, [mail_id], recipient_ids=[partner.id], context=context)
|
||||
mail_obj.send(cr, uid, [mail_id], context=context)
|
||||
return super(account_invoice, self).invoice_validate(cr, uid, ids, context=context)
|
||||
|
||||
def get_signup_url(self, cr, uid, ids, context=None):
|
||||
|
||||
Reference in New Issue
Block a user