Files
odoo_source/addons/website_project_issue/models/project_issue.py
T
Yannick Tivisse 0c2bbf6da6 [FIX] website_project_issue: Don't always display 'View Issue'
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.
2016-03-07 14:24:18 +01:00

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,
}