Browse Source

[ADD] Initial Commit

pull/78/head
Sreejith 7 years ago
parent
commit
3e388f29c1
  1. 25
      hr_reminder/__init__.py
  2. 45
      hr_reminder/__manifest__.py
  3. 24
      hr_reminder/controllers/__init__.py
  4. 51
      hr_reminder/controllers/main.py
  5. 69
      hr_reminder/controllers/time_reminder.py
  6. 24
      hr_reminder/models/__init__.py
  7. 79
      hr_reminder/models/hr_reminder.py
  8. 10
      hr_reminder/security/hr_reminder_security.xml
  9. 5
      hr_reminder/security/ir.model.access.csv
  10. BIN
      hr_reminder/static/description/banner.jpg
  11. BIN
      hr_reminder/static/description/cybro-service.png
  12. BIN
      hr_reminder/static/description/cybro_logo.png
  13. BIN
      hr_reminder/static/description/icon.png
  14. 115
      hr_reminder/static/description/index.html
  15. BIN
      hr_reminder/static/description/popup.png
  16. BIN
      hr_reminder/static/description/reminder.png
  17. BIN
      hr_reminder/static/description/result.png
  18. BIN
      hr_reminder/static/description/set_date.png
  19. BIN
      hr_reminder/static/description/set_period.png
  20. 31
      hr_reminder/static/src/css/notification.css
  21. 82
      hr_reminder/static/src/js/reminder_topbar.js
  22. 28
      hr_reminder/static/src/xml/reminder_topbar.xml
  23. 76
      hr_reminder/views/hr_reminder_view.xml
  24. 11
      hr_reminder/views/reminder_template.xml

25
hr_reminder/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import models
from . import controllers

45
hr_reminder/__manifest__.py

@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'OHRMS Reminders Todo',
'version': '10.0.1.0.0',
'category': 'Extra Tools',
'summary': 'HR Reminder',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': "https://www.openhrms.com",
'depends': ['base', 'hr'],
'data': [
'security/ir.model.access.csv',
'security/hr_reminder_security.xml',
'views/hr_reminder_view.xml',
'views/reminder_template.xml',
],
'qweb': [
'static/src/xml/reminder_topbar.xml', ],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

24
hr_reminder/controllers/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
import main

51
hr_reminder/controllers/main.py

