@ -0,0 +1,38 @@ |
|||
Magic Note for Odoo8 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 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 |
|||
Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in |
@ -0,0 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import models |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
{ |
|||
'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': '0.3', |
|||
'author': "Cybrosys Techno Solutions", |
|||
'company': "Cybrosys Techno Solutions", |
|||
'website': "http://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,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import colour_note_fields |
@ -0,0 +1,95 @@ |
|||
from openerp import models, fields |
|||
from datetime import datetime |
|||
from dateutil.relativedelta import relativedelta |
|||
from lxml import etree |
|||
|
|||
|
|||
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") |
|||
end_interval = fields.Integer(string="Upper limit", default='2', required=True, |
|||
help="End interval should be a integer") |
|||
|
|||
|
|||
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 in 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") |
|||
|
|||
def fields_view_get(self, cr, uid, view_id=None, view_type='kanban', context=None, toolbar=False, submenu=False): |
|||
ret_val = super(NoteField, self).fields_view_get( |
|||
cr, uid, view_id=view_id, view_type=view_type, context=context, |
|||
toolbar=toolbar, submenu=submenu) |
|||
doc = etree.XML(ret_val['arch']) |
|||
current_date = fields.datetime.now() |
|||
value = self.pool.get('note.color').search(cr, uid, [], context=None) |
|||
if len(value) == 0: |
|||
note = self.pool.get('note.note').search(cr, uid, [], context=None) |
|||
for each in note: |
|||
obj = self.pool.get('note.note').browse(cr, uid, each) |
|||
obj2 = self.pool.get('note.config').browse(cr, uid, 1) |
|||
col_default = obj2.default_magic_color |
|||
obj.write({'color': col_default}) |
|||
else: |
|||
note = self.pool.get('note.note').search(cr, uid, [], context=None) |
|||
for each in note: |
|||
obj = self.pool.get('note.note').browse(cr, uid, each) |
|||
fmt = '%Y-%m-%d' |
|||
date_dead = datetime.strptime(obj.dead_date, fmt) |
|||
if current_date > date_dead: |
|||
obj2 = self.pool.get('note.config').browse(cr, uid, 1) |
|||
dead_line_cross = obj2.deadline_cross |
|||
obj.write({'color': dead_line_cross}) |
|||
else: |
|||
r = relativedelta(date_dead, current_date) |
|||
for i in value: |
|||
flag = 0 |
|||
obj1 = self.pool.get('note.color').browse(cr, uid, i) |
|||
st_date = obj1.start_interval |
|||
end_date = obj1.end_interval |
|||
if st_date < r.days < end_date: |
|||
col = obj1.color_note |
|||
obj.write({'color': col}) |
|||
flag += 1 |
|||
if flag == 0: |
|||
obj3 = self.pool.get('note.config').browse(cr, uid, 1) |
|||
col_not_in_range = obj3.not_in_interval |
|||
obj.write({'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: 139 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 9.7 KiB |
@ -0,0 +1,93 @@ |
|||
<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">Author : Cybrosys Techno Solutions , www.cybrosys.com</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 class="oe_span6"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="note.png"> |
|||
</div> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<p class='oe_mt32'> |
|||
☛ Changes the note color in kanban view relative to the dead-date |
|||
field value and the date intervals |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row"> |
|||
<h2 class="oe_slogan">How to..</h2> |
|||
<div class="oe_span6"> |
|||
<div class="oe_bg_img"> |
|||
<img class="oe_picture oe_screenshot" src="configuration.png"> |
|||
</div> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<p class='oe_mt32'> |
|||
☛ After installation browse over to settings--->configuration----> |
|||
Magic note |
|||
set the colors and save settings. |
|||
</p> |
|||
</div> |
|||
</div> |
|||
<div class="oe_row"> |
|||
<div class="oe_span6"> |
|||
<p class='oe_mt32'> |
|||
☛ Set date intervals and colors for the notes from Date interval tab under |
|||
messaging-->organizer |
|||
</p> |
|||
<p class='oe_mt32'> |
|||
☛ Note: If a note does not belong to any date interval the note colour will |
|||
be set according to the color set in configuration |
|||
|
|||
By default when installed on a running system the dead date will |
|||
be set to the current date of installation of this module |
|||
</p> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<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;"> |
|||
<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> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
</section> |
After Width: | Height: | Size: 104 KiB |
@ -0,0 +1,50 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<openerp> |
|||
<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="Magic Note" id="magic_note" parent="base.menu_config" action="action_general_configuration1"/> |
|||
|
|||
</data> |
|||
</openerp> |
@ -0,0 +1,69 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<openerp> |
|||
<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"/> |
|||
<field name="color_note"/> |
|||
</group> |
|||
|
|||
<group> |
|||
<group> |
|||
<field name="start_interval"/> |
|||
<field name="end_interval"/> |
|||
</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="mail.mail_my_stuff" sequence="21" action="colour_define"/> |
|||
</data> |
|||
</openerp> |