This override was always sending the document to all the recipients. If the user is only a follower, he sees the button but cannot access to My Account as he's not a user.
22 lines
643 B
Python
22 lines
643 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from openerp import _, api, models
|
|
|
|
|
|
class Issue(models.Model):
|
|
_name = "project.issue"
|
|
_inherit = ['project.issue']
|
|
|
|
@api.multi
|
|
def get_access_action(self):
|
|
""" Override method that generated the link to access the document. Instead
|
|
of the classic form view, redirect to the post on the website directly """
|
|
self.ensure_one()
|
|
return {
|
|
'type': 'ir.actions.act_url',
|
|
'url': '/my/issues/%s' % self.id,
|
|
'target': 'self',
|
|
'res_id': self.id,
|
|
}
|