diff options
| author | Jeremy Kersten <jke@odoo.com> | 2017-01-11 18:36:33 +0100 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2017-02-24 08:51:26 +0100 |
| commit | 83bfdb0d212a99d808fa4d0dc9d3ebe3ce469a18 (patch) | |
| tree | b37440855ef18c062720cd561b8e9f3921938b09 /addons/website_project_issue/models | |
| parent | d89210e1fdddaa985c86eb147c043d49b626cfa7 (diff) | |
[IMP] website_portal*, website_project*, website_quote, website_blog: add record pager in portal
+ fix re-use websitue_url in get_access_action
Diffstat (limited to 'addons/website_project_issue/models')
| -rw-r--r-- | addons/website_project_issue/models/project_issue.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/website_project_issue/models/project_issue.py b/addons/website_project_issue/models/project_issue.py index d6d8916026a..24eef83c905 100644 --- a/addons/website_project_issue/models/project_issue.py +++ b/addons/website_project_issue/models/project_issue.py @@ -1,13 +1,19 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, exceptions, models, _ +from odoo import api, exceptions, models, fields class Issue(models.Model): _name = "project.issue" _inherit = ['project.issue'] + website_url = fields.Char('Website URL', compute='_compute_website_url', help='The full URL to access the document through the website.') + + def _compute_website_url(self): + for issue in self: + issue.website_url = '/my/issues/%s' % issue.id + @api.multi def get_access_action(self): """ Instead of the classic form view, redirect to website for portal users @@ -21,7 +27,7 @@ class Issue(models.Model): else: return { 'type': 'ir.actions.act_url', - 'url': '/my/issues/%s' % self.id, + 'url': self.website_url, 'target': 'self', 'res_id': self.id, } |