@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from odoo import http
from odoo.http import request
class Reminders(http.Controller):
@http.route('/hr_reminder/all_reminder', type='json', auth="public")
def all_reminder(self):
reminder = []
for i in request.env['hr.reminder'].search([]):
if i.reminder_active:
reminder.append(i.name)
return reminder
@http.route('/hr_reminder/reminder_active', type='json', auth="public")
def reminder_active(self, **kwargs):
reminder_value = kwargs.get('reminder_name')
value = []
for i in request.env['hr.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)
# value.append(i.exclude_year)
return value

69
hr_reminder/controllers/time_reminder.py

@ -0,0 +1,69 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import werkzeug
from odoo.api import Environment
import odoo.http as http
from odoo.http import request
from odoo import SUPERUSER_ID
from odoo import registry as registry_get
class CalendarController(http.Controller):
@http.route('/calendar/meeting/accept', type='http', auth="calendar")
def accept(self, db, token, action, id, **kwargs):
registry = registry_get(db)
with registry.cursor() as cr:
env = Environment(cr, SUPERUSER_ID, {})
attendee = env['calendar.attendee'].search([('access_token', '=', token), ('state', '!=', 'accepted')])
if attendee:
attendee.do_accept()
return self.view(db, token, action, id, view='form')
@http.route('/calendar/meeting/decline', type='http', auth="calendar")
def declined(self, db, token, action, id):
registry = registry_get(db)
with registry.cursor() as cr:
env = Environment(cr, SUPERUSER_ID, {})
attendee = env['calendar.attendee'].search([('access_token', '=', token), ('state', '!=', 'declined')])
if attendee:
attendee.do_decline()
return self.view(db, token, action, id, view='form')
@http.route('/calendar/meeting/view', type='http', auth="calendar")
def view(self, db, token, action, id, view='calendar'):
registry = registry_get(db)
with registry.cursor() as cr:
# Since we are in auth=none, create an env with SUPERUSER_ID
env = Environment(cr, SUPERUSER_ID, {})
attendee = env['calendar.attendee'].search([('access_token', '=', token)])
timezone = attendee.partner_id.tz
lang = attendee.partner_id.lang or 'en_US'
event = env['calendar.event'].with_context(tz=timezone, lang=lang).browse(int(id))
# If user is logged, redirect to form view of event
# otherwise, display the simplifyed web page with event informations
if request.session.uid:
return werkzeug.utils.redirect('/web?db=%s#id=%s&view_type=form&model=calendar.event' % (db, id))
# NOTE : we don't use request.render() since:
# - we need a template rendering which is not lazy, to render before cursor closing
# - we need to display the template in the language of the user (not possible with
# request.render())
return env['ir.ui.view'].with_context(lang=lang).render_template(
'calendar.invitation_page_anonymous', {
'event': event,
'attendee': attendee,
})
# Function used, in RPC to check every 5 minutes, if notification to do for an event or not
@http.route('/calendar/notify', type='json', auth="user")
def notify(self):
return request.env['calendar.alarm_manager'].get_next_notif()
@http.route('/calendar/notify_ack', type='json', auth="user")
def notify_ack(self, type=''):
return request.env['res.partner']._set_calendar_last_notif_ack()

24
hr_reminder/models/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import hr_reminder

79
hr_reminder/models/hr_reminder.py

@ -0,0 +1,79 @@
# -*- coding: utf-8 -*-
###################################################################################
# A part of OpenHRMS Project <https://www.openhrms.com>
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
# Author: Treesa Maria Jude (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from datetime import datetime
from odoo import models, fields
class HrPopupReminder(models.Model):
_name = 'hr.reminder'
name = fields.Char(string='Title', required=True)
model_name = fields.Many2one('ir.model', string="Model", required=True, domain="[('model', 'like','hr')]")
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")
days_before = fields.Integer(string='Reminder before')
active = fields.Boolean(string="Active",default=True)
# exclude_year = fields.Boolean(string="Consider day alone")
reminder_active = fields.Boolean(string="Reminder Active")
date_set = fields.Date(string='Select Date')
date_from = fields.Date(string="Start Date")
date_to = fields.Date(string="End Date")
expiry_date = fields.Date(string="Reminder Expiry Date")
company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.user.company_id)
def reminder_scheduler(self):
now = fields.Datetime.from_string(fields.Datetime.now())
today = fields.Date.today()
obj = self.env['hr.reminder'].search([])
for i in obj:
if i.search_by != "today":
if i.expiry_date and datetime.strptime(today, "%Y-%m-%d") == datetime.strptime(i.expiry_date, "%Y-%m-%d"):
i.active = False
else:
if i.search_by == "set_date":
d1 = datetime.strptime(i.date_set, "%Y-%m-%d")
d2 = datetime.strptime(today, "%Y-%m-%d")
daydiff = abs((d2 - d1).days)
if daydiff <= i.days_before:
i.reminder_active = True
else:
i.reminder_active = False
elif i.search_by == "set_period":
d1 = datetime.strptime(i.date_from, "%Y-%m-%d")
d2 = datetime.strptime(today, "%Y-%m-%d")
daydiff = abs((d2 - d1).days)
if daydiff <= i.days_before:
i.reminder_active = True
else:
i.reminder_active = False
else:
i.reminder_active = True

10
hr_reminder/security/hr_reminder_security.xml

@ -0,0 +1,10 @@
<?xml version="1.0" ?>
<odoo>
<record id="property_rule_hr_shift" model="ir.rule">
<field name="name">Hr Reminder Company</field>
<field name="model_id" ref="model_hr_reminder"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</odoo>

5
hr_reminder/security/ir.model.access.csv

