diff options
| -rwxr-xr-x | indoteknik_custom/__manifest__.py | 1 | ||||
| -rwxr-xr-x | indoteknik_custom/models/__init__.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/public_holiday.py | 11 | ||||
| -rwxr-xr-x | indoteknik_custom/security/ir.model.access.csv | 1 | ||||
| -rw-r--r-- | indoteknik_custom/views/public_holiday.xml | 57 |
5 files changed, 71 insertions, 0 deletions
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index c1593c9e..580f43de 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -159,6 +159,7 @@ 'report/report_sale_order.xml', 'views/vendor_sla.xml', 'views/coretax_faktur.xml', + 'views/public_holiday.xml', ], 'demo': [], 'css': [], diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index 43fbf146..4c1ef68c 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -140,3 +140,4 @@ from . import va_multi_reject from . import vendor_sla from . import stock_immediate_transfer from . import coretax_fatur +from . import public_holiday diff --git a/indoteknik_custom/models/public_holiday.py b/indoteknik_custom/models/public_holiday.py new file mode 100644 index 00000000..70b7c53a --- /dev/null +++ b/indoteknik_custom/models/public_holiday.py @@ -0,0 +1,11 @@ +from odoo import api, fields, models +from datetime import timedelta, datetime + +class PublicHoliday(models.Model): + _name = 'hr.public.holiday' + _description = 'Public Holidays' + + name = fields.Char(string='Holiday Name', required=True) + start_date = fields.Date('Start Holiday Date', required=True) + end_date = fields.Date('End Holiday Date', required=True) + # company_id = fields.Many2one('res.company', 'Company') diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index b6212f1b..1f3835fa 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -157,3 +157,4 @@ access_User_pengajuan_tempo_line,access.user.pengajuan.tempo.line,model_user_pen access_user_pengajuan_tempo,access.user.pengajuan.tempo,model_user_pengajuan_tempo,,1,1,1,1 access_reject_reason_wizard,reject.reason.wizard,model_reject_reason_wizard,,1,1,1,0 access_confirm_approval_wizard,confirm.approval.wizard,model_confirm_approval_wizard,,1,1,1,0 +access_hr_public_holiday,confirm.hr.public.holiday,model_hr_public_holiday,,1,1,1,0 diff --git a/indoteknik_custom/views/public_holiday.xml b/indoteknik_custom/views/public_holiday.xml new file mode 100644 index 00000000..d0b9c5d5 --- /dev/null +++ b/indoteknik_custom/views/public_holiday.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<odoo> + <data> + <!-- Security Access Rights --> + <record id="model_hr_public_holiday_access" model="ir.model.access"> + <field name="name">hr.public.holiday access</field> + <field name="model_id" ref="model_hr_public_holiday"/> + <field name="group_id" eval="False"/> + <field name="perm_read" eval="True"/> + <field name="perm_write" eval="True"/> + <field name="perm_create" eval="True"/> + <field name="perm_unlink" eval="True"/> + </record> + + <!-- Public Holiday Form View --> + <record id="view_hr_public_holiday_form" model="ir.ui.view"> + <field name="name">hr.public.holiday.form</field> + <field name="model">hr.public.holiday</field> + <field name="arch" type="xml"> + <form string="Public Holiday"> + <sheet> + <group> + <field name="name"/> + <field name="start_date"/> + <field name="end_date"/> + </group> + </sheet> + </form> + </field> + </record> + + <record id="view_hr_public_holiday_tree" model="ir.ui.view"> + <field name="name">hr.public.holiday.tree</field> + <field name="model">hr.public.holiday</field> + <field name="arch" type="xml"> + <tree string="Public Holidays"> + <field name="name"/> + <field name="start_date"/> + <field name="end_date"/> + </tree> + </field> + </record> + <record id="action_hr_public_holiday" model="ir.actions.act_window"> + <field name="name">Public Holidays</field> + <field name="res_model">hr.public.holiday</field> + <field name="view_mode">tree,form</field> + </record> + + <menuitem + id="hr_public_holiday" + name="Public Holiday" + parent="website_sale.menu_orders" + sequence="1" + action="action_hr_public_holiday" + /> + </data> +</odoo> |
