Browse Source

[ADD]Initial Commit

pull/81/head
SHEREEF PT 8 years ago
parent
commit
73170606b5
  1. 15
      general_reminders/README.rst
  2. 25
      general_reminders/__init__.py
  3. 44
      general_reminders/__openerp__.py
  4. 24
      general_reminders/controllers/__init__.py
  5. 49
      general_reminders/controllers/main.py
  6. 24
      general_reminders/models/__init__.py
  7. 41
      general_reminders/models/popup_reminder.py
  8. BIN
      general_reminders/static/description/banner.jpg
  9. BIN
      general_reminders/static/description/cybro_logo.png
  10. BIN
      general_reminders/static/description/icon.png
  11. 108
      general_reminders/static/description/index.html
  12. BIN
      general_reminders/static/description/popup.png
  13. BIN
      general_reminders/static/description/reminder.png
  14. BIN
      general_reminders/static/description/result.png
  15. BIN
      general_reminders/static/description/set_date.png
  16. BIN
      general_reminders/static/description/set_period.png
  17. 31
      general_reminders/static/src/css/notification.css
  18. 84
      general_reminders/static/src/js/reminder_topbar.js
  19. 28
      general_reminders/static/src/xml/reminder_topbar.xml
  20. 59
      general_reminders/views/popup_reminder_view.xml
  21. 11
      general_reminders/views/reminder_template.xml

15
general_reminders/README.rst

@ -0,0 +1,15 @@
Reminders v9
============
Reminder is an effective module, which helps to memorise all your important dates. We
can set reminders to any model (eg: Sales,HR,Project etc..) and also corresponding
date fields to compare. This eases the company work load to memorize the special
dates (eg: Expiration date, Deadline date, Assigned Date etc...).
Features
========
* Supports all models and their date field
* We can use 3 methods to Search:
* Today: Compares to the current date.
* Set Date: Compares with the Given Date.
* Set Period: Reminder is set between a time range(Start date - End date)

25
general_reminders/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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
import controllers

44
general_reminders/__openerp__.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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': 'Reminders',
'version': '9.0.1.0.0',
'category': 'Extra Tools',
'summary': 'User Reminders',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'depends': ['base'],
'data': [
'views/popup_reminder_view.xml',
'views/reminder_template.xml',
],
'qweb': [
'static/src/xml/reminder_topbar.xml', ],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': True,
}

24
general_reminders/controllers/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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 main

49
general_reminders/controllers/main.py

@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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.addons.web import http
from openerp.addons.web.http import request
class Reminders(http.Controller):
@http.route('/general_reminders/all_reminder', type='json', auth="public")
def all_reminder(self):
reminder = []
for i in request.env['popup.reminder'].search([]):
reminder.append(i.name)
return reminder
@http.route('/general_reminders/reminder_active', type='json', auth="public")
def reminder_active(self, **kwargs):
reminder_value = kwargs.get('reminder_name')
value = []
for i in request.env['popup.reminder'].search([('name', '=', reminder_value)]):
value.append(i.model_name.model)
value.append(i.model_field.name)
value.append(i.search_by)
value.append(i.date_set)
value.append(i.date_from)
value.append(i.date_to)
return value

24
general_reminders/models/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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 popup_reminder

41
general_reminders/models/popup_reminder.py

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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, fields
class PopupReminder(models.Model):
_name = 'popup.reminder'
name = fields.Char(string='Title', required=True)
model_name = fields.Many2one('ir.model', string="Model", required=True)
model_field = fields.Many2one('ir.model.fields', string='Field',
domain="[('model_id', '=',model_name),('ttype', 'in', ['datetime','date'])]",
required=True)
search_by = fields.Selection([('today', 'Today'),
('set_period', 'Set Period'),
('set_date', 'Set Date'), ],
required=True, string="Search By")
date_set = fields.Date(string='Select Date')
date_from = fields.Date(string="Start Date")
date_to = fields.Date(string="End Date")

