[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
This commit is contained in:
Olivier Dony 2013-10-01 18:41:25 +02:00
parent a9158e5993
commit 51fe1e63e1
1 changed files with 8 additions and 0 deletions

View File

@ -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)