diff options
| author | qmo-odoo <qmo@odoo.com> | 2019-09-24 08:46:10 +0000 |
|---|---|---|
| committer | Aurélien Warnon <awa@odoo.com> | 2019-09-25 14:06:24 +0000 |
| commit | 403bf9e76f92b9e8bb021a3c186704362edaa7b0 (patch) | |
| tree | ec5fed495f3c0fff804ae4196cfb2e432dcb450f /addons/website_links/models | |
| parent | c250df13f4480025b3f0b34f05e6f6074399f04d (diff) | |
[IMP] website_links, link_tracker: Add action buttons on tree view
This commit adds two buttons on the link.tracker tree view:
- Visit Page : Redirects the user to the visited page
- Statistics : Redirects to the page statistics
(with the '+' at the end of the shortened url)
In this commit we also add some padding to the graph of the page statistics
LINKS
closes odoo/odoo#37378
Taskid: 2075858
Pr: #37344
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_links/models')
| -rw-r--r-- | addons/website_links/models/__init__.py | 3 | ||||
| -rw-r--r-- | addons/website_links/models/link_tracker.py | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/addons/website_links/models/__init__.py b/addons/website_links/models/__init__.py new file mode 100644 index 00000000000..895d0b60b52 --- /dev/null +++ b/addons/website_links/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import link_tracker diff --git a/addons/website_links/models/link_tracker.py b/addons/website_links/models/link_tracker.py new file mode 100644 index 00000000000..82790bdd59e --- /dev/null +++ b/addons/website_links/models/link_tracker.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, _ + +class LinkTracker(models.Model): + _inherit = ['link.tracker'] + + def action_visit_page_statistics(self): + return { + 'name': _("Visit Webpage Statistics"), + 'type': 'ir.actions.act_url', + 'url': '%s+' % (self.short_url), + 'target': 'new', + } |