BIN
general_reminders/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
general_reminders/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
general_reminders/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

108
general_reminders/static/description/index.html

@ -0,0 +1,108 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Reminders</h2>
<h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4>
<p class='oe_mt32'>
Reminders is a effective module,helps to memorise all your important dates. We
can set reminders to any model (eg: Sales,HR,Project etc..) and also their corresponding
date fields to compare.This eases the company work load to memorize the special
dates (eg: Expiration date,Deadline date,Assigned Date etc...).
</p>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<h2 class="oe_slogan">Set Your Reminders</h2>
<div class="oe_span12">
<p>
<h4>Settings>Pop-up Reminder>Reminder</h4>
<p>
<p> Set your reminders for any model and the corresponding date field.
Also this module allows different methods to search.</p>
</p>
</div>
<div class="oe_span13">
<div class="oe_demo oe_screenshot">
<img src="reminder.png">
</div>
</div></div>
</section>
<section class="oe_container">
<div class="oe_row oe_padded">
<h2 class="oe_slogan">Search By</h2>
<div class="oe_span12">
<p> We can use 3 methods to search:</p>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Today: Compares to the current date.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Set Date: Compares with the given date.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Set Period: Reminder is set between a time range(Start date - End date).</li>
</ul>
<br>
</div>
<div class="oe_span6">
<h3>Set Date</h3>
<img class="oe_picture oe_screenshot" src="set_date.png">
</div>
<div class="oe_span6 ">
<h3>Set Period</h3>
<img class="oe_picture oe_screenshot" src="set_period.png">
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<div class="oe_span12">
<h2 class="oe_slogan">Reminder Button</h2>
<h3 class="oe_slogan">Select the Reminder from the list of Reminders</h3>
</div>
<div class="oe_span13">
<div class="oe_demo oe_screenshot">
<img src="popup.png">
</div>
</div></div>
</section>
<section class="oe_container">
<div class="oe_row oe_padded">
<div class="oe_span12">
<h2 class="oe_slogan">Related Result</h2>
</div>
<div class="oe_span13">
<div class="oe_demo oe_screenshot">
<img src="result.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="http://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="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;border-radius: 0;"
href="http://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>

BIN
general_reminders/static/description/popup.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
general_reminders/static/description/reminder.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
general_reminders/static/description/result.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
general_reminders/static/description/set_date.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
general_reminders/static/description/set_period.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

31
general_reminders/static/src/css/notification.css

