diff --git a/colour_code_project/README.rst b/colour_code_project/README.rst new file mode 100644 index 000000000..00509fa1d --- /dev/null +++ b/colour_code_project/README.rst @@ -0,0 +1,40 @@ +Automatic Colour Code for Task v10 +================================== +* Automatic Colour Code for Task Based on Project + +Depends +======= +[base] addon Odoo +[project] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/10.0/setup/install.html +- Install our custom addon + +License +======= + GNU Affero General Public License + (http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== + +Contact odoo@cybrosys.com + +Authors +------- +* Developer v9: Nilmar Shereef @ Cybrosys +* Developer v10: Niyas Raphy @ Cybrosys + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. \ No newline at end of file diff --git a/colour_code_project/__init__.py b/colour_code_project/__init__.py new file mode 100644 index 000000000..1a2cfbd50 --- /dev/null +++ b/colour_code_project/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +################################################################################### +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies ().# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) 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 diff --git a/colour_code_project/__manifest__.py b/colour_code_project/__manifest__.py new file mode 100644 index 000000000..9a268415b --- /dev/null +++ b/colour_code_project/__manifest__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +################################################################################### +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies ().# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) 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': "Automatic Colour Code for Task", + 'version': '10.0.1.0.0', + "category": "Project", + 'summary': """Automatic Colour Code for Task Based on Project""", + 'description': """Automatic Colour Code for Task Based on Project""", + 'author': "Cybrosys Techno Solutions", + 'company': "Cybrosys Techno Solutions", + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'project'], + 'data': [ + 'security/ir.model.access.csv', + 'views/color_code_project_view.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} \ No newline at end of file diff --git a/colour_code_project/models/__init__.py b/colour_code_project/models/__init__.py new file mode 100644 index 000000000..a0097b786 --- /dev/null +++ b/colour_code_project/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import project diff --git a/colour_code_project/models/project.py b/colour_code_project/models/project.py new file mode 100644 index 000000000..b8350c52f --- /dev/null +++ b/colour_code_project/models/project.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- + +from odoo 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..4f9bc6ec7 --- /dev/null +++ b/colour_code_project/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_colour_code,access.colour.code,model_colour_code,base.group_user,1,1,0,0 + diff --git a/colour_code_project/static/description/banner.jpg b/colour_code_project/static/description/banner.jpg new file mode 100644 index 000000000..be93e07b4 Binary files /dev/null and b/colour_code_project/static/description/banner.jpg differ 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..f1da80757 --- /dev/null +++ b/colour_code_project/static/description/index.html @@ -0,0 +1,61 @@ +
+
+
+

Project Management

+

Follow Project Colour Code in 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_color.png b/colour_code_project/static/description/project_color.png new file mode 100644 index 000000000..e4ab0c3cd 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..fd60ff7ef 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..2829c6117 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..bae4c473c 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..0e56857ae --- /dev/null +++ b/colour_code_project/views/color_code_project_view.xml @@ -0,0 +1,31 @@ + + + + + ProjectForm + project.project + + + + + + + + + + + + project.task.form + project.task + + + + + + + + + + + + \ No newline at end of file