From e7b583bc8e8185a60578f784a46433d75ed536d4 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (aka lmi)" Date: Mon, 19 Jan 2015 09:27:30 +0100 Subject: [PATCH 1/6] [ADD] New module website_blog_mgmt * This module lets you specify a date for the post at which it will be published (in the backend). * Posts on the website are ordered by publication date. * The order of posts is preserved when navigating between posts * Since it's HARD/not possible to extend controller without rewriting completly the overrided functions, the module also fixes https://github.com/odoo/odoo/pull/3097 (loop issue when pressing the next button on a blog page) --- website_blog_mgmt/__init__.py | 23 ++ website_blog_mgmt/__openerp__.py | 50 ++++ website_blog_mgmt/controllers/__init__.py | 21 ++ website_blog_mgmt/controllers/main.py | 217 ++++++++++++++++++ .../data/website_blog_mgmt_data.xml | 16 ++ website_blog_mgmt/models/__init__.py | 21 ++ website_blog_mgmt/models/website_blog.py | 73 ++++++ website_blog_mgmt/post_init.py | 35 +++ website_blog_mgmt/tests/__init__.py | 22 ++ .../tests/test_website_blog_flow.py | 129 +++++++++++ .../views/website_blog_views.xml | 28 +++ 11 files changed, 635 insertions(+) create mode 100644 website_blog_mgmt/__init__.py create mode 100644 website_blog_mgmt/__openerp__.py create mode 100644 website_blog_mgmt/controllers/__init__.py create mode 100644 website_blog_mgmt/controllers/main.py create mode 100644 website_blog_mgmt/data/website_blog_mgmt_data.xml create mode 100644 website_blog_mgmt/models/__init__.py create mode 100644 website_blog_mgmt/models/website_blog.py create mode 100644 website_blog_mgmt/post_init.py create mode 100644 website_blog_mgmt/tests/__init__.py create mode 100644 website_blog_mgmt/tests/test_website_blog_flow.py create mode 100644 website_blog_mgmt/views/website_blog_views.xml diff --git a/website_blog_mgmt/__init__.py b/website_blog_mgmt/__init__.py new file mode 100644 index 0000000000..ec5617f115 --- /dev/null +++ b/website_blog_mgmt/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laurent Mignon +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from . import models +from . import controllers +from .post_init import post_init diff --git a/website_blog_mgmt/__openerp__.py b/website_blog_mgmt/__openerp__.py new file mode 100644 index 0000000000..b35c67c552 --- /dev/null +++ b/website_blog_mgmt/__openerp__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laurent Mignon +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + 'name': 'Website blog Management', + 'version': '1.0', + 'author': 'ACSONE SA/NV', + 'maintainer': 'ACSONE SA/NV', + 'website': 'http://www.acsone.eu', + 'category': 'Website', + 'depends': [ + 'website_blog', + ], + 'description': """ +Website blog management +======================= +The module adds a new field to 'blog.post': website_publication_date. +The publication date is used to preserve the order in which posts are listed in +the web site when clicking on the menu 'News'. The same order is used in +the navigation between posts. +The publication date is filled when a post is published. It's also possible to +specify a specific value in the back-end. If the specified date is in the past, +the post is set to published, if the date is in the future the post will be +automatically published at the given date by a scheduled task. + """, + 'data': [ + 'data/website_blog_mgmt_data.xml', + 'views/website_blog_views.xml' + ], + 'installable': True, + 'auto_install': False, + 'post_init_hook': 'post_init', +} diff --git a/website_blog_mgmt/controllers/__init__.py b/website_blog_mgmt/controllers/__init__.py new file mode 100644 index 0000000000..0abf627c1f --- /dev/null +++ b/website_blog_mgmt/controllers/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laurent Mignon +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################# +from . import main diff --git a/website_blog_mgmt/controllers/main.py b/website_blog_mgmt/controllers/main.py new file mode 100644 index 0000000000..9bb4cf2e68 --- /dev/null +++ b/website_blog_mgmt/controllers/main.py @@ -0,0 +1,217 @@ +# -*- coding: utf-8 -*- +# include bug fix from rgo-odoo https://github.com/odoo/odoo/pull/3097 +# + remove specified order when calling blog_post.search + +from openerp.addons.web import http +from openerp.addons.web.http import request +from openerp.addons.website_blog.controllers.main import WebsiteBlog +from openerp.addons.website_blog.controllers.main import QueryURL +from openerp.addons.website.models.website import slug +from openerp import SUPERUSER_ID + + +class WebsiteBlog(WebsiteBlog): + _blog_post_per_page = 20 + _post_comment_per_page = 10 + + @http.route([ + '/blog/', + '/blog//page/', + '/blog//tag/', + '/blog//tag//page/', + ], type='http', auth="public", website=True) + def blog(self, blog=None, tag=None, page=1, **opt): + """ Prepare all values to display the blog. + + :return dict values: values for the templates, containing + + - 'blog': current blog + - 'blogs': all blogs for navigation + - 'pager': pager of posts + - 'tag': current tag + - 'tags': all tags, for navigation + - 'nav_list': a dict [year][month] for archives navigation + - 'date': date_begin optional parameter, used in archives navigation + - 'blog_url': help object to create URLs + """ + date_begin, date_end = opt.get('date_begin'), opt.get('date_end') + + cr, uid, context = request.cr, request.uid, request.context + blog_post_obj = request.registry['blog.post'] + + blog_obj = request.registry['blog.blog'] + blog_ids = blog_obj.search( + cr, uid, [], order="create_date asc", context=context) + blogs = blog_obj.browse(cr, uid, blog_ids, context=context) + + domain = [] + if blog: + domain += [('blog_id', '=', blog.id)] + if tag: + domain += [('tag_ids', 'in', tag.id)] + if date_begin and date_end: + domain += [("website_publication_date", ">=", date_begin), + ("website_publication_date", "<=", date_end)] + + blog_url = QueryURL( + '', ['blog', 'tag'], blog=blog, tag=tag, + date_begin=date_begin, date_end=date_end) + post_url = QueryURL( + '', ['blogpost'], tag_id=tag and tag.id or None, + date_begin=date_begin, date_end=date_end) + + blog_post_ids = blog_post_obj.search( + cr, uid, domain, context=context) + blog_posts = blog_post_obj.browse( + cr, uid, blog_post_ids, context=context) + + pager = request.website.pager( + url=blog_url(), + total=len(blog_posts), + page=page, + step=self._blog_post_per_page, + ) + pager_begin = (page - 1) * self._blog_post_per_page + pager_end = page * self._blog_post_per_page + blog_posts = blog_posts[pager_begin:pager_end] + + tags = blog.all_tags()[blog.id] + + values = { + 'blog': blog, + 'blogs': blogs, + 'tags': tags, + 'tag': tag, + 'blog_posts': blog_posts, + 'pager': pager, + 'nav_list': self.nav_list(), + 'blog_url': blog_url, + 'post_url': post_url, + 'date': date_begin, + } + response = request.website.render( + "website_blog.blog_post_short", values) + return response + + @http.route([ + '''/blog//post/ + + + + Publish blog post + 1 + minutes + -1 + + blog.post + cron_publish_posts + () + + + \ No newline at end of file diff --git a/website_blog_mgmt/models/__init__.py b/website_blog_mgmt/models/__init__.py new file mode 100644 index 0000000000..40ea5f3ca4 --- /dev/null +++ b/website_blog_mgmt/models/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laurent Mignon +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################# +from . import website_blog diff --git a/website_blog_mgmt/models/website_blog.py b/website_blog_mgmt/models/website_blog.py new file mode 100644 index 0000000000..9202d128f8 --- /dev/null +++ b/website_blog_mgmt/models/website_blog.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laurent Mignon +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################# + +from openerp import models, fields, api +from datetime import datetime + + +class BlogPost(models.Model): + _inherit = 'blog.post' + _order = 'website_publication_date DESC, id DESC' + + website_publication_date = fields.Datetime( + string='Published on', index=True, readonly=False) + + def _process_publication_date(self, vals): + """Check if a publication date is given and compute the + 'website_published' if the publication_date is < now + :param dict vals: + see :meth:`openerp.models.Model.write` for details + :return: modified dict vals + """ + if 'website_publication_date' in vals: + pub_date = vals.get('website_publication_date', False) + if pub_date: + pub_date_dt = fields.Datetime.from_string(pub_date) + vals['website_published'] = pub_date_dt < datetime.now() + else: + vals['website_published'] = False + elif 'website_published' in vals: + published = vals['website_published'] + if not published: + vals['website_publication_date'] = False + else: + vals['website_publication_date'] = fields.Datetime.now() + return vals + + @api.model + @api.returns('self', lambda value: value.id) + def create(self, vals): + vals = self._process_publication_date(vals) + return super(BlogPost, self).create(vals) + + @api.multi + def write(self, vals): + vals = self._process_publication_date(vals) + return super(BlogPost, self).write(vals) + + @api.model + def cron_publish_posts(self): + recs = self.search( + [('website_published', '=', False), + ('website_publication_date', '<=', fields.Datetime.now())]) + if len(recs): + return recs.write({'website_published': True}) + return True diff --git a/website_blog_mgmt/post_init.py b/website_blog_mgmt/post_init.py new file mode 100644 index 0000000000..b48a67c571 --- /dev/null +++ b/website_blog_mgmt/post_init.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laurent Mignon +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +def post_init(cr, registry): + """Install hook + fill website_publication_date field with create_date value for published + blog.post + """ + cr.execute(""" + UPDATE + blog_post + SET + website_publication_date = create_date + WHERE + website_published = true + """) diff --git a/website_blog_mgmt/tests/__init__.py b/website_blog_mgmt/tests/__init__.py new file mode 100644 index 0000000000..3350a051db --- /dev/null +++ b/website_blog_mgmt/tests/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laurent Mignon +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from. import test_website_blog_flow diff --git a/website_blog_mgmt/tests/test_website_blog_flow.py b/website_blog_mgmt/tests/test_website_blog_flow.py new file mode 100644 index 0000000000..8600f16ad3 --- /dev/null +++ b/website_blog_mgmt/tests/test_website_blog_flow.py @@ -0,0 +1,129 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Authors: Laurent Mignon +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import datetime +from openerp.addons.website_blog.tests.common import TestWebsiteBlogCommon +from openerp import fields +import time + + +class TestWebsiteBlogFlow(TestWebsiteBlogCommon): + + def setUp(self): + super(TestWebsiteBlogFlow, self).setUp() + self.blog_blog_obj = self.env['blog.blog'] + self.blog_post_obj = self.env['blog.post'] + # Create a new blog + self.test_blog = self.blog_blog_obj.sudo( + self.user_blogmanager).create({ + 'name': 'New Blog', + 'description': 'Presentation of new Odoo features' + }) + # Create a first post + self.test_blog_post_1 = self.blog_post_obj.sudo( + self.user_blogmanager).create({ + 'name': 'New Post 1', + 'blog_id': self.test_blog.id, + }) + # Create a second post + self.test_blog_post_2 = self.blog_post_obj.sudo( + self.user_blogmanager).create({ + 'name': 'New Post 2', + 'blog_id': self.test_blog.id, + }) + + def test_blog_post_publication(self): + """ Test the publication process + publication process : + + - when publishing a blog.post, the website_publication_date is filled + to now() + - when unpublishing a blog.post, the the website_publication_date is + set to null + - when updating a blog.post in the backend + - if the website_publication_date is set in the past, the blog.post + is published + - if the website_publication_date is removed, the blog.post + is unpublished + - if the website_publication_date is set in the future, a cron will + publish the blog.post at the expected date + """ + blog_ids = [self.test_blog_post_1.id, self.test_blog_post_2.id] + + # at creation post are not published and website_publication_date is + # no set + blogs = self.blog_post_obj.search( + [('id', 'in', blog_ids), + ('website_published', '=', False), + ('website_publication_date', '=', False)]) + self.assertIn(self.test_blog_post_1, blogs) + self.assertIn(self.test_blog_post_2, blogs) + self.assertEqual(len(blogs), 2) + + # when publishing, the publication date is set + self.test_blog_post_1.write({'website_published': True}) + self.assertTrue(self.test_blog_post_1.website_publication_date) + + # when unpublishing a blog.post, the the website_publication_date is + # set to None + self.test_blog_post_1.write({'website_published': False}) + self.assertFalse(self.test_blog_post_1.website_publication_date) + + # if the website_publication_date is set in the past, the blog.post + # is published + past_dt = datetime.datetime.now() - datetime.timedelta(hours=1) + past_dt = fields.Datetime.to_string(past_dt) + self.test_blog_post_1.write({'website_publication_date': past_dt}) + self.assertTrue(self.test_blog_post_1.website_published) + + # if the website_publication_date is removed, the blog.post is + # unpublished + self.test_blog_post_1.write({'website_publication_date': False}) + self.assertFalse(self.test_blog_post_1.website_published) + + # if the website_publication_date is set in the future, a cron will + # publish the blog.post at the expected date + future_dt = datetime.datetime.now() + datetime.timedelta(seconds=5) + future_dt = fields.Datetime.to_string(future_dt) + self.test_blog_post_1.write({'website_publication_date': future_dt}) + self.assertFalse(self.test_blog_post_1.website_published) + time.sleep(6) + self.blog_post_obj.cron_publish_posts() + self.test_blog_post_1.refresh() + self.assertTrue(self.test_blog_post_1.website_published) + + # by default,post are ordered by publication Date IOW, even if the + # post2 has been created after post1, since, the publication date is + # previous to the one of post1, the order is [post1, post2] + self.test_blog_post_2.write({'website_publication_date': past_dt}) + blogs = self.blog_post_obj.search( + [('id', 'in', blog_ids), + ('website_published', '=', True)]) + self.assertEqual( + blogs.ids, [self.test_blog_post_1.id, self.test_blog_post_2.id]) + + self.test_blog_post_2.write({'website_publication_date': future_dt}) + self.test_blog_post_1.write({'website_publication_date': past_dt}) + blogs = self.blog_post_obj.search( + [('id', 'in', blog_ids), + ('website_published', '=', True)]) + self.assertEqual( + blogs.ids, [self.test_blog_post_2.id, self.test_blog_post_1.id]) diff --git a/website_blog_mgmt/views/website_blog_views.xml b/website_blog_mgmt/views/website_blog_views.xml new file mode 100644 index 0000000000..c27e17cd69 --- /dev/null +++ b/website_blog_mgmt/views/website_blog_views.xml @@ -0,0 +1,28 @@ + + + + + + blog.post.list (website_blog_mgmt) + blog.post + + + + + + + + + + + blog.post.form (website_blog_mgmt) + blog.post + + + + + + + + + From 03b190664dd4b6a459ee0adcfc67ee3c62ce104e Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (aka lmi)" Date: Mon, 19 Jan 2015 09:37:05 +0100 Subject: [PATCH 2/6] Update TravisCI --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 54ffdc787a..f2aff49ecb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,20 +3,21 @@ language: python python: - "2.7" +env: + - LINT_CHECK="1" + - VERSION="8.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0" + - VERSION="8.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0" + - VERSION="8.0" ODOO_REPO="odoo/odoo" UNIT_TEST="1" LINT_CHECK="0" + virtualenv: system_site_packages: true -env: - - VERSION="8.0" ODOO_REPO="odoo/odoo" - - VERSION="8.0" ODOO_REPO="OCA/OCB" - install: - git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - travis_install_nightly script: - - travis_run_flake8 - travis_run_tests after_success: From 45f35c8421c0759a088c1ee2f09157933d030e0e Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (aka lmi)" Date: Mon, 19 Jan 2015 11:25:43 +0100 Subject: [PATCH 3/6] [IMP] Description --- website_blog_mgmt/README.rst | 39 ++++++ website_blog_mgmt/__openerp__.py | 12 -- .../static/description/index.html | 131 ++++++++++++++++++ 3 files changed, 170 insertions(+), 12 deletions(-) create mode 100644 website_blog_mgmt/README.rst create mode 100644 website_blog_mgmt/static/description/index.html diff --git a/website_blog_mgmt/README.rst b/website_blog_mgmt/README.rst new file mode 100644 index 0000000000..a30b092d45 --- /dev/null +++ b/website_blog_mgmt/README.rst @@ -0,0 +1,39 @@ +Website blog management +======================= + +This module was written to extend the functionality of blog.post to support a publication date +and allow you to better control the order in which posts are listed in +the web site when clicking on the menu 'News'. The same order is used in the navigation between posts. + +The publication date is filled when a post is published. It's also possible to +specify a specific value in the back-end. If the specified date is in the past, +the post is set to published, if the date is in the future the post will be +automatically published at the given date by a scheduled task. + +Usage +===== + +For further information, please visit: + + * https://www.odoo.com/forum/help-1 + +Credits +======= + +Contributors +------------ + +* Laurent Mignon + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/website_blog_mgmt/__openerp__.py b/website_blog_mgmt/__openerp__.py index b35c67c552..2206b4180b 100644 --- a/website_blog_mgmt/__openerp__.py +++ b/website_blog_mgmt/__openerp__.py @@ -28,18 +28,6 @@ 'depends': [ 'website_blog', ], - 'description': """ -Website blog management -======================= -The module adds a new field to 'blog.post': website_publication_date. -The publication date is used to preserve the order in which posts are listed in -the web site when clicking on the menu 'News'. The same order is used in -the navigation between posts. -The publication date is filled when a post is published. It's also possible to -specify a specific value in the back-end. If the specified date is in the past, -the post is set to published, if the date is in the future the post will be -automatically published at the given date by a scheduled task. - """, 'data': [ 'data/website_blog_mgmt_data.xml', 'views/website_blog_views.xml' diff --git a/website_blog_mgmt/static/description/index.html b/website_blog_mgmt/static/description/index.html new file mode 100644 index 0000000000..371613c4a0 --- /dev/null +++ b/website_blog_mgmt/static/description/index.html @@ -0,0 +1,131 @@ +
+
+
+