@ -0,0 +1,31 @@
.oe_webclient_notification_action t {
color: white;
}
.oe_webclient_notification_action p {
color: white;
margin-top: 1em;
}
.label {
display: inline-block;
color: black;
max-width: 100%;
margin-bottom: 5px;
font-weight: bold;
}
.reminder-dropdown {
.o-flex(0, 1, auto);
background: #FFFFFF;
max-height: 400px;
min-height: 50px;
overflow-y: auto;
@media (max-width: @screen-xs-max) {
max-height: none;
}
.detail-client-address-country {
color: black;
}

84
general_reminders/static/src/js/reminder_topbar.js

@ -0,0 +1,84 @@
odoo.define('general_reminders.reminder_topbar', function (require) {
"use strict";
var core = require('web.core');
var SystrayMenu = require('web.SystrayMenu');
var Widget = require('web.Widget');
var QWeb = core.qweb;
var ajax = require('web.ajax');
var reminder_menu = Widget.extend({
template:'general_reminders.reminder_menu',
events: {
"click .dropdown-toggle": "on_click_reminder",
"click .detail-client-address-country": "reminder_active",
},
init:function(parent, name){
this.reminder = null;
this._super(parent);
},
on_click_reminder: function (event) {
var self = this
ajax.jsonRpc("/general_reminders/all_reminder", 'call',{}
).then(function(all_reminder){
self.all_reminder = all_reminder
self.$('.o_mail_navbar_dropdown_top').html(QWeb.render('general_reminders.reminder_menu',{
values: self.all_reminder
}));
})
},
reminder_active: function(){
var self = this;
var value =$("#reminder_select").val();
ajax.jsonRpc("/general_reminders/reminder_active", 'call',{'reminder_name':value}
).then(function(reminder){
self.reminder = reminder
for (var i=0;i<1;i++){
var model = self.reminder[i]
var date = self.reminder[i+1]
if (self.reminder[i+2] == 'today'){
return self.do_action({
type: 'ir.actions.act_window',
res_model: model,
view_mode: 'tree',
view_type: 'tree',
domain: [[date, '=', new Date()]],
views: [[false, 'tree']],
target: 'new',})
}
else if (self.reminder[i+2] == 'set_date'){
return self.do_action({
type: 'ir.actions.act_window',
res_model: model,
view_mode: 'tree',
view_type: 'tree',
domain: [[date, '=', self.reminder[i+3]]],
views: [[false, 'tree']],
target: 'new',})
}
else if (self.reminder[i+2] == 'set_period'){
return self.do_action({
type: 'ir.actions.act_window',
res_model: model,
view_mode: 'tree',
view_type: 'tree',
domain: [[date, '<', self.reminder[i+5]],[date, '>', self.reminder[i+4]]],
views: [[false, 'tree']],
target: 'new',})
}
}
});
},
});
SystrayMenu.Items.push(reminder_menu);
});

28
general_reminders/static/src/xml/reminder_topbar.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="general_reminders.reminder_menu">
<li class="o_mail_navbar_item">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#" title="Reminders">
<i class="fa fa-fw fa-clock-o"/> <span class="o_notification_counter"/></a>
<ul class="o_mail_navbar_dropdown dropdown-menu" role="menu">
<li class="o_mail_navbar_dropdown_top">
<t t-if="values">
<div>
<span class='label'>Reminders</span>
<select id="reminder_select" name="Reminder" class='detail-client-address-country'>
<t t-if="values">
<t t-foreach='values' t-as='val'>
<option class="dropdown-options" t-att-value='val' >
<t t-esc='val'/>
</option>
</t></t>
</select></div></t>
</li>
</ul>
</li>
</t>
</templates>

59
general_reminders/views/popup_reminder_view.xml

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="popup_reminder_form_view">
<field name="name">popup.reminder.form.view</field>
<field name="model">popup.reminder</field>
<field name="arch" type="xml">
<form string="Pop-Up Reminder">
<sheet>
<div class="oe_title">
<h1 class="o_row">
<field name="name" placeholder="Title..." />
</h1>
</div>
<group>
<group>
<field name="model_name" />
<field name="search_by"/>
<field name="date_from" attrs="{'invisible': [('search_by','not in','set_period')], 'required': [('search_by', '=', 'set_period')]}"/>
<field name="date_set" attrs="{'invisible': [('search_by','not in','set_date')], 'required': [('search_by', '=', 'set_date')]}"/>
<field name="date_to" attrs="{'invisible': [('search_by','not in','set_period')], 'required': [('search_by', '=', 'set_period')]}"/>
</group>
<group>
<field name="model_field"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="popup_reminder_tree_view">
<field name="name">popup.reminder.tree.view</field>
<field name="model">popup.reminder</field>
<field name="arch" type="xml">
<tree string="Pop-Up Reminder">
<field name="name"/>
<field name="model_name" />
<field name="model_field"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_popup_reminder">
<field name="name">Reminders</field>
<field name="res_model">popup.reminder</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create new reminder.
</p>
</field>
</record>
<menuitem name ="Pop-Up Reminder" id="popup_reminder_menu" parent="base.menu_administration" sequence="8"/>
<menuitem name ="Reminder" id="reminder_menu" parent="popup_reminder_menu" action="action_popup_reminder"/>
</data>
</openerp>

11
general_reminders/views/reminder_template.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="mail assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/general_reminders/static/src/css/notification.css"/>
<script type="text/javascript" src="/general_reminders/static/src/js/reminder_topbar.js"></script>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save