add new module

This commit is contained in:
sonal arora
2020-07-21 10:09:46 +00:00
parent 800e7fdceb
commit c0d10e3fbe
1063 changed files with 243750 additions and 5 deletions

30
hr_reminder/controllers/main.py Executable file
View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
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