Module name

+

This module was written to extend the functionality of blog.post to support + a publication date and allow you to better control the order in which posts + are listed in the web site when clicking on the menu 'News'. The + same order is used in the navigation between posts.

+

The publication date is filled when a post is published. It's also possible to + specify a specific value in the back-end. If the specified date is in the past, + the post is set to published, if the date is in the future the post will be + automatically published at the given date by a scheduled task.

+
+
+
+ +
+
+
+

Installation

+
+
+

To install this module, you need to: +

    +
  • ...
  • +
+

+
+
+
+ + + +
+
+
+
+ +
+
+
+

Configuration

+
+
+

To configure this module, you need to: +

    +
  • ...
  • +
+

+
+
+
+ + + +
+
+
+
+ +
+
+
+

Usage

+
+
+

To use this module, you need to: +

    +
  • ...
  • +
+

+

For further information, please visit: +

+

+
+
+
+ + + +
+
+
+
+ +
+
+
+

Known issues / Roadmap

+
+
+

+

    +
  • ...
  • +
+

+
+
+
+ + + +
+
+
+
+ +
+
+
+

Credits

+
+
+

Contributors

+ +
+
+

Maintainer

+

+ This module is maintained by the OCA.
+ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
+ To contribute to this module, please visit http://odoo-community.org.
+ +

