From 356d18a097ca979a0f7592a6cdb2845f97bdd75d Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 6 May 2013 11:49:55 +0200 Subject: [PATCH] [FIX] An invite email to follow invoice is send to the customer before the real invoice. patch: remove invoice_validate method content of portal_sale bzr revid: chm@openerp.com-20130506094955-eppzx3fflb3g887j --- addons/portal_sale/portal_sale.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/addons/portal_sale/portal_sale.py b/addons/portal_sale/portal_sale.py index cd3b702d3c5..07300c5d463 100644 --- a/addons/portal_sale/portal_sale.py +++ b/addons/portal_sale/portal_sale.py @@ -104,25 +104,6 @@ class account_invoice(osv.Model): pass return action_dict - def invoice_validate(self, cr, uid, ids, context=None): - # 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) - mail_values = { - '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, - 'type': 'email', - } - 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], context=context) - return super(account_invoice, self).invoice_validate(cr, uid, ids, context=context) - def get_signup_url(self, cr, uid, ids, context=None): assert len(ids) == 1 document = self.browse(cr, uid, ids[0], context=context)