14 changed files with 244 additions and 0 deletions
@ -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. |
@ -0,0 +1,20 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
|
||||
|
from . import models |
@ -0,0 +1,39 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
################################################################################### |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).# |
||||
|
# 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 <https://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
################################################################################### |
||||
|
|
||||
|
{ |
||||
|
'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, |
||||
|
} |
@ -0,0 +1,3 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
from . import project |
@ -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 |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
|
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 9.9 KiB |
@ -0,0 +1,61 @@ |
|||||
|
<section class="oe_container"> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<div class="oe_span12"> |
||||
|
<h2 class="oe_slogan">Project Management</h2> |
||||
|
<h3 class="oe_slogan">Follow Project Colour Code in Tasks</h3> |
||||
|
</div> |
||||
|
<div class="oe_span6"> |
||||
|
<div class="oe_demo oe_picture oe_screenshot"> |
||||
|
<img src="project_color.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="oe_span6"> |
||||
|
<div class="oe_demo oe_picture oe_screenshot"> |
||||
|
<img src="task_color.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="oe_span6"> |
||||
|
<p class="oe_mt32"> |
||||
|
Option to set a colour code in project. |
||||
|
</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container oe_dark"> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<h2 class="oe_slogan">Automatically follow that colour code for every tasks in that project.</h2> |
||||
|
<div class="oe_span6"> |
||||
|
<div class="oe_demo oe_picture oe_screenshot"> |
||||
|
<img src="project_view.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="oe_span6"> |
||||
|
<div class="oe_demo oe_picture oe_screenshot"> |
||||
|
<img src="task_view.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container oe_dark"> |
||||
|
<h2 class="oe_slogan">Need Any Help?</h2> |
||||
|
<div class="oe_slogan"> |
||||
|
<a class="btn btn-primary btn-lg mt8" |
||||
|
style="color: #FFFFFF !important;" href="http://www.cybrosys.com"><i |
||||
|
class="fa fa-envelope"></i> Email </a> <a |
||||
|
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" |
||||
|
href="http://www.cybrosys.com/contact/"><i |
||||
|
class="fa fa-phone"></i> Contact Us </a> <a |
||||
|
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" |
||||
|
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i |
||||
|
class="fa fa-check-square"></i> Request Customization </a> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 62 KiB |
@ -0,0 +1,31 @@ |
|||||
|
<odoo> |
||||
|
<data> |
||||
|
|
||||
|
<record model="ir.ui.view" id="colour_code_project_form"> |
||||
|
<field name="name">ProjectForm</field> |
||||
|
<field name="model">project.project</field> |
||||
|
<field name="inherit_id" ref="project.edit_project"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="partner_id" position="after"> |
||||
|
<field name="project_colors" placeholder="color"/> |
||||
|
<field name="color_name" invisible="1" /> |
||||
|
<field name="color" invisible="1"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="colour_code_view_task_form" model="ir.ui.view"> |
||||
|
<field name="name">project.task.form</field> |
||||
|
<field name="model">project.task</field> |
||||
|
<field name="inherit_id" ref="project.view_task_form2"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="project_id" position="after"> |
||||
|
<field name="task_color" placeholder="color"/> |
||||
|
<field name="color" invisible="1" /> |
||||
|
<field name="task_color_name" invisible="1" /> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</odoo> |
Loading…
Reference in new issue