+
+
+
\ No newline at end of file From 5942c3551a65756de58c6e3f7372a1063345f1f3 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (aka lmi)" Date: Mon, 19 Jan 2015 11:53:40 +0100 Subject: [PATCH 4/6] [IMP] Description, remove unused section --- .../static/description/index.html | 80 +------------------ 1 file changed, 1 insertion(+), 79 deletions(-) diff --git a/website_blog_mgmt/static/description/index.html b/website_blog_mgmt/static/description/index.html index 371613c4a0..a0fab6478e 100644 --- a/website_blog_mgmt/static/description/index.html +++ b/website_blog_mgmt/static/description/index.html @@ -14,96 +14,18 @@

Module name

-
-
-
-

Installation

-
-
-

To install this module, you need to: -

    -
  • ...
  • -
-

-
-
-
- - - -
-
-
-
- -
-
-
-

Configuration

-
-
-

To configure this module, you need to: -

    -
  • ...
  • -
-

-
-
-
- - - -
-
-
-
-

Usage

-

To use this module, you need to: -

    -
  • ...
  • -
-

For further information, please visit:

-
-
- - - -
-
-
-
- -
-
-
-

Known issues / Roadmap

-
-
-

-

    -
  • ...
  • -
-

-
-
-
- - - -
-
@@ -115,7 +37,7 @@

