summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrushti Patel <shp@odoo.com>2015-09-09 16:46:45 +0530
committerDavid Monjoie <dmo@odoo.com>2016-04-08 13:54:06 +0200
commitb88060e5bae0d239a2b7879b9661d015ec9df3b9 (patch)
tree0b20112154cad37670f010b5edb5ad42de51a8cf
parent4083f5460085d8663643344728f49cae31b720c0 (diff)
[MOV] website_forum_doc: split Documentation.py file
-rw-r--r--addons/website_forum_doc/__openerp__.py2
-rw-r--r--addons/website_forum_doc/models/__init__.py3
-rw-r--r--addons/website_forum_doc/models/forum_documentation_toc.py (renamed from addons/website_forum_doc/models/documentation.py)28
-rw-r--r--addons/website_forum_doc/models/forum_post.py31
4 files changed, 33 insertions, 31 deletions
diff --git a/addons/website_forum_doc/__openerp__.py b/addons/website_forum_doc/__openerp__.py
index e7624ccaf94..4d6af5a3f4e 100644
--- a/addons/website_forum_doc/__openerp__.py
+++ b/addons/website_forum_doc/__openerp__.py
@@ -5,7 +5,6 @@
'name': 'Documentation',
'category': 'Website',
'summary': 'Forum, Documentation',
- 'version': '1.0',
'description': """
Documentation based on question and pertinent answers of Forum
""",
@@ -21,5 +20,4 @@ Documentation based on question and pertinent answers of Forum
'demo': [
'data/doc_demo.xml',
],
- 'installable': True,
}
diff --git a/addons/website_forum_doc/models/__init__.py b/addons/website_forum_doc/models/__init__.py
index d64a59f8004..1f99403bfbb 100644
--- a/addons/website_forum_doc/models/__init__.py
+++ b/addons/website_forum_doc/models/__init__.py
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
-import documentation
+import forum_documentation_toc
+import forum_post
diff --git a/addons/website_forum_doc/models/documentation.py b/addons/website_forum_doc/models/forum_documentation_toc.py
index 6aea079cf71..9f36c178c48 100644
--- a/addons/website_forum_doc/models/documentation.py
+++ b/addons/website_forum_doc/models/forum_documentation_toc.py
@@ -56,31 +56,3 @@ class DocumentationStage(osv.Model):
'sequence': fields.integer('Sequence'),
'name': fields.char('Stage Name', required=True, translate=True),
}
-
-
-class Post(osv.Model):
- _inherit = 'forum.post'
-
- _columns = {
- 'documentation_toc_id': fields.many2one('forum.documentation.toc', 'Documentation ToC', ondelete='set null'),
- 'documentation_stage_id': fields.many2one('forum.documentation.stage', 'Documentation Stage'),
- 'color': fields.integer('Color Index')
- }
-
- def _get_default_stage_id(self, cr, uid, context=None):
- stage_ids = self.pool["forum.documentation.stage"].search(cr, uid, [], limit=1, context=context)
- return stage_ids and stage_ids[0] or False
-
- _defaults = {
- 'documentation_stage_id': _get_default_stage_id,
- }
-
- def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
- stage_obj = self.pool.get('forum.documentation.stage')
- stage_ids = stage_obj.search(cr, uid, [], context=context)
- result = stage_obj.name_get(cr, uid, stage_ids, context=context)
- return result, {}
-
- _group_by_full = {
- 'documentation_stage_id': _read_group_stage_ids,
- }
diff --git a/addons/website_forum_doc/models/forum_post.py b/addons/website_forum_doc/models/forum_post.py
new file mode 100644
index 00000000000..6973754a4f6
--- /dev/null
+++ b/addons/website_forum_doc/models/forum_post.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+
+from openerp.osv import osv, fields
+
+
+class Post(osv.Model):
+ _inherit = 'forum.post'
+
+ _columns = {
+ 'documentation_toc_id': fields.many2one('forum.documentation.toc', 'Documentation ToC', ondelete='set null'),
+ 'documentation_stage_id': fields.many2one('forum.documentation.stage', 'Documentation Stage'),
+ 'color': fields.integer('Color Index')
+ }
+
+ def _get_default_stage_id(self, cr, uid, context=None):
+ stage_ids = self.pool["forum.documentation.stage"].search(cr, uid, [], limit=1, context=context)
+ return stage_ids and stage_ids[0] or False
+
+ _defaults = {
+ 'documentation_stage_id': _get_default_stage_id,
+ }
+
+ def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
+ stage_obj = self.pool.get('forum.documentation.stage')
+ stage_ids = stage_obj.search(cr, uid, [], context=context)
+ result = stage_obj.name_get(cr, uid, stage_ids, context=context)
+ return result, {}
+
+ _group_by_full = {
+ 'documentation_stage_id': _read_group_stage_ids,
+ }