From d743ac0a8369860b950b3d137c2fa648585e070e Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Fri, 21 Feb 2014 18:46:08 +0530 Subject: [PATCH 001/214] [ADD] website_forum for question and answer bzr revid: tpa@tinyerp.com-20140221131608-e37a88h2u8ljkomr --- addons/website_event/controllers/main.py | 4 + addons/website_forum/__init__.py | 23 ++ addons/website_forum/__openerp__.py | 25 ++ addons/website_forum/controllers/__init__.py | 3 + addons/website_forum/controllers/main.py | 94 ++++++ addons/website_forum/data/forum_data.xml | 22 ++ addons/website_forum/data/forum_demo.xml | 71 +++++ addons/website_forum/doc/changelog.rst | 9 + addons/website_forum/doc/index.rst | 10 + addons/website_forum/models/__init__.py | 1 + addons/website_forum/models/forum.py | 85 +++++ .../security/ir.model.access.csv | 2 + .../website_forum/security/website_forum.xml | 6 + addons/website_forum/static/src/css/Makefile | 2 + .../static/src/css/website_forum.css | 55 ++++ .../static/src/css/website_forum.sass | 5 + .../static/src/js/website.tour.forum.js | 31 ++ .../static/src/js/website_forum.editor.js | 31 ++ .../static/src/xml/website_forum.xml | 7 + addons/website_forum/tests/__init__.py | 24 ++ addons/website_forum/tests/test_ui.py | 6 + addons/website_forum/views/website_forum.xml | 292 ++++++++++++++++++ 22 files changed, 808 insertions(+) create mode 100644 addons/website_forum/__init__.py create mode 100644 addons/website_forum/__openerp__.py create mode 100644 addons/website_forum/controllers/__init__.py create mode 100644 addons/website_forum/controllers/main.py create mode 100644 addons/website_forum/data/forum_data.xml create mode 100644 addons/website_forum/data/forum_demo.xml create mode 100644 addons/website_forum/doc/changelog.rst create mode 100644 addons/website_forum/doc/index.rst create mode 100644 addons/website_forum/models/__init__.py create mode 100644 addons/website_forum/models/forum.py create mode 100644 addons/website_forum/security/ir.model.access.csv create mode 100644 addons/website_forum/security/website_forum.xml create mode 100644 addons/website_forum/static/src/css/Makefile create mode 100644 addons/website_forum/static/src/css/website_forum.css create mode 100644 addons/website_forum/static/src/css/website_forum.sass create mode 100644 addons/website_forum/static/src/js/website.tour.forum.js create mode 100644 addons/website_forum/static/src/js/website_forum.editor.js create mode 100644 addons/website_forum/static/src/xml/website_forum.xml create mode 100644 addons/website_forum/tests/__init__.py create mode 100644 addons/website_forum/tests/test_ui.py create mode 100644 addons/website_forum/views/website_forum.xml diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index 2a6e1d134e3..21d259a3b70 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -35,6 +35,7 @@ import werkzeug.urls class website_event(http.Controller): @http.route(['/event/', '/event/page/'], type='http', auth="public", website=True, multilang=True) def events(self, page=1, **searches): + print "events----------------",self,page,searches cr, uid, context = request.cr, request.uid, request.context event_obj = request.registry['event.event'] type_obj = request.registry['event.type'] @@ -162,6 +163,7 @@ class website_event(http.Controller): @http.route(['/event//page/'], type='http', auth="public", website=True, multilang=True) def event_page(self, event, page, **post): + print "event_page-------------------" values = { 'event': event, 'main_object': event @@ -170,6 +172,7 @@ class website_event(http.Controller): @http.route(['/event/'], type='http', auth="public", website=True, multilang=True) def event(self, event, **post): + print "in event---------------" if event.menu_id and event.menu_id.child_id: target_url = event.menu_id.child_id[0].url else: @@ -180,6 +183,7 @@ class website_event(http.Controller): @http.route(['/event//register'], type='http', auth="public", website=True, multilang=True) def event_register(self, event, **post): + print "event_register-------------------" values = { 'event': event, 'main_object': event, diff --git a/addons/website_forum/__init__.py b/addons/website_forum/__init__.py new file mode 100644 index 00000000000..708d6ce4669 --- /dev/null +++ b/addons/website_forum/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-Today OpenERP SA (). +# +# 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 controllers +import models diff --git a/addons/website_forum/__openerp__.py b/addons/website_forum/__openerp__.py new file mode 100644 index 00000000000..5bc52222ba8 --- /dev/null +++ b/addons/website_forum/__openerp__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +{ + 'name': 'Forum', + 'category': 'Website', + 'summary': 'Ask Questions and give Answers', + 'version': '1.0', + 'description': """ +Ask questions, get answers, no distractions + """, + 'author': 'OpenERP SA', + 'depends': ['website', 'website_mail'], + 'data': [ + 'data/forum_data.xml', + 'views/website_forum.xml', + 'security/ir.model.access.csv', + 'security/website_forum.xml', + ], + 'qweb': ['static/src/xml/*.xml'], + 'demo': [ + 'data/forum_demo.xml' + ], + 'installable': True, + 'application': True, +} diff --git a/addons/website_forum/controllers/__init__.py b/addons/website_forum/controllers/__init__.py new file mode 100644 index 00000000000..bbd183e955b --- /dev/null +++ b/addons/website_forum/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +import main diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py new file mode 100644 index 00000000000..3605085188d --- /dev/null +++ b/addons/website_forum/controllers/main.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-Today OpenERP SA (). +# +# 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 SUPERUSER_ID +from openerp.addons.web import http +from openerp.addons.web.http import request +from openerp.tools.translate import _ +from openerp.addons.website.controllers.main import Website as controllers +controllers = controllers() + + +from datetime import datetime, timedelta +from dateutil.relativedelta import relativedelta +from openerp import tools +import werkzeug.urls + +class website_forum(http.Controller): + @http.route(['/question/', '/question/page/'], type='http', auth="public", website=True, multilang=True) + def questions(self, page=1, **searches): + print "questions----------------",self,page,searches + cr, uid, context = request.cr, request.uid, request.context + forum_obj = request.registry['website.forum.post'] + tag_obj = request.registry['website.forum.tag'] + + step = 5 + question_count = forum_obj.search( + request.cr, request.uid, [], count=True, + context=request.context) + pager = request.website.pager(url="/question/", total=question_count, page=page, step=step, scope=5) + + obj_ids = forum_obj.search( + request.cr, request.uid, [], limit=step, + offset=pager['offset'], context=request.context) + question_ids = forum_obj.browse(request.cr, request.uid, obj_ids, + context=request.context) + + print "question_ids----",question_ids + values = { + 'question_ids': question_ids, + 'pager': pager, + 'searches': searches, + } + + return request.website.render("website_forum.index", values) + + @http.route(['/question//page/'], type='http', auth="public", website=True, multilang=True) + def question_page(self, question, page, **post): + values = { + 'question': question, + 'main_object': question + } + return request.website.render(page, values) + + @http.route(['/question/'], type='http', auth="public", website=True, multilang=True) + def question_register(self, question, **post): + values = { + 'question': question, + 'main_object': question, + 'range': range, + } + return request.website.render("website_forum.question_description_full", values) + + @http.route('/question/add_question/', type='http', auth="user", multilang=True, methods=['POST'], website=True) + def add_question(self, question_name="New question", **kwargs): + return self._add_question(question_name, request.context, **kwargs) + + def _add_question(self, question_name=None, context={}, **kwargs): + if not question_name: + question_name = _("New Question") + Question = request.registry.get('website.forum.post') + date_begin = datetime.today() + timedelta(days=(14)) + vals = { + 'topic': question_name, + } + question_id = Question.create(request.cr, request.uid, vals, context=context) + return request.redirect("/question/%s/?enable_editor=1" % question_id) diff --git a/addons/website_forum/data/forum_data.xml b/addons/website_forum/data/forum_data.xml new file mode 100644 index 00000000000..bd6e56f673e --- /dev/null +++ b/addons/website_forum/data/forum_data.xml @@ -0,0 +1,22 @@ + + + + + + Questions + /question + + 40 + + + + + diff --git a/addons/website_forum/data/forum_demo.xml b/addons/website_forum/data/forum_demo.xml new file mode 100644 index 00000000000..92891bba371 --- /dev/null +++ b/addons/website_forum/data/forum_demo.xml @@ -0,0 +1,71 @@ + + + + + + How to configure alerts for employee contract expiration. + 45 + + + + How to get translated state through browse ? + Hello everybody, + +I use a XML-RPC to access to invoices, I want to get the states of invoices, but always I get paid instead of PayƩ (French) + 45 + + + + Restrain the user from confirming the Purchase requisition + 45 + Can anybody tell me how to restrict the user from confirming the purchase requisition? In my case when a user is creating a purchase requisition than the user after saving it is able to send it to the supplier rather I want the user to just generate the purchase requisition and let the manager do the remaining works like sending the purchase requisition to the supplier and than receiving the goods. Please help me out. Thanks in advance. + + + + Offline installing for add-ons + 45 + How can I install web based addons without Internet connections (I'm using OpenERP over LAN)? + +P.S. + +AFAIK current version (7.x) supports web interface while the desktop clients became deprecated. +BTW, I left OpenERP since ver. 6.x to use PostBooks instead but I recently decided to use OpenERP once again after recent new features. + + + + CMS replacement for ERP and eCommerce + 45 + I use Wordpress as a CMS and eCommerce platform. The developing in Wordpress is too easy and solid but it missing ERP feature (there is single plugin to integrate with Frontaccounting) so I wonder: + +Can I use OpenERP as a replacement CMS of Wordpress + eCommerce plugin? + +In simple words does OpenERP became CMS+ERP platform? + + + + Register payment using XMLRPC + 45 + Hi there, + +I have been trying to register an invoice payment through OpenERP. I have been able to manually create and approve the invoice, the voucher and its line + +I'm currently creating the voucher using this information: + + + + Create one field on two modules + 45 + Hello, + +I shall like creating a field "x" on an order form ( stock.picking.form ) and to reveal it also on the delivery slip ( stock.picking.form ). + +Thank you in advance + + + + access rights to one2many field + 45 + Now i create new group , assign user and access right as READ & CREATE to object stock.picking.ads but nothing is reflected , iam able to delete and write which should not happen. Very Strange!!! + + + diff --git a/addons/website_forum/doc/changelog.rst b/addons/website_forum/doc/changelog.rst new file mode 100644 index 00000000000..51036d22b70 --- /dev/null +++ b/addons/website_forum/doc/changelog.rst @@ -0,0 +1,9 @@ +.. _changelog: + +Changelog +========= + +`trunk (saas-3)` +---------------- + + - created ``website_forum`` diff --git a/addons/website_forum/doc/index.rst b/addons/website_forum/doc/index.rst new file mode 100644 index 00000000000..104e0473263 --- /dev/null +++ b/addons/website_forum/doc/index.rst @@ -0,0 +1,10 @@ +Website Forum Module documentation topics +''''''''''''''''''''''''''''''''''''''''' + +Changelog +''''''''' + +.. toctree:: + :maxdepth: 1 + + changelog.rst diff --git a/addons/website_forum/models/__init__.py b/addons/website_forum/models/__init__.py new file mode 100644 index 00000000000..55d2f069a75 --- /dev/null +++ b/addons/website_forum/models/__init__.py @@ -0,0 +1 @@ +import forum diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py new file mode 100644 index 00000000000..087e3a1e5ec --- /dev/null +++ b/addons/website_forum/models/forum.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-Today OpenERP SA (). +# +# 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.osv import osv, fields +from openerp import SUPERUSER_ID + +from openerp.tools.translate import _ +import re + +from openerp.addons.website.models.website import slug + +#class WebsiteForum(osv.Model): +# _inhrit = "website" + +class website_form_post_rate(osv.Model): + _name = "website.forum.post.rate" + _column = { + 'post_id': fields.many2one('website.forum.post', 'Forum Post'), + 'user_id': fields.many2one('res.users', 'User'), + 'rate': fields.integer('rate'), + } + +class website_forum_post(osv.Model): + _name = "website.forum.post" + _description = "Website forum post" + _inherit = ['mail.thread', 'website.seo.metadata'] + + _columns = { + #add version and category , instead of page use category in website, + 'name': fields.char('Topic', size=64), + 'body': fields.html('Contents', help='Automatically sanitized HTML contents'), + #'forum_id': fields.many2one('website.forum', 'Forum'), + 'create_date': fields.datetime('Created on', select=True, readonly=True), + 'create_uid': fields.many2one('res.users', 'Author', select=True, readonly=True ), + 'write_date': fields.datetime('Last Modified on', select=True, readonly=True ), + 'write_uid': fields.many2one('res.users', 'Last Contributor', select=True, readonly=True), + 'tags': fields.many2many('website.forum.tag', 'forum_tag_rel', 'forum_id', 'forum_tag_id', 'Tag'), + 'up_votes': fields.many2many('res.users', 'forum_user_upvotes_rel', 'forum_id', 'user_id', 'Up votes'), + 'favourite_que_ids': fields.many2many('res.users', 'forum_user_fav_rel', 'forum_id', 'user_id', 'Down votes'), + 'views': fields.integer('Views'), + 'state': fields.selection([('active', 'Active'),('close', 'Close'),('offensive', 'Offensive')], 'Status'), + 'parent_id': fields.many2one('website.forum.post', 'Parent'), + 'child_ids': fields.one2many('website.forum.post', 'parent_id', 'Child'), + # TODO FIXME: when website_mail/mail_thread.py inheritance work -> this field won't be necessary + 'website_message_ids': fields.one2many( + 'mail.message', 'res_id', + domain=lambda self: [ + '&', ('model', '=', self._name), ('type', '=', 'comment') + ], + string='Website Messages', + help="Website communication history", + ), + } + _defaults = { + 'state': 'active', + } + +class website_forum_tag(osv.Model): + _name = "website.forum.tag" + _description = "Website forum tag" + _inherit = ['website.seo.metadata'] + _columns = { + 'name': fields.char('Order Reference', size=64, required=True), + #'forum_id': fields.many2one('website.forum', 'Forum'), + 'post_ids': fields.many2many('website.forum.post', 'forum_tag_que_rel', 'tag_id', 'forum_id', 'Question', readonly=True), + } + diff --git a/addons/website_forum/security/ir.model.access.csv b/addons/website_forum/security/ir.model.access.csv new file mode 100644 index 00000000000..08145a00f54 --- /dev/null +++ b/addons/website_forum/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink + diff --git a/addons/website_forum/security/website_forum.xml b/addons/website_forum/security/website_forum.xml new file mode 100644 index 00000000000..b3570a73da0 --- /dev/null +++ b/addons/website_forum/security/website_forum.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/addons/website_forum/static/src/css/Makefile b/addons/website_forum/static/src/css/Makefile new file mode 100644 index 00000000000..8d2edfb2ed2 --- /dev/null +++ b/addons/website_forum/static/src/css/Makefile @@ -0,0 +1,2 @@ +sass: + sass --compass --unix-newlines -t expanded website_forum.sass:website_forum.css diff --git a/addons/website_forum/static/src/css/website_forum.css b/addons/website_forum/static/src/css/website_forum.css new file mode 100644 index 00000000000..46e39282f90 --- /dev/null +++ b/addons/website_forum/static/src/css/website_forum.css @@ -0,0 +1,55 @@ +@charset "utf-8"; +@import url(compass/css3.css); + +.MainBody{ + max-width: 700px; +} +.AskButton{ + float: right; +} +.search-navbar{ + width: 80%; +} +.user-profile-image{ + height: 32px; + width: 32px; +} +.action-links{ + margin-left: 10px; + margin-right: 10px; +} +.like{ + color: green; +} +.badge-gold{ + color : #FFD700; + text-shadow: 0px 0px 10px yellow; +} +.badge-silver{ + color : #C0C0C0; + text-shadow: 0px 0px 10px yellow; +} +.badge-bronze{ + color : #8c7853; + text-shadow: 0px 0px 10px yellow; +} +.-heading{ + background-color: #428bca; + color: white; +} +.user-name-pannel{ + height: 20px; +} +.custom-arrow-height{ + height: 15px; + } +.custom-vote-height{ + height: 30px; +} +.correct-answer{ + color: green; +} +.user-big-profile-image{ + height: 140px; + width: 140px; +} \ No newline at end of file diff --git a/addons/website_forum/static/src/css/website_forum.sass b/addons/website_forum/static/src/css/website_forum.sass new file mode 100644 index 00000000000..02b3490d630 --- /dev/null +++ b/addons/website_forum/static/src/css/website_forum.sass @@ -0,0 +1,5 @@ +@charset "utf-8" + +@import "compass/css3" + + diff --git a/addons/website_forum/static/src/js/website.tour.forum.js b/addons/website_forum/static/src/js/website.tour.forum.js new file mode 100644 index 00000000000..143996e5c38 --- /dev/null +++ b/addons/website_forum/static/src/js/website.tour.forum.js @@ -0,0 +1,31 @@ +(function () { + 'use strict'; + + var website = openerp.website; + var _t = openerp._t; + + website.EditorBar.include({ + start: function () { + this.registerTour(new website.QuestionTour(this)); + return this._super(); + }, + }); + + website.QuestionTour = website.Tour.extend({ + id: 'question', + name: "Create a question", + testPath: '/question(/[0-9]+/register)?', + init: function (editor) { + var self = this; + self.steps = [ + { + title: _t("Create a question"), + content: _t("Let's go through the first steps to create a new question."), + popover: { next: _("Start Tutorial"), end: _("Skip It") }, + }, + ]; + return this._super(); + } + }); + +}()); diff --git a/addons/website_forum/static/src/js/website_forum.editor.js b/addons/website_forum/static/src/js/website_forum.editor.js new file mode 100644 index 00000000000..fc4dd863739 --- /dev/null +++ b/addons/website_forum/static/src/js/website_forum.editor.js @@ -0,0 +1,31 @@ +(function() { + "use strict"; + + var website = openerp.website; + var _t = openerp._t; + website.add_template_file('/website_forum/static/src/xml/website_forum.xml'); + + website.is_editable = true; + website.EditorBar.include({ + start: function() { + website.is_editable_button = website.is_editable_button || !!$("#wrap.js_event").size(); + var res = this._super(); + this.$(".dropdown:has(.oe_content_menu)").removeClass("hidden"); + return res; + }, + events: _.extend({}, website.EditorBar.prototype.events, { + 'click a[data-action=new_question]': function (ev) { + ev.preventDefault(); + website.prompt({ + id: "editor_new_question", + window_title: _t("New Question"), + input: "Question Name", + }).then(function (question_name) { + website.form('/forum/add_question', 'POST', { + question_name: question_name + }); + }); + } + }), + }); +})(); diff --git a/addons/website_forum/static/src/xml/website_forum.xml b/addons/website_forum/static/src/xml/website_forum.xml new file mode 100644 index 00000000000..78042288b23 --- /dev/null +++ b/addons/website_forum/static/src/xml/website_forum.xml @@ -0,0 +1,7 @@ + + + +
  • New Question
  • +
    +
    +
    diff --git a/addons/website_forum/tests/__init__.py b/addons/website_forum/tests/__init__.py new file mode 100644 index 00000000000..3dcbf31d714 --- /dev/null +++ b/addons/website_forum/tests/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Business Applications +# Copyright (c) 20123TODAY OpenERP S.A. +# +# 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 test_ui + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/website_forum/tests/test_ui.py b/addons/website_forum/tests/test_ui.py new file mode 100644 index 00000000000..fe95435e4df --- /dev/null +++ b/addons/website_forum/tests/test_ui.py @@ -0,0 +1,6 @@ +import openerp.tests + +class TestUi(openerp.tests.HttpCase): + def test_admin(self): + self.phantom_js("/", "openerp.website.Tour.run_test('question')", "openerp.website.Tour") + diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml new file mode 100644 index 00000000000..f8fdc5e7d06 --- /dev/null +++ b/addons/website_forum/views/website_forum.xml @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6e2b5101d71e3874ccf13dec3ca4dbbfc120c293 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Sat, 22 Feb 2014 11:32:01 +0530 Subject: [PATCH 002/214] [IMP]: implement forum, post, and vote Change structure of the code and refactor code bzr revid: mga@tinyerp.com-20140222060201-k5f1h7fxi5w0vidb --- .../website_blog/views/website_blog_views.xml | 2 +- addons/website_forum/models/forum.py | 88 +++++++++++++------ 2 files changed, 61 insertions(+), 29 deletions(-) diff --git a/addons/website_blog/views/website_blog_views.xml b/addons/website_blog/views/website_blog_views.xml index 114c9d6961f..cd62070b255 100644 --- a/addons/website_blog/views/website_blog_views.xml +++ b/addons/website_blog/views/website_blog_views.xml @@ -104,7 +104,7 @@ - + Blogs blog.blog diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index 087e3a1e5ec..4809229db6c 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -27,59 +27,91 @@ import re from openerp.addons.website.models.website import slug -#class WebsiteForum(osv.Model): -# _inhrit = "website" +#TODO: do we need a forum object like blog object Need to check with BE team? +# class Forum(osv.Model): +# _name = 'blog.blog' +# _description = 'Blogs' +# _inherit = ['mail.thread', 'website.seo.metadata'] +# _order = 'name' +# +# _columns = { +# 'name': fields.char('Name', required=True), +# 'description': fields.text('Description'), +# 'forum_post_ids': fields.one2many( +# 'website.forum.post', 'forum_id', +# 'Posts', +# ), +# } -class website_form_post_rate(osv.Model): - _name = "website.forum.post.rate" - _column = { - 'post_id': fields.many2one('website.forum.post', 'Forum Post'), - 'user_id': fields.many2one('res.users', 'User'), - 'rate': fields.integer('rate'), - } - -class website_forum_post(osv.Model): +class Post(osv.Model): _name = "website.forum.post" - _description = "Website forum post" + _description = "Question" _inherit = ['mail.thread', 'website.seo.metadata'] _columns = { - #add version and category , instead of page use category in website, + #TODO: do we need a forum object like blog object Need to check with BE team? + #'forum_id': fields.many2one('website.forum', 'Forum'), + 'name': fields.char('Topic', size=64), 'body': fields.html('Contents', help='Automatically sanitized HTML contents'), - #'forum_id': fields.many2one('website.forum', 'Forum'), - 'create_date': fields.datetime('Created on', select=True, readonly=True), - 'create_uid': fields.many2one('res.users', 'Author', select=True, readonly=True ), - 'write_date': fields.datetime('Last Modified on', select=True, readonly=True ), - 'write_uid': fields.many2one('res.users', 'Last Contributor', select=True, readonly=True), + + 'create_date': fields.datetime('Asked on', select=True, readonly=True), + 'create_uid': fields.many2one('res.users', 'Asked by', select=True, readonly=True ), + 'write_date': fields.datetime('Update on', select=True, readonly=True ), + 'write_uid': fields.many2one('res.users', 'Update by', select=True, readonly=True), + 'tags': fields.many2many('website.forum.tag', 'forum_tag_rel', 'forum_id', 'forum_tag_id', 'Tag'), - 'up_votes': fields.many2many('res.users', 'forum_user_upvotes_rel', 'forum_id', 'user_id', 'Up votes'), - 'favourite_que_ids': fields.many2many('res.users', 'forum_user_fav_rel', 'forum_id', 'user_id', 'Down votes'), - 'views': fields.integer('Views'), + 'vote_ids':fields.one2many('website.forum.post.vote', 'Vote'), + + 'favourite_ids': fields.many2many('res.users', 'forum_favourite_rel', 'forum_id', 'user_id', 'Favourite'), + 'state': fields.selection([('active', 'Active'),('close', 'Close'),('offensive', 'Offensive')], 'Status'), + 'active': fields.boolean('Active'), + 'views': fields.integer('Views'), + 'parent_id': fields.many2one('website.forum.post', 'Parent'), 'child_ids': fields.one2many('website.forum.post', 'parent_id', 'Child'), + # TODO FIXME: when website_mail/mail_thread.py inheritance work -> this field won't be necessary 'website_message_ids': fields.one2many( 'mail.message', 'res_id', domain=lambda self: [ '&', ('model', '=', self._name), ('type', '=', 'comment') ], - string='Website Messages', - help="Website communication history", + string='Post Messages', + help="Comments on forum post", ), } _defaults = { 'state': 'active', + 'active': True } -class website_forum_tag(osv.Model): +class PostHistory(osv.Model): + _name = 'website.forum.post.history' + _description = "Post History" + _inherit = ['website.seo.metadata'] + _columns = { + 'post_id': fields.many2one('website.forum.post', 'Post'), + 'name': fields.char('Update Notes', size=64, required=True), + 'body': fields.html('Contents', help='Automatically sanitized HTML contents'), + 'tags': fields.many2many('website.forum.tag', 'forum_tag_rel', 'forum_id', 'forum_tag_id', 'Tag'), + } + +class Vote(osv.Model): + _name = "website.forum.post.vote" + _description = "Vote" + _column = { + 'post_id': fields.many2one('website.forum.post', 'Post'), + 'user_id': fields.many2one('res.users', 'User'), + 'vote': fields.integer('rate'), #Value in between wither +1 or -1 + } + +class Tags(osv.Model): _name = "website.forum.tag" - _description = "Website forum tag" + _description = "Tags" _inherit = ['website.seo.metadata'] _columns = { 'name': fields.char('Order Reference', size=64, required=True), - #'forum_id': fields.many2one('website.forum', 'Forum'), 'post_ids': fields.many2many('website.forum.post', 'forum_tag_que_rel', 'tag_id', 'forum_id', 'Question', readonly=True), - } - + } \ No newline at end of file From 90c5b7b847f4f780fecb325ac60ccd4a858afde8 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Sat, 22 Feb 2014 11:57:15 +0530 Subject: [PATCH 003/214] [IMP]: implement users profile data bzr revid: mga@tinyerp.com-20140222062715-whh482ljz4xke31b --- addons/website_forum/models/forum.py | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index 4809229db6c..94a5fb7e777 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -27,7 +27,7 @@ import re from openerp.addons.website.models.website import slug -#TODO: do we need a forum object like blog object Need to check with BE team? +#TODO: Do we need a forum object like blog object ? Need to check with BE team # class Forum(osv.Model): # _name = 'blog.blog' # _description = 'Blogs' @@ -43,6 +43,8 @@ from openerp.addons.website.models.website import slug # ), # } +#TODO: Need to implement badges and user profile + class Post(osv.Model): _name = "website.forum.post" _description = "Question" @@ -87,19 +89,35 @@ class Post(osv.Model): 'active': True } +class Users(osv.Model): + _inherit = 'res.users' + _columns = { + 'question_ids':fields.one2many('website.forum.post', 'create_uid', 'Questions', domain=[('parent_id','=',False)]), + 'answer_ids':fields.one2many('website.forum.post', 'create_uid', 'Answers', domain=[('parent_id','=',False), ('child_ids','=',True)]), + 'vote_ids': fields.one2many('website.forum.post.vote', 'user_id', 'Votes'), + #TODO: 'tag_ids':fields.function() + + #Badges : we will use the groups to define badges, two purpose will get solved + # - Define Groups as Badges with Forum as an Application + # - Access control + } + class PostHistory(osv.Model): _name = 'website.forum.post.history' - _description = "Post History" + _description = 'Post History' _inherit = ['website.seo.metadata'] _columns = { 'post_id': fields.many2one('website.forum.post', 'Post'), + 'create_date': fields.datetime('Created on', select=True, readonly=True), + 'create_uid': fields.many2one('res.users', 'Created by', select=True, readonly=True), + 'version': fields.integer('Version'), 'name': fields.char('Update Notes', size=64, required=True), 'body': fields.html('Contents', help='Automatically sanitized HTML contents'), 'tags': fields.many2many('website.forum.tag', 'forum_tag_rel', 'forum_id', 'forum_tag_id', 'Tag'), } class Vote(osv.Model): - _name = "website.forum.post.vote" + _name = 'website.forum.post.vote' _description = "Vote" _column = { 'post_id': fields.many2one('website.forum.post', 'Post'), @@ -109,9 +127,9 @@ class Vote(osv.Model): class Tags(osv.Model): _name = "website.forum.tag" - _description = "Tags" + _description = "Tag" _inherit = ['website.seo.metadata'] _columns = { 'name': fields.char('Order Reference', size=64, required=True), - 'post_ids': fields.many2many('website.forum.post', 'forum_tag_que_rel', 'tag_id', 'forum_id', 'Question', readonly=True), + 'post_ids': fields.many2many('website.forum.post', 'forum_tag_que_rel', 'tag_id', 'forum_id', 'Questions', readonly=True), } \ No newline at end of file From b353f7cf3b96bbea0b1db84279c96b2a7b7c798f Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Sat, 22 Feb 2014 22:49:37 +0530 Subject: [PATCH 004/214] [FIX]: installation of module, objects woring fine bzr revid: mga@tinyerp.com-20140222171937-l2yhwfypemmu8nfb --- addons/website_forum/__openerp__.py | 12 +++--- addons/website_forum/models/forum.py | 59 ++++++++++++++-------------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/addons/website_forum/__openerp__.py b/addons/website_forum/__openerp__.py index 5bc52222ba8..248a70f4cad 100644 --- a/addons/website_forum/__openerp__.py +++ b/addons/website_forum/__openerp__.py @@ -11,12 +11,14 @@ Ask questions, get answers, no distractions 'author': 'OpenERP SA', 'depends': ['website', 'website_mail'], 'data': [ - 'data/forum_data.xml', - 'views/website_forum.xml', - 'security/ir.model.access.csv', - 'security/website_forum.xml', +# 'data/forum_data.xml', +# 'views/website_forum.xml', +# 'security/ir.model.access.csv', +# 'security/website_forum.xml', + ], + 'qweb': [ +# 'static/src/xml/*.xml' ], - 'qweb': ['static/src/xml/*.xml'], 'demo': [ 'data/forum_demo.xml' ], diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index 94a5fb7e777..6ce5a24a531 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -19,40 +19,37 @@ # ############################################################################## -from openerp.osv import osv, fields -from openerp import SUPERUSER_ID - -from openerp.tools.translate import _ import re +from openerp import SUPERUSER_ID +from openerp.osv import osv, fields +from openerp.tools.translate import _ + from openerp.addons.website.models.website import slug #TODO: Do we need a forum object like blog object ? Need to check with BE team -# class Forum(osv.Model): -# _name = 'blog.blog' -# _description = 'Blogs' -# _inherit = ['mail.thread', 'website.seo.metadata'] -# _order = 'name' -# -# _columns = { -# 'name': fields.char('Name', required=True), -# 'description': fields.text('Description'), -# 'forum_post_ids': fields.one2many( -# 'website.forum.post', 'forum_id', -# 'Posts', -# ), -# } - -#TODO: Need to implement badges and user profile +class Forum(osv.Model): + _name = 'website.forum' + _description = 'Blogs' + _inherit = ['mail.thread', 'website.seo.metadata'] + _order = 'name' + + _columnss = { + 'name': fields.char('Name', required=True), + 'description': fields.text('Description'), + 'forum_post_ids': fields.one2many( + 'website.forum.post', 'forum_id', + 'Posts', + ), + } class Post(osv.Model): - _name = "website.forum.post" + _name = 'website.forum.post' _description = "Question" _inherit = ['mail.thread', 'website.seo.metadata'] _columns = { - #TODO: do we need a forum object like blog object Need to check with BE team? - #'forum_id': fields.many2one('website.forum', 'Forum'), + 'forum_id': fields.many2one('website.forum', 'Forum'), 'name': fields.char('Topic', size=64), 'body': fields.html('Contents', help='Automatically sanitized HTML contents'), @@ -63,7 +60,7 @@ class Post(osv.Model): 'write_uid': fields.many2one('res.users', 'Update by', select=True, readonly=True), 'tags': fields.many2many('website.forum.tag', 'forum_tag_rel', 'forum_id', 'forum_tag_id', 'Tag'), - 'vote_ids':fields.one2many('website.forum.post.vote', 'Vote'), + 'vote_ids':fields.one2many('website.forum.post.vote', 'post_id', 'Vote'), 'favourite_ids': fields.many2many('res.users', 'forum_favourite_rel', 'forum_id', 'user_id', 'Favourite'), @@ -91,13 +88,14 @@ class Post(osv.Model): class Users(osv.Model): _inherit = 'res.users' + _columns = { 'question_ids':fields.one2many('website.forum.post', 'create_uid', 'Questions', domain=[('parent_id','=',False)]), 'answer_ids':fields.one2many('website.forum.post', 'create_uid', 'Answers', domain=[('parent_id','=',False), ('child_ids','=',True)]), 'vote_ids': fields.one2many('website.forum.post.vote', 'user_id', 'Votes'), - #TODO: 'tag_ids':fields.function() - #Badges : we will use the groups to define badges, two purpose will get solved + # TODO: 'tag_ids':fields.function() + # Badges : we will use the groups to define badges, two purpose will get solved # - Define Groups as Badges with Forum as an Application # - Access control } @@ -118,11 +116,11 @@ class PostHistory(osv.Model): class Vote(osv.Model): _name = 'website.forum.post.vote' - _description = "Vote" - _column = { + _description = 'Vote' + _columns = { 'post_id': fields.many2one('website.forum.post', 'Post'), 'user_id': fields.many2one('res.users', 'User'), - 'vote': fields.integer('rate'), #Value in between wither +1 or -1 + 'vote': fields.integer('rate'), } class Tags(osv.Model): @@ -132,4 +130,5 @@ class Tags(osv.Model): _columns = { 'name': fields.char('Order Reference', size=64, required=True), 'post_ids': fields.many2many('website.forum.post', 'forum_tag_que_rel', 'tag_id', 'forum_id', 'Questions', readonly=True), - } \ No newline at end of file + } + \ No newline at end of file From 64adae08699a6df98b637d0c4a97539823f355ec Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Sat, 22 Feb 2014 23:07:59 +0530 Subject: [PATCH 005/214] [FIX]: module installaiton succesfuly bzr revid: mga@tinyerp.com-20140222173759-8x2k0ubf5i9r81pa --- addons/website_forum/__openerp__.py | 10 +- addons/website_forum/controllers/main.py | 19 +- addons/website_forum/data/forum_data.xml | 3 +- addons/website_forum/views/website_forum.xml | 629 +++++++++++-------- 4 files changed, 375 insertions(+), 286 deletions(-) diff --git a/addons/website_forum/__openerp__.py b/addons/website_forum/__openerp__.py index 248a70f4cad..e20e543264f 100644 --- a/addons/website_forum/__openerp__.py +++ b/addons/website_forum/__openerp__.py @@ -11,13 +11,13 @@ Ask questions, get answers, no distractions 'author': 'OpenERP SA', 'depends': ['website', 'website_mail'], 'data': [ -# 'data/forum_data.xml', -# 'views/website_forum.xml', -# 'security/ir.model.access.csv', -# 'security/website_forum.xml', + 'data/forum_data.xml', + 'views/website_forum.xml', + 'security/ir.model.access.csv', + 'security/website_forum.xml', ], 'qweb': [ -# 'static/src/xml/*.xml' + 'static/src/xml/*.xml' ], 'demo': [ 'data/forum_demo.xml' diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 3605085188d..dc09afbde30 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -19,23 +19,24 @@ # ############################################################################## +import werkzeug.urls + +from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.web import http -from openerp.addons.web.http import request + from openerp.tools.translate import _ -from openerp.addons.website.controllers.main import Website as controllers -controllers = controllers() - - from datetime import datetime, timedelta +from openerp.addons.web.http import request + from dateutil.relativedelta import relativedelta -from openerp import tools -import werkzeug.urls +from openerp.addons.website.controllers.main import Website as controllers + +controllers = controllers() class website_forum(http.Controller): @http.route(['/question/', '/question/page/'], type='http', auth="public", website=True, multilang=True) def questions(self, page=1, **searches): - print "questions----------------",self,page,searches cr, uid, context = request.cr, request.uid, request.context forum_obj = request.registry['website.forum.post'] tag_obj = request.registry['website.forum.tag'] @@ -51,8 +52,6 @@ class website_forum(http.Controller): offset=pager['offset'], context=request.context) question_ids = forum_obj.browse(request.cr, request.uid, obj_ids, context=request.context) - - print "question_ids----",question_ids values = { 'question_ids': question_ids, 'pager': pager, diff --git a/addons/website_forum/data/forum_data.xml b/addons/website_forum/data/forum_data.xml index bd6e56f673e..f5c92f0678a 100644 --- a/addons/website_forum/data/forum_data.xml +++ b/addons/website_forum/data/forum_data.xml @@ -3,11 +3,12 @@ - Questions + Support /question 40 + - + + - + - + - + - + - + - + - + - + - + + From 90953057aa54fab33f447a6cab83f6601ff8bc77 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Sat, 22 Feb 2014 23:24:29 +0530 Subject: [PATCH 006/214] [FIX]: change paths for the questions /qustions - list of questions /question/number - question page bzr revid: mga@tinyerp.com-20140222175429-ed2bf13rvihzlmpe --- addons/website_forum/controllers/main.py | 4 ++-- addons/website_forum/data/forum_data.xml | 2 +- .../website_forum/static/src/xml/website_forum.xml | 12 ++++++------ addons/website_forum/views/website_forum.xml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index dc09afbde30..59123708c4b 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -35,7 +35,7 @@ from openerp.addons.website.controllers.main import Website as controllers controllers = controllers() class website_forum(http.Controller): - @http.route(['/question/', '/question/page/'], type='http', auth="public", website=True, multilang=True) + @http.route(['/questions/', '/question/page/'], type='http', auth="public", website=True, multilang=True) def questions(self, page=1, **searches): cr, uid, context = request.cr, request.uid, request.context forum_obj = request.registry['website.forum.post'] @@ -45,7 +45,7 @@ class website_forum(http.Controller): question_count = forum_obj.search( request.cr, request.uid, [], count=True, context=request.context) - pager = request.website.pager(url="/question/", total=question_count, page=page, step=step, scope=5) + pager = request.website.pager(url="/questions/", total=question_count, page=page, step=step, scope=5) obj_ids = forum_obj.search( request.cr, request.uid, [], limit=step, diff --git a/addons/website_forum/data/forum_data.xml b/addons/website_forum/data/forum_data.xml index f5c92f0678a..a9d27e72a25 100644 --- a/addons/website_forum/data/forum_data.xml +++ b/addons/website_forum/data/forum_data.xml @@ -4,7 +4,7 @@ Support - /question + /questions 40 diff --git a/addons/website_forum/static/src/xml/website_forum.xml b/addons/website_forum/static/src/xml/website_forum.xml index 78042288b23..06728f9e5ef 100644 --- a/addons/website_forum/static/src/xml/website_forum.xml +++ b/addons/website_forum/static/src/xml/website_forum.xml @@ -1,7 +1,7 @@ - - -
  • New Question
  • -
    -
    -
    + + +
  • New Question
  • +
    +
    + \ No newline at end of file diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 6a8c3ea49de..d6f82f313c4 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -17,7 +17,7 @@ name="Footer Questions Link">
  • - Questions + Support
  • From ff29b7b42a944f2e8b461cb3c82941194c307f1e Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Sat, 22 Feb 2014 23:32:20 +0530 Subject: [PATCH 007/214] [IMP]: improve licance and rename file forum -> website_forum bzr revid: mga@tinyerp.com-20140222180220-e55rw4hf42iduyl4 --- addons/website_forum/__openerp__.py | 20 ++++++++++++++++ addons/website_forum/controllers/__init__.py | 19 +++++++++++++++ addons/website_forum/models/__init__.py | 23 ++++++++++++++++++- .../models/{forum.py => website_forum.py} | 0 addons/website_forum/tests/test_ui.py | 21 +++++++++++++++++ 5 files changed, 82 insertions(+), 1 deletion(-) rename addons/website_forum/models/{forum.py => website_forum.py} (100%) diff --git a/addons/website_forum/__openerp__.py b/addons/website_forum/__openerp__.py index e20e543264f..dbd183822b7 100644 --- a/addons/website_forum/__openerp__.py +++ b/addons/website_forum/__openerp__.py @@ -1,4 +1,24 @@ # -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-Today OpenERP SA (). +# +# 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': 'Forum', diff --git a/addons/website_forum/controllers/__init__.py b/addons/website_forum/controllers/__init__.py index bbd183e955b..46217e33563 100644 --- a/addons/website_forum/controllers/__init__.py +++ b/addons/website_forum/controllers/__init__.py @@ -1,3 +1,22 @@ # -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-Today OpenERP SA (). +# +# 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 main diff --git a/addons/website_forum/models/__init__.py b/addons/website_forum/models/__init__.py index 55d2f069a75..510e6b63aa0 100644 --- a/addons/website_forum/models/__init__.py +++ b/addons/website_forum/models/__init__.py @@ -1 +1,22 @@ -import forum +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-Today OpenERP SA (). +# +# 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 website_forum diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/website_forum.py similarity index 100% rename from addons/website_forum/models/forum.py rename to addons/website_forum/models/website_forum.py diff --git a/addons/website_forum/tests/test_ui.py b/addons/website_forum/tests/test_ui.py index fe95435e4df..8337c357c40 100644 --- a/addons/website_forum/tests/test_ui.py +++ b/addons/website_forum/tests/test_ui.py @@ -1,3 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-Today OpenERP SA (). +# +# 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 openerp.tests class TestUi(openerp.tests.HttpCase): From c19d3d2e003a4608bb03844f71045d9d40576db5 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Sat, 22 Feb 2014 23:56:48 +0530 Subject: [PATCH 008/214] [IMP]: improve, templates view need to fixed bzr revid: mga@tinyerp.com-20140222182648-vjljdx1zczenpe1y --- addons/website_forum/controllers/main.py | 2 +- addons/website_forum/views/website_forum.xml | 49 ++++++++++++-------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 59123708c4b..585e85a4b09 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -77,7 +77,7 @@ class website_forum(http.Controller): } return request.website.render("website_forum.question_description_full", values) - @http.route('/question/add_question/', type='http', auth="user", multilang=True, methods=['POST'], website=True) + @http.route('/question/askquestion/', type='http', auth="user", multilang=True, methods=['POST'], website=True) def add_question(self, question_name="New question", **kwargs): return self._add_question(question_name, request.context, **kwargs) diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index d6f82f313c4..49ffaf8ae4a 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -17,7 +17,7 @@ name="Footer Questions Link">
  • - Support + Support
  • @@ -25,7 +25,6 @@ - - + + + + From 45f6505bce99a20205073a4ba0743edb2727848d Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 24 Feb 2014 17:03:00 +0530 Subject: [PATCH 018/214] [IMP] improved template names bzr revid: tpa@tinyerp.com-20140224113300-9teri24n3xjitwpn --- addons/website_forum/controllers/main.py | 2 +- addons/website_forum/views/website_forum.xml | 26 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index f2a3a8eac57..36cf34af8ad 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -76,7 +76,7 @@ class website_forum(http.Controller): 'main_object': question, 'range': range, } - return request.website.render("website_forum.question_description_full", values) + return request.website.render("website_forum.post_description_full", values) @http.route('/question/postquestion/', type='http', auth="user", multilang=True, website=True) def post_question(self, question_name="New question", **kwargs): diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 386f740eb72..41ef4cda0de 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -23,7 +23,7 @@ -