Browse Source

Initial Commit

pull/9/merge
SHEREEF PT 8 years ago
parent
commit
fac34f8d6b
  1. 23
      colour_code_project/__init__.py
  2. 37
      colour_code_project/__openerp__.py
  3. 23
      colour_code_project/models/__init__.py
  4. 67
      colour_code_project/models/project_task_color.py
  5. 2
      colour_code_project/security/ir.model.access.csv
  6. BIN
      colour_code_project/static/description/icon.png
  7. 62
      colour_code_project/static/description/index.html
  8. BIN
      colour_code_project/static/description/project_banner.jpg
  9. BIN
      colour_code_project/static/description/project_color.png
  10. BIN
      colour_code_project/static/description/project_view.png
  11. BIN
      colour_code_project/static/description/task_color.png
  12. BIN
      colour_code_project/static/description/task_view.png
  13. 29
      colour_code_project/views/color_code_project_view.xml

23
colour_code_project/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import models

37
colour_code_project/__openerp__.py

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'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,
}

23
colour_code_project/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import project_task_color

67
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(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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

2
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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_color_color color.color model_color_color 1 0 0 0

BIN
colour_code_project/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

62
colour_code_project/static/description/index.html

@ -0,0 +1,62 @@
<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">Colour Code in Project & 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>

BIN
colour_code_project/static/description/project_banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
colour_code_project/static/description/project_color.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
colour_code_project/static/description/project_view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
colour_code_project/static/description/task_color.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
colour_code_project/static/description/task_view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

29
colour_code_project/views/color_code_project_view.xml

@ -0,0 +1,29 @@
<openerp>
<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="date" position="after">
<field name="project_colors" placeholder="Project Color Code"/>
</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>
</openerp>
Loading…
Cancel
Save