[ADD]show_unusual_days_on_calendar
This commit is contained in:
1
show_unusual_days_on_calendar/__init__.py
Normal file
1
show_unusual_days_on_calendar/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
36
show_unusual_days_on_calendar/__manifest__.py
Normal file
36
show_unusual_days_on_calendar/__manifest__.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# Copyright 2022 Stéphan Sainléger (Elabore)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "show_unusual_days_on_calendar",
|
||||
"version": "14.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Clément Thomas / Laetitia Da Costa",
|
||||
"license": "AGPL-3",
|
||||
"category": "Tools",
|
||||
"summary": "show unusual days such as leaves or holidays on event calendar in the same way it does in hr_leave calendar \n (event in gray background and white borders)",
|
||||
# any module necessary for this one to work correctly
|
||||
"depends": [
|
||||
"calendar",
|
||||
"hr_holidays",
|
||||
],
|
||||
"qweb": [
|
||||
],
|
||||
"external_dependencies": {
|
||||
"python": [],
|
||||
},
|
||||
# always loaded
|
||||
"data": [
|
||||
'views/calendar_event_views.xml',
|
||||
],
|
||||
# only loaded in demonstration mode
|
||||
"demo": [],
|
||||
"js": [],
|
||||
"css": [],
|
||||
"installable": True,
|
||||
# Install this module automatically if all dependency have been previously
|
||||
# and independently installed. Used for synergetic or glue modules.
|
||||
"auto_install": False,
|
||||
"application": False,
|
||||
}
|
1
show_unusual_days_on_calendar/models/__init__.py
Normal file
1
show_unusual_days_on_calendar/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import calendar_event
|
12
show_unusual_days_on_calendar/models/calendar_event.py
Normal file
12
show_unusual_days_on_calendar/models/calendar_event.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
from datetime import datetime, time
|
||||
|
||||
class CalendarEvent(models.Model):
|
||||
_inherit = 'calendar.event'
|
||||
|
||||
@api.model
|
||||
def get_unusual_days(self, date_from, date_to=None):
|
||||
return self.env['hr.leave'].get_unusual_days(date_from, date_to=date_to)
|
15
show_unusual_days_on_calendar/views/calendar_event_views.xml
Normal file
15
show_unusual_days_on_calendar/views/calendar_event_views.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_calendar_event_calendar_unusual_days_inherit" model="ir.ui.view">
|
||||
<field name="name">calendar.event.calendar.unusual.days.inherit</field>
|
||||
<field name="model">calendar.event</field>
|
||||
<field name="inherit_id" ref="calendar.view_calendar_event_calendar"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar position="attributes">
|
||||
<attribute name="show_unusual_days">True</attribute>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
Reference in New Issue
Block a user