diff --git a/colour_code_project/__init__.py b/colour_code_project/__init__.py new file mode 100644 index 000000000..b2462eb50 --- /dev/null +++ b/colour_code_project/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import models diff --git a/colour_code_project/__openerp__.py b/colour_code_project/__openerp__.py new file mode 100644 index 000000000..4c7ba80c1 --- /dev/null +++ b/colour_code_project/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': "Automatic Colour Code for Task", + 'summary': """Automatic Colour Code for Task Based on Project""", + 'author': "Nilmar Shereef", + 'website': "http://www.cybrosys.com", + 'category': 'Project', + 'version': '1.0', + 'license': 'AGPL-3', + 'depends': ['base', 'project'], + 'data': ['views/color_code_project_view.xml'], + 'images': ['static/description/project_banner.jpg'], + 'demo': [], + 'installable': True, + 'auto_install': False, +} diff --git a/colour_code_project/models/__init__.py b/colour_code_project/models/__init__.py new file mode 100644 index 000000000..cd2d97fbf --- /dev/null +++ b/colour_code_project/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import project_task_color diff --git a/colour_code_project/models/project_task_color.py b/colour_code_project/models/project_task_color.py new file mode 100644 index 000000000..efc7f2c85 --- /dev/null +++ b/colour_code_project/models/project_task_color.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2009-TODAY Cybrosys Technologies(). +# Author: Nilmar Shereef() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from openerp import models, api, fields + + +class ProjectColor(models.Model): + _inherit = 'project.project' + + color_name = fields.Char(string='Name') + project_colors = fields.Many2one('colour.code', string="Colour Code") + color = fields.Integer(string='Colour') + + @api.onchange('project_colors') + def _change_color_type(self): + if self.project_colors: + self.color = self.project_colors.color + self.color_name = self.project_colors.name + + +class Color(models.Model): + _name = 'colour.code' + + name = fields.Char(string='Name', required=True, + help="White : 0,Grey : 1,Pink :2,Yellow :3,Light Green : 4 ,Light Blue :5," + "Sky Blue : 6, Light Orange : 7,Purple: 8,Light Purple: 9") + color = fields.Integer('Colour Index', required=True, size=1, + help="White : 0,Grey : 1,Pink :2,Yellow :3,Light Green : 4 ,Light Blue :5," + "Sky Blue : 6, Light Orange : 7,Purple: 8,Light Purple: 9") + + +class TaskColor(models.Model): + _inherit = 'project.task' + + task_color_name = fields.Char(string='Name') + task_color = fields.Many2one('colour.code', readonly=True, string='Related Colour Code', related="project_id.project_colors") + color = fields.Integer(string='Colour', related="project_id.color") + + @api.onchange('task_color') + def _change_task_type(self): + if self.task_color: + self.color = self.task_color.color + self.task_color_name = self.task_color.name + + + + + diff --git a/colour_code_project/security/ir.model.access.csv b/colour_code_project/security/ir.model.access.csv new file mode 100644 index 000000000..ff034dc56 --- /dev/null +++ b/colour_code_project/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 +access_color_color,color.color,model_color_color,,1,0,0,0 \ No newline at end of file diff --git a/colour_code_project/static/description/icon.png b/colour_code_project/static/description/icon.png new file mode 100644 index 000000000..1ab32834b Binary files /dev/null and b/colour_code_project/static/description/icon.png differ diff --git a/colour_code_project/static/description/index.html b/colour_code_project/static/description/index.html new file mode 100644 index 000000000..304d8b715 --- /dev/null +++ b/colour_code_project/static/description/index.html @@ -0,0 +1,62 @@ +
+
+
+

Project Management

+

Colour Code in Project & tasks

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

+ Option to set a colour code in project. +

+
+
+
+ +
+
+

Automatically follow that colour code for every tasks in that project.

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

Need Any Help?

+ +
+ + + + + + + diff --git a/colour_code_project/static/description/project_banner.jpg b/colour_code_project/static/description/project_banner.jpg new file mode 100644 index 000000000..9726be69a Binary files /dev/null and b/colour_code_project/static/description/project_banner.jpg differ diff --git a/colour_code_project/static/description/project_color.png b/colour_code_project/static/description/project_color.png new file mode 100644 index 000000000..c04af0376 Binary files /dev/null and b/colour_code_project/static/description/project_color.png differ diff --git a/colour_code_project/static/description/project_view.png b/colour_code_project/static/description/project_view.png new file mode 100644 index 000000000..d70cc7c1f Binary files /dev/null and b/colour_code_project/static/description/project_view.png differ diff --git a/colour_code_project/static/description/task_color.png b/colour_code_project/static/description/task_color.png new file mode 100644 index 000000000..5300351af Binary files /dev/null and b/colour_code_project/static/description/task_color.png differ diff --git a/colour_code_project/static/description/task_view.png b/colour_code_project/static/description/task_view.png new file mode 100644 index 000000000..db727f076 Binary files /dev/null and b/colour_code_project/static/description/task_view.png differ diff --git a/colour_code_project/views/color_code_project_view.xml b/colour_code_project/views/color_code_project_view.xml new file mode 100644 index 000000000..4a1a50cb3 --- /dev/null +++ b/colour_code_project/views/color_code_project_view.xml @@ -0,0 +1,29 @@ + + + + + ProjectForm + project.project + + + + + + + + + + project.task.form + project.task + + + + + + + + + + + + \ No newline at end of file