Credits

Contributors

From 39d894432b990ecc432d29b4a9522ffe981270d7 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (aka lmi)" Date: Mon, 19 Jan 2015 12:21:52 +0100 Subject: [PATCH 5/6] [IMP] travis: remove very slow task --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f2aff49ecb..4539e58ce3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ env: - LINT_CHECK="1" - VERSION="8.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0" - VERSION="8.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0" - - VERSION="8.0" ODOO_REPO="odoo/odoo" UNIT_TEST="1" LINT_CHECK="0" virtualenv: system_site_packages: true From b7690c29ca45cf5d1ce0c17435da8006351ccc6b Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (aka lmi)" Date: Mon, 19 Jan 2015 16:25:04 +0100 Subject: [PATCH 6/6] [IMP] Use the website_publication_date in place of create_date in blog_post_short --- website_blog_mgmt/__openerp__.py | 3 ++- website_blog_mgmt/views/website_blog_templates.xml | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 website_blog_mgmt/views/website_blog_templates.xml diff --git a/website_blog_mgmt/__openerp__.py b/website_blog_mgmt/__openerp__.py index 2206b4180b..e039532855 100644 --- a/website_blog_mgmt/__openerp__.py +++ b/website_blog_mgmt/__openerp__.py @@ -30,7 +30,8 @@ ], 'data': [ 'data/website_blog_mgmt_data.xml', - 'views/website_blog_views.xml' + 'views/website_blog_views.xml', + 'views/website_blog_templates.xml', ], 'installable': True, 'auto_install': False, diff --git a/website_blog_mgmt/views/website_blog_templates.xml b/website_blog_mgmt/views/website_blog_templates.xml new file mode 100644 index 0000000000..aba40f275f --- /dev/null +++ b/website_blog_mgmt/views/website_blog_templates.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file