diff --git a/project_stage/__init__.py b/project_stage/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/project_stage/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/project_stage/__manifest__.py b/project_stage/__manifest__.py new file mode 100644 index 00000000..4f2b62ec --- /dev/null +++ b/project_stage/__manifest__.py @@ -0,0 +1,20 @@ +{ + 'name': 'Project Stages', + 'version': '11.0.1.0.0', + 'author': 'Hibou Corp. ', + 'website': 'https://hibou.io/', + 'license': 'AGPL-3', + 'category': 'Tools', + 'complexity': 'easy', + 'description': """ +Adds stages to Projects themselves. + """, + 'depends': [ + 'project', + ], + 'data': [ + 'views/project_views.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/project_stage/models/__init__.py b/project_stage/models/__init__.py new file mode 100644 index 00000000..351a3ad3 --- /dev/null +++ b/project_stage/models/__init__.py @@ -0,0 +1 @@ +from . import project diff --git a/project_stage/models/project.py b/project_stage/models/project.py new file mode 100644 index 00000000..e9b9c5ea --- /dev/null +++ b/project_stage/models/project.py @@ -0,0 +1,25 @@ +from odoo import api, fields, models, SUPERUSER_ID + + +class ProjectType(models.Model): + _name = 'project.type' + _description = 'Project Stage' + _order = 'sequence, id' + + name = fields.Char(string='Stage Name', required=True, translate=True) + description = fields.Text(translate=True) + sequence = fields.Integer(default=1) + fold = fields.Boolean(string='Folded in Kanban', + help='This stage is folded in the kanban view when there are no records in that stage to display.') + + +class Project(models.Model): + _inherit = 'project.project' + + stage_id = fields.Many2one('project.type', string='Stage', + group_expand='_read_group_stage_ids', track_visibility='onchange', index=True) + + @api.model + def _read_group_stage_ids(self, stages, domain, order): + stage_ids = stages._search([], order=order, access_rights_uid=SUPERUSER_ID) + return stages.browse(stage_ids) diff --git a/project_stage/views/project_views.xml b/project_stage/views/project_views.xml new file mode 100644 index 00000000..0c00bf1e --- /dev/null +++ b/project_stage/views/project_views.xml @@ -0,0 +1,114 @@ + + + + Project Stages + project.type + form + tree,kanban,form + +

+ Click to add a stage in the project pipeline. +

+ Define the steps that will be used by projects. +

+
+
+ + + + + project.type.kanban + project.type + + + + + + + +
+
+
+ +
+
+ +
+ + +
+
+
+
+
+
+ + + project.type.tree + project.type + + + + + + + + + + + + project.type.search + project.type + + + + + + + + + project.type.form + project.type + +
+ + + + + + + + + + + +

+ You can also add a description to help your coworkers understand the meaning and purpose of the stage. +

+ +
+
+
+
+
+ + + + project.project.kanban.inherit + project.project + + + + stage_id + quick_create + + + + + + +
\ No newline at end of file