From f506fc45a343fa93f85e055a85b55d4e9def89ff Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Fri, 9 May 2014 16:11:06 +0200 Subject: [PATCH 01/11] [MOV] ir.ui.view#write() forced noupdate moved in `website` (RTE only) bzr revid: fme@openerp.com-20140509141106-vbokuh0prptxavvg --- openerp/addons/base/ir/ir_ui_view.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index fbc2750d803..f52b44e077a 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -204,13 +204,6 @@ class view(osv.osv): self.read_template.clear_cache(self) ret = super(view, self).write(cr, uid, ids, vals, context) - - # if arch is modified views become noupdatable - if 'arch' in vals and not context.get('install_mode', False): - # TODO: should be doable in a read and a write - for view_ in self.browse(cr, uid, ids, context=context): - if view_.model_data_id: - self.pool.get('ir.model.data').write(cr, openerp.SUPERUSER_ID, view_.model_data_id.id, {'noupdate': True}) return ret def copy(self, cr, uid, id, default=None, context=None): From e70fc38f2fac33d138bbd3c6bbca1082ff720572 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 12 May 2014 09:59:19 +0200 Subject: [PATCH 02/11] [FIX] crm: The get_formview_id method does not expect a model arg anymore bzr revid: dle@openerp.com-20140512075919-ewldirr5ejd5py13 --- addons/crm/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 785f2a6e8ce..bf6ef242cc8 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -977,7 +977,7 @@ class crm_lead(format_address, osv.osv): if obj.type == 'opportunity': model, view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'crm', 'crm_case_form_view_oppor') else: - view_id = super(crm_lead, self).get_formview_id(cr, uid, id, model='crm.lead', context=context) + view_id = super(crm_lead, self).get_formview_id(cr, uid, id, context=context) return view_id def message_get_suggested_recipients(self, cr, uid, ids, context=None): From d34c54dbb6c034062743fa6bca7792d3f4e335c2 Mon Sep 17 00:00:00 2001 From: "Richard Mathot (OpenERP)" Date: Mon, 12 May 2014 16:20:48 +0200 Subject: [PATCH 03/11] [FIX] URL generation in blog template --- addons/website_blog/views/website_blog_templates.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml index fa6c6af53c6..7d7bdbf86a3 100644 --- a/addons/website_blog/views/website_blog_templates.xml +++ b/addons/website_blog/views/website_blog_templates.xml @@ -49,7 +49,7 @@

- +   From 023aa7acdf6eb859ada2f8c616fedf9dbc060c80 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 12 May 2014 18:34:55 +0200 Subject: [PATCH 04/11] [FIX] website_forum links which should not be, post-install crawler * move URLs of purely-JS-hook to data-href so the crawler does not try to access them (they're JSON-RPC endpoints...) * replace side-effecting links (...) by styled buttons * fix crawler to not take fragments in account when deduplicating and navigating URLs --- addons/website/tests/test_requests.py | 16 +++++++- .../static/src/css/website_forum.css | 4 ++ .../static/src/css/website_forum.sass | 3 ++ .../static/src/js/website_forum.js | 8 ++-- addons/website_forum/views/website_forum.xml | 38 ++++++++++++++----- 5 files changed, 54 insertions(+), 15 deletions(-) diff --git a/addons/website/tests/test_requests.py b/addons/website/tests/test_requests.py index 127aea274d5..e0309c9ab4b 100644 --- a/addons/website/tests/test_requests.py +++ b/addons/website/tests/test_requests.py @@ -41,6 +41,9 @@ class CrawlSuite(unittest2.TestSuite): starting the crawl """ + at_install = False + post_install = True + def __init__(self, user=None, password=None): super(CrawlSuite, self).__init__() @@ -108,14 +111,23 @@ class CrawlSuite(unittest2.TestSuite): for link in doc.xpath('//a[@href]'): href = link.get('href') + parts = urlparse.urlsplit(href) + # href with any fragment removed + href = urlparse.urlunsplit(( + parts.scheme, + parts.netloc, + parts.path, + parts.query, + '' + )) + # avoid repeats, even for links we won't crawl no need to # bother splitting them if we've already ignored them # previously if href in seen: continue seen.add(href) - parts = urlparse.urlsplit(href) - + # FIXME: handle relative link (not parts.path.startswith /) if parts.netloc or \ not parts.path.startswith('/') or \ parts.path == '/web' or\ diff --git a/addons/website_forum/static/src/css/website_forum.css b/addons/website_forum/static/src/css/website_forum.css index b90c1786e24..75befd62b1c 100644 --- a/addons/website_forum/static/src/css/website_forum.css +++ b/addons/website_forum/static/src/css/website_forum.css @@ -94,3 +94,7 @@ a.no-decoration { font: 1.2em "Helvetica Neue", Helvetica, Arial, sans-serif !important; height: 1.2em !important; } + +button.btn-link.text-muted { + color: #999999; +} diff --git a/addons/website_forum/static/src/css/website_forum.sass b/addons/website_forum/static/src/css/website_forum.sass index f8e46f06b79..d800d293de8 100644 --- a/addons/website_forum/static/src/css/website_forum.sass +++ b/addons/website_forum/static/src/css/website_forum.sass @@ -74,3 +74,6 @@ a.no-decoration .text-tags .text-tag .text-button font: 1.2em "Helvetica Neue", Helvetica, Arial, sans-serif !important height: 1.2em !important + +button.btn-link.text-muted + color: #999 diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index e84e76e14fa..0b45d4311c1 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -3,7 +3,7 @@ $(document).ready(function () { $('.vote_up ,.vote_down').on('click', function (ev) { ev.preventDefault(); var $link = $(ev.currentTarget); - openerp.jsonRpc($link.attr('href'), 'call', {}) + openerp.jsonRpc($link.data('href'), 'call', {}) .then(function (data) { if (data['error']){ if (data['error'] == 'own_post'){ @@ -47,7 +47,7 @@ $(document).ready(function () { $('.accept_answer').on('click', function (ev) { ev.preventDefault(); var $link = $(ev.currentTarget); - openerp.jsonRpc($link.attr('href'), 'call', {}).then(function (data) { + openerp.jsonRpc($link.data('href'), 'call', {}).then(function (data) { if (data['error']) { if (data['error'] == 'anonymous_user'){ var $warning = $('
'+ @@ -83,7 +83,7 @@ $(document).ready(function () { $('.favourite_question').on('click', function (ev) { ev.preventDefault(); var $link = $(ev.currentTarget); - openerp.jsonRpc($link.attr('href'), 'call', {}).then(function (data) { + openerp.jsonRpc($link.data('href'), 'call', {}).then(function (data) { if (data) { $link.addClass("forum_favourite_question") } else { @@ -96,7 +96,7 @@ $(document).ready(function () { $('.comment_delete').on('click', function (ev) { ev.preventDefault(); var $link = $(ev.currentTarget); - openerp.jsonRpc($link.attr('href'), 'call', {}).then(function (data) { + openerp.jsonRpc($link.data('href'), 'call', {}).then(function (data) { $link.parents('.comment').first().remove(); }); return true; diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index c73486d7d39..fbda6a40532 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -20,6 +20,14 @@ + + + -