From 51fe1e63e1572974e243f7eafe0fe86e72b26260 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 1 Oct 2013 18:41:25 +0200 Subject: [PATCH] [FIX] portal_sale: re-add auto-subscribe of customer when confirming invoice It was removed by mistake in commit [1] when fixing the forward-port of 7.0 to saas-1. Only the mail notification had to be removed, not the auto-follow of the customer, which is important in the portal, otherwise customers cannot see their invoices. [1] 8699 revid:chm@openerp.com-20130506135653-7e8nukr68s9255oq bzr revid: odo@openerp.com-20131001164125-1smk4mi3eulcbkab --- addons/portal_sale/portal_sale.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/portal_sale/portal_sale.py b/addons/portal_sale/portal_sale.py index 07300c5d463..11314704745 100644 --- a/addons/portal_sale/portal_sale.py +++ b/addons/portal_sale/portal_sale.py @@ -104,6 +104,14 @@ 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 + for invoice in self.browse(cr, uid, ids, context=context): + partner = invoice.partner_id + if partner.id not in invoice.message_follower_ids: + self.message_subscribe(cr, uid, [invoice.id], [partner.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)