@ -0,0 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_reminder_officer,hr.reminder.officer,hr_reminder.model_hr_reminder,hr.group_hr_user,1,1,1,1
access_hr_reminder_employee,hr.reminder.employee,hr_reminder.model_hr_reminder,hr.group_hr_manager,1,1,1,1
access_hr_reminder_manager,hr.reminder.manager,hr_reminder.model_hr_reminder,base.group_user,0,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_reminder_officer hr.reminder.officer hr_reminder.model_hr_reminder hr.group_hr_user 1 1 1 1
3 access_hr_reminder_employee hr.reminder.employee hr_reminder.model_hr_reminder hr.group_hr_manager 1 1 1 1
4 access_hr_reminder_manager hr.reminder.manager hr_reminder.model_hr_reminder base.group_user 0 0 0 0

BIN
hr_reminder/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
hr_reminder/static/description/cybro-service.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

BIN
hr_reminder/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
hr_reminder/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

115
hr_reminder/static/description/index.html

@ -0,0 +1,115 @@
<section class="oe_container">
<div class="oe_row">
<h2 class="oe_slogan">OpenHRMS</h2>
<h3 class="oe_slogan">Most advanced open source HR management software</h3>
</div>
</section>
<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 an 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
hr_reminder/static/description/popup.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
hr_reminder/static/description/reminder.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
hr_reminder/static/description/result.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

BIN
hr_reminder/static/description/set_date.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
hr_reminder/static/description/set_period.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

31
hr_reminder/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;
}

82
hr_reminder/static/src/js/reminder_topbar.js

@ -0,0 +1,82 @@
odoo.define('hr_reminder.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:'hr_reminder.reminder_menu',
events: {
"click .dropdown-toggle": "on_click_reminder",
"click .detail-client-address-country": "reminder_active",
},
on_click_reminder: function (event) {
var self = this
ajax.jsonRpc("/hr_reminder/all_reminder", 'call',{}
).then(function(all_reminder){
self.all_reminder = all_reminder
self.$('.o_mail_navbar_dropdown_top').html(QWeb.render('hr_reminder.reminder_menu',{
values: self.all_reminder
}));
})
},
reminder_active: function(){
var self = this;
var value =$("#reminder_select").val();
ajax.jsonRpc("/hr_reminder/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]
console.log("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDd",date,new Date())
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
hr_reminder/static/src/xml/reminder_topbar.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="hr_reminder.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-bell"/> <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>

76
hr_reminder/views/hr_reminder_view.xml

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="ir_cron_scheduler_reminder_action" model="ir.cron">
<field name="name">Reminder scheduler</field>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
<field eval="'hr.reminder'" name="model"/>
<field eval="'reminder_scheduler'" name="function"/>
</record>
<record model="ir.ui.view" id="hr_reminder_form_view">
<field name="name">hr.reminder.form.view</field>
<field name="model">hr.reminder</field>
<field name="arch" type="xml">
<form string="HR Reminder">
<sheet>
<div class="oe_title">
<h1 class="o_row">
<field name="name" placeholder="Reminder 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')]}"/>
<!--<field name="exclude_year" attrs="{'invisible': [('search_by','in','set_period')]}"/>-->
<field name="company_id"/>
</group>
<group>
<field name="model_field"/>
<field name="days_before" attrs="{'invisible': [('search_by','=','today')]}"/>
<field name="expiry_date" attrs="{'invisible': [('search_by','=','today')]}"/>
<field name="active"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="hr_reminder_tree_view">
<field name="name">hr.reminder.tree.view</field>
<field name="model">hr.reminder</field>
<field name="arch" type="xml">
<tree string="Pop-Up Reminder">
<field name="name"/>
<field name="model_name" />
<field name="model_field"/>
<field name="company_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_hr_reminder">
<field name="name">Reminders</field>
<field name="res_model">hr.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 ="Hr Reminder" id="hr_reminder_menu" parent="hr.menu_hr_root" sequence="8"/>
<menuitem name ="Reminder" id="reminder_menu" parent="hr_reminder_menu" action="action_hr_reminder"/>
</data>
</openerp>

11
hr_reminder/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="/hr_reminder/static/src/css/notification.css"/>
<script type="text/javascript" src="/hr_reminder/static/src/js/reminder_topbar.js"></script>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save