@ -0,0 +1,39 @@ |
|||||
|
Magic Note for Odoo10 Notes |
||||
|
========================== |
||||
|
|
||||
|
This module aims to automatically update the color of the notes/memo |
||||
|
in organizer tab under messaging menu. |
||||
|
|
||||
|
Features |
||||
|
======== |
||||
|
|
||||
|
* set a name for the category of coloured notes |
||||
|
* Select color from a pre defined list of colors |
||||
|
* Select a range of date limit(days) in integer form |
||||
|
* Updates the note's color in on-load of kanban view |
||||
|
|
||||
|
|
||||
|
.. note:: |
||||
|
|
||||
|
By default on installation of this module it creates |
||||
|
a field called dead date and sets it to the current date |
||||
|
|
||||
|
A new tab is created under settings-configuration where |
||||
|
>set default color when no date intervals are defined |
||||
|
>set color when any record doesn't come under date intervals |
||||
|
>set color for notes which exceed the deadline date |
||||
|
|
||||
|
|formview| |
||||
|
|
||||
|
* select a name which is not compulsory set lower and upper limit of days |
||||
|
* Select the color |
||||
|
|
||||
|
|listview| |
||||
|
* shows you the defied color and days(interval) |
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
|
||||
|
Developer: Rahul @ cybrosys |
||||
|
Ported to v10: Jesni @ cybrosys |
||||
|
Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in |
@ -0,0 +1,24 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://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 |
||||
|
|
@ -0,0 +1,44 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://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': "Magic Color Note", |
||||
|
'summary': """ |
||||
|
Automatically Change the Colour Based on the Date Interval Config of Notes""", |
||||
|
'description': """ |
||||
|
Set a date interval in integers. |
||||
|
All notes belonging to the period will be assigned the defined colour |
||||
|
""", |
||||
|
'version': '10.0.1.0.0', |
||||
|
'author': "Cybrosys Techno Solutions", |
||||
|
'company': "Cybrosys Techno Solutions", |
||||
|
'website': "https://www.cybrosys.com", |
||||
|
'category': 'Tools', |
||||
|
'depends': ['base', 'note'], |
||||
|
'data': ['views/color_note.xml', |
||||
|
'views/color_config.xml'], |
||||
|
'demo': [], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://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 colour_note_fields |
@ -0,0 +1,115 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
||||
|
# Author: Nilmar Shereef(<https://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 datetime import datetime |
||||
|
from dateutil.relativedelta import relativedelta |
||||
|
from lxml import etree |
||||
|
from odoo import models, fields |
||||
|
|
||||
|
|
||||
|
class ColorPickerCustom(models.Model): |
||||
|
_name = 'note.color' |
||||
|
|
||||
|
name = fields.Char(string="Criteria", help="Name for this date interval") |
||||
|
color_note = fields.Selection( |
||||
|
[('0', 'White'), ('1', 'Grey'), ('2', 'Orange'), ('3', 'Light yellow'), ('4', 'Light green'), |
||||
|
('5', 'Green'), ('6', 'Sky Blue'), ('7', 'Blue'), ('8', 'Purple'), |
||||
|
('9', 'Pink')], required=True, default='0', help="Colour of the record") |
||||
|
|
||||
|
start_interval = fields.Integer(string="Lower limit", default='1', required=True, |
||||
|
help="Starting interval should be a integer (Number of days)") |
||||
|
end_interval = fields.Integer(string="Upper limit", default='2', required=True, |
||||
|
help="End interval should be a integer (Number of days)") |
||||
|
|
||||
|
|
||||
|
class NoteConfiguration(models.Model): |
||||
|
_name = 'note.config' |
||||
|
_rec_name = "default_magic_color" |
||||
|
|
||||
|
default_magic_color = fields.Selection( |
||||
|
[('0', 'White'), ('1', 'Grey'), ('2', 'Orange'), ('3', 'Light yellow'), ('4', 'Light green'), |
||||
|
('5', 'Green'), ('6', 'Sky Blue'), ('7', 'Blue'), ('8', 'Purple'), |
||||
|
('9', 'Pink')], string="Default", required=True, default='0', |
||||
|
help="This color will be set to the records if no date interval record is found" |
||||
|
"By default records are coloured to white") |
||||
|
|
||||
|
not_in_interval = fields.Selection( |
||||
|
[('0', 'White'), ('1', 'Grey'), ('2', 'Orange'), ('3', 'Light yellow'), ('4', 'Light green'), |
||||
|
('5', 'Green'), ('6', 'Sky Blue'), ('7', 'Blue'), ('8', 'Purple'), |
||||
|
('9', 'Pink')], string="If Not inside the Interval", required=True, default='1', |
||||
|
help="This color will be set to the records which doesn't come under any defined interval stages." |
||||
|
"By default the records are coloured to Grey") |
||||
|
|
||||
|
deadline_cross = fields.Selection( |
||||
|
[('0', 'White'), ('1', 'Grey'), ('2', 'Orange'), ('3', 'Light yellow'), ('4', 'Light green'), |
||||
|
('5', 'Green'), ('6', 'Sky Blue'), ('7', 'Blue'), ('8', 'Purple'), |
||||
|
('9', 'Pink')], string="After deadline ", required=True, default='8', |
||||
|
help="This color will be set to the notes once they cross the dead date") |
||||
|
|
||||
|
|
||||
|
class NoteField(models.Model): |
||||
|
_name = 'note.note' |
||||
|
_inherit = 'note.note' |
||||
|
|
||||
|
dead_date = fields.Date(string="Dead Date", default=fields.Date.today(), required=True, |
||||
|
help="The deadline of this note:: Activate developer mode to set color") |
||||
|
|
||||
|
def fields_view_get(self, view_id=None, view_type='kanban', toolbar=False, submenu=False): |
||||
|
ret_val = super(NoteField, self).fields_view_get( |
||||
|
view_id=view_id, view_type=view_type, |
||||
|
toolbar=toolbar, submenu=submenu) |
||||
|
doc = etree.XML(ret_val['arch']) |
||||
|
current_date = fields.datetime.now() |
||||
|
value = self.env['note.color'].search([]) |
||||
|
if len(value) == 0: |
||||
|
note = self.env['note.note'].search([]) |
||||
|
for each in note: |
||||
|
obj2 = self.env['note.config'].browse(1) |
||||
|
col_default = obj2.default_magic_color |
||||
|
each.color = col_default |
||||
|
else: |
||||
|
note = self.env['note.note'].search([]) |
||||
|
for each in note: |
||||
|
fmt = '%Y-%m-%d' |
||||
|
date_dead = datetime.strptime(each.dead_date, fmt) |
||||
|
if current_date > date_dead: |
||||
|
obj2 = self.env['note.config'].browse(1) |
||||
|
dead_line_cross = obj2.deadline_cross |
||||
|
each.color = dead_line_cross |
||||
|
else: |
||||
|
r = relativedelta(date_dead, current_date) |
||||
|
flag = 0 |
||||
|
for i in value: |
||||
|
st_date = i.start_interval |
||||
|
end_date = i.end_interval |
||||
|
if st_date <= r.days < end_date: |
||||
|
col = i.color_note |
||||
|
each.write({'color': col}) |
||||
|
flag += 1 |
||||
|
if flag == 0: |
||||
|
obj3 = self.env['note.config'].browse(1) |
||||
|
col_not_in_range = obj3.not_in_interval |
||||
|
each.color = col_not_in_range |
||||
|
for node in doc.xpath("//ul[@class='oe_kanban_colorpicker']"): |
||||
|
ret_val['arch'] = etree.tostring(doc) |
||||
|
return ret_val |
||||
|
|
|
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 9.7 KiB |
@ -0,0 +1,105 @@ |
|||||
|
<section class="oe_container"> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<h2 class="oe_slogan">Color your notes automatically</h2> |
||||
|
<h3 class="oe_slogan">Prioritize your notes by colour</h3> |
||||
|
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4> |
||||
|
<br/> |
||||
|
</div> |
||||
|
<div class="row oe_row oe_spaced"> |
||||
|
<div class="col-md-6"> |
||||
|
☀ User Defined Colour Configuration for Notes.<br> |
||||
|
☀ Automatic Colour Change of Notes Based on Dead Date.<br> |
||||
|
☀ Default Colour for Forbidden.<br> |
||||
|
☀ Default Colour for Over Passed Notes.<br> |
||||
|
☀ Updates the note's colors every on-load of kanban view.<br> |
||||
|
</div> |
||||
|
<div class="col-md-6"> |
||||
|
<div class="oe_bg_img"> |
||||
|
<img class="oe_picture oe_screenshot center-block" src="disply.png" style="margin-top: 0px !important;"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container"> |
||||
|
<div class="oe_row oe_spaced"> |
||||
|
<div style="text-align: center"> |
||||
|
<p> |
||||
|
<h4>Dashboard</h4> |
||||
|
<p> |
||||
|
<span>Changes the note color in kanban view relative to the dead-date |
||||
|
field value and the date intervals</span> |
||||
|
</div> |
||||
|
<div> |
||||
|
<div class="oe_demo oe_picture oe_screenshot"> |
||||
|
<img src="note.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container oe_dark"> |
||||
|
<div class="oe_row"> |
||||
|
<div style="text-align: center"> |
||||
|
<p> |
||||
|
<h4>Configuration</h4> |
||||
|
<p> |
||||
|
<span>After installation Activate developer mode. |
||||
|
Find two new tabs Date interval and Settings under note tab. |
||||
|
A new field Dead date will be added to the notes set a dead date. |
||||
|
set default colours in settings.</span> |
||||
|
</div> |
||||
|
<div> |
||||
|
<div class="oe_bg_img"> |
||||
|
<img class="oe_picture oe_screenshot" src="configuration.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
<div class="oe_row"> |
||||
|
<div style="text-align: center"> |
||||
|
<p> |
||||
|
<h4>Workflow</h4> |
||||
|
<p> |
||||
|
<span>Set date intervals and colors for the notes from Date interval tab under |
||||
|
notes--->date interval(NOTE:Activate Developer mode).</span><br/> |
||||
|
<span>☛ Note: If a note does not belong to any date interval the note colour will |
||||
|
be set according to the color specified in the settings |
||||
|
|
||||
|
By default when installed on a running system the dead date will |
||||
|
be set to the current date of installation of this module</span> |
||||
|
</div> |
||||
|
<div> |
||||
|
<div class="oe_bg_img"> |
||||
|
<img class="oe_picture oe_screenshot" src="date_interval.png"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
|
||||
|
<section class="oe_container oe_dark"> |
||||
|
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
||||
|
<div class="oe_slogan" style="margin-top:10px !important;"> |
||||
|
<div> |
||||
|
<a class="btn btn-primary btn-lg mt8" |
||||
|
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
||||
|
class="fa fa-envelope"></i> Email </a> <a |
||||
|
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
||||
|
href="https://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;border-radius: 0;" |
||||
|
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
||||
|
class="fa fa-check-square"></i> Request Customization </a> |
||||
|
</div> |
||||
|
<br> |
||||
|
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
||||
|
<div> |
||||
|
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
||||
|
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
||||
|
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
||||
|
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
||||
|
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
After Width: | Height: | Size: 63 KiB |
@ -0,0 +1,50 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<odoo> |
||||
|
<data noupdate="0"> |
||||
|
<record id="view_note_configuration1" model="note.config"> |
||||
|
<field name="default_magic_color">1</field> |
||||
|
<field name="not_in_interval">7</field> |
||||
|
<field name="deadline_cross">8</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
<data> |
||||
|
<record id="view_note_configuration" model="ir.ui.view"> |
||||
|
<field name="name">note_config</field> |
||||
|
<field name="model">note.config</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form edit="true" create="false" delete="false"> |
||||
|
<h3 style="text-align: center"> |
||||
|
Edit configurations to change the colors |
||||
|
</h3> |
||||
|
|
||||
|
<group col="4"> |
||||
|
<field name="default_magic_color"/> |
||||
|
<field name="not_in_interval"/> |
||||
|
<field name="deadline_cross"/> |
||||
|
</group> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.ui.view" id="config_tree_view"> |
||||
|
<field name="name">config_tree</field> |
||||
|
<field name="model">note.config</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree create="false" delete="false"> |
||||
|
<field name="deadline_cross"/> |
||||
|
<field name="not_in_interval"/> |
||||
|
<field name="deadline_cross"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="action_general_configuration1" model="ir.actions.act_window"> |
||||
|
<field name="name">General Settings</field> |
||||
|
<field name="res_model">note.config</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
</record> |
||||
|
|
||||
|
<menuitem name="Settings" id="magic_note" parent="note.menu_note_configuration" action="action_general_configuration1"/> |
||||
|
|
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,73 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<record model="ir.ui.view" id="view_note_note_form1"> |
||||
|
<field name="name">note_field</field> |
||||
|
<field name="model">note.note</field> |
||||
|
<field name="inherit_id" ref="note.view_note_note_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='tag_ids']" position="after"> |
||||
|
<group> |
||||
|
<field name="dead_date" /> |
||||
|
</group> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.ui.view" id="view_note_note_form2"> |
||||
|
<field name="name">note_color</field> |
||||
|
<field name="model">note.color</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="name" placeholder="Urgent/Freezy/Least etc"/> |
||||
|
<field name="color_note"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<group> |
||||
|
<div class="o_row"> |
||||
|
<label for="start_interval"/> |
||||
|
<field name="start_interval"/> |
||||
|
<span class="oe_grey">Days</span> |
||||
|
</div> |
||||
|
<div class="o_row"> |
||||
|
<label for="end_interval"/> |
||||
|
<field name="end_interval"/> |
||||
|
<span class="oe_grey">Days</span> |
||||
|
</div> |
||||
|
</group> |
||||
|
</group> |
||||
|
</group> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.ui.view" id="session_tree_view"> |
||||
|
<field name="name">color_tree</field> |
||||
|
<field name="model">note.color</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree > |
||||
|
<field name="name"/> |
||||
|
<field name="color_note"/> |
||||
|
<field name="start_interval"/> |
||||
|
<field name="end_interval"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
|
<record model="ir.actions.act_window" id="colour_define"> |
||||
|
<field name="name">colour</field> |
||||
|
<field name="res_model">note.color</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_id" ref="session_tree_view"> </field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="help" type="html"> |
||||
|
<p class="oe_view_nocontent_create">Create the colour sets |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
<menuitem name="Date interval" id="date_intervals" parent="note.menu_note_configuration" action="colour_define"/> |
||||
|
</data> |
||||
|
</odoo> |