From ff44ed5aef5d9dd8b8e23683d9a876e2e91417b3 Mon Sep 17 00:00:00 2001 From: suriyan Date: Fri, 22 Apr 2016 22:40:53 +0700 Subject: [PATCH] [FIX] Page reference not exists if name was slugified (#220) [FIX] page not exists if name was slugified --- help_online/models/help_online.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/help_online/models/help_online.py b/help_online/models/help_online.py index 25e34fbb..79cea39b 100644 --- a/help_online/models/help_online.py +++ b/help_online/models/help_online.py @@ -34,10 +34,6 @@ class HelpOnline(models.TransientModel): name = '%s-%s' % (page_prefix, model.replace('.', '-')) return name - def page_exists(self, name): - website_model = self.env['website'] - return website_model.page_exists(name) - def get_page_url(self, model, view_type, domain=None, context=None): user_model = self.env['res.users'] if not user_model.has_group('help_online.help_online_group_reader'): @@ -48,8 +44,9 @@ class HelpOnline(models.TransientModel): if res: description = res[0][1] name = self._get_view_name(model, view_type, domain, context) - if self.page_exists(name): - url = '/page/%s' % name + website_model = self.env['website'] + url = '/page/' + website_model.page_for_name(name) + if website_model.page_exists(url): if view_type: url = url + '#' + view_type title = _('Help on %s') % description