diff --git a/general_reminders/README.rst b/general_reminders/README.rst new file mode 100644 index 000000000..f65c671cc --- /dev/null +++ b/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) + diff --git a/general_reminders/__init__.py b/general_reminders/__init__.py new file mode 100644 index 000000000..e4d608c06 --- /dev/null +++ b/general_reminders/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 . +# +############################################################################## + +import models +import controllers diff --git a/general_reminders/__openerp__.py b/general_reminders/__openerp__.py new file mode 100644 index 000000000..9a881fec2 --- /dev/null +++ b/general_reminders/__openerp__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 . +# +############################################################################## + +{ + '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, +} diff --git a/general_reminders/controllers/__init__.py b/general_reminders/controllers/__init__.py new file mode 100644 index 000000000..016e5ec5d --- /dev/null +++ b/general_reminders/controllers/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 . +# +############################################################################## + +import main diff --git a/general_reminders/controllers/main.py b/general_reminders/controllers/main.py new file mode 100644 index 000000000..6aec4f9a8 --- /dev/null +++ b/general_reminders/controllers/main.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 . +# +############################################################################## + +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 diff --git a/general_reminders/models/__init__.py b/general_reminders/models/__init__.py new file mode 100644 index 000000000..8c250a2da --- /dev/null +++ b/general_reminders/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 . +# +############################################################################## + +import popup_reminder diff --git a/general_reminders/models/popup_reminder.py b/general_reminders/models/popup_reminder.py new file mode 100644 index 000000000..39373f46f --- /dev/null +++ b/general_reminders/models/popup_reminder.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 . +# +############################################################################## + +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") diff --git a/general_reminders/static/description/banner.jpg b/general_reminders/static/description/banner.jpg new file mode 100644 index 000000000..37bafe1ac Binary files /dev/null and b/general_reminders/static/description/banner.jpg differ diff --git a/general_reminders/static/description/cybro_logo.png b/general_reminders/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/general_reminders/static/description/cybro_logo.png differ diff --git a/general_reminders/static/description/icon.png b/general_reminders/static/description/icon.png new file mode 100644 index 000000000..3b3253114 Binary files /dev/null and b/general_reminders/static/description/icon.png differ diff --git a/general_reminders/static/description/index.html b/general_reminders/static/description/index.html new file mode 100644 index 000000000..d6de6355b --- /dev/null +++ b/general_reminders/static/description/index.html @@ -0,0 +1,108 @@ +
+
+

Reminders

+

Cybrosys Technologies , www.cybrosys.com

+

+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...). +

+
+
+ +
+
+

Set Your Reminders

+
+

+

Settings>Pop-up Reminder>Reminder

+

+

Set your reminders for any model and the corresponding date field. + Also this module allows different methods to search.

+

+
+
+
+ +
+
+
+ + +
+
+

Search By

+
+

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).
  • +
+
+
+
+

Set Date

+ +
+
+

Set Period

+ +
+
+
+ + +
+
+
+

Reminder Button

+

Select the Reminder from the list of Reminders

+
+
+
+ +
+
+
+ +
+
+
+

Related Result

+
+
+
+ +
+
+
+ +
+

Need Any Help?

+ +
+ + diff --git a/general_reminders/static/description/popup.png b/general_reminders/static/description/popup.png new file mode 100644 index 000000000..b42ae19fb Binary files /dev/null and b/general_reminders/static/description/popup.png differ diff --git a/general_reminders/static/description/reminder.png b/general_reminders/static/description/reminder.png new file mode 100644 index 000000000..1725c7fdd Binary files /dev/null and b/general_reminders/static/description/reminder.png differ diff --git a/general_reminders/static/description/result.png b/general_reminders/static/description/result.png new file mode 100644 index 000000000..cd28d972d Binary files /dev/null and b/general_reminders/static/description/result.png differ diff --git a/general_reminders/static/description/set_date.png b/general_reminders/static/description/set_date.png new file mode 100644 index 000000000..d5e253c15 Binary files /dev/null and b/general_reminders/static/description/set_date.png differ diff --git a/general_reminders/static/description/set_period.png b/general_reminders/static/description/set_period.png new file mode 100644 index 000000000..da9da01d5 Binary files /dev/null and b/general_reminders/static/description/set_period.png differ diff --git a/general_reminders/static/src/css/notification.css b/general_reminders/static/src/css/notification.css new file mode 100644 index 000000000..f40020454 --- /dev/null +++ b/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; + } + + diff --git a/general_reminders/static/src/js/reminder_topbar.js b/general_reminders/static/src/js/reminder_topbar.js new file mode 100644 index 000000000..3c623fa12 --- /dev/null +++ b/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); +}); diff --git a/general_reminders/static/src/xml/reminder_topbar.xml b/general_reminders/static/src/xml/reminder_topbar.xml new file mode 100644 index 000000000..03108bac7 --- /dev/null +++ b/general_reminders/static/src/xml/reminder_topbar.xml @@ -0,0 +1,28 @@ + + + + +
  • + + + +
  • +
    +
    \ No newline at end of file diff --git a/general_reminders/views/popup_reminder_view.xml b/general_reminders/views/popup_reminder_view.xml new file mode 100644 index 000000000..f922fa87c --- /dev/null +++ b/general_reminders/views/popup_reminder_view.xml @@ -0,0 +1,59 @@ + + + + + popup.reminder.form.view + popup.reminder + +
    + +
    +

    + +

    +
    + + + + + + + + + + + + + +
    +
    +
    +
    + + + popup.reminder.tree.view + popup.reminder + + + + + + + + + + + Reminders + popup.reminder + tree,form + +

    + Click here to create new reminder. +

    +
    +
    + + + +
    +
    \ No newline at end of file diff --git a/general_reminders/views/reminder_template.xml b/general_reminders/views/reminder_template.xml new file mode 100644 index 000000000..6ded01468 --- /dev/null +++ b/general_reminders/views/reminder_template.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file