From 9c5fbd03d80d27420851c2272cb82467efd58f8a Mon Sep 17 00:00:00 2001 From: braisab Date: Wed, 7 Feb 2024 18:01:33 +0100 Subject: [PATCH] [IMP]14.0-pms_housekeeping: new hr_employee inherit and housekeeping_task_type model --- pms_housekeeping/README.rst | 2 +- pms_housekeeping/__manifest__.py | 14 +- pms_housekeeping/data/cron_jobs.xml | 19 - .../data/pms_housekeeping_data.xml | 6 + pms_housekeeping/demo/pms_housekeeping.xml | 63 --- pms_housekeeping/i18n/pms_housekeeping.pot | 395 ------------------ pms_housekeeping/models/__init__.py | 6 +- pms_housekeeping/models/hr_employee.py | 14 + pms_housekeeping/models/pms_housekeeping.py | 42 -- .../models/pms_housekeeping_task.py | 42 -- .../models/pms_housekeeping_task_type.py | 40 ++ pms_housekeeping/models/pms_reservation.py | 13 - pms_housekeeping/models/pms_room.py | 140 ------- pms_housekeeping/security/ir.model.access.csv | 3 +- .../static/description/index.html | 2 +- pms_housekeeping/views/hr_employee_views.xml | 13 + .../pms_housekeeping_task_type_views.xml | 41 ++ .../views/pms_housekeeping_task_view.xml | 34 -- .../views/pms_housekeeping_views.xml | 274 +----------- .../views/pms_reservation_view.xml | 15 - pms_housekeeping/views/pms_room_view.xml | 212 ---------- 21 files changed, 144 insertions(+), 1246 deletions(-) delete mode 100644 pms_housekeeping/data/cron_jobs.xml create mode 100644 pms_housekeeping/data/pms_housekeeping_data.xml delete mode 100644 pms_housekeeping/demo/pms_housekeeping.xml delete mode 100644 pms_housekeeping/i18n/pms_housekeeping.pot create mode 100644 pms_housekeeping/models/hr_employee.py delete mode 100644 pms_housekeeping/models/pms_housekeeping.py delete mode 100644 pms_housekeeping/models/pms_housekeeping_task.py create mode 100644 pms_housekeeping/models/pms_housekeeping_task_type.py delete mode 100644 pms_housekeeping/models/pms_reservation.py delete mode 100644 pms_housekeeping/models/pms_room.py create mode 100644 pms_housekeeping/views/hr_employee_views.xml create mode 100644 pms_housekeeping/views/pms_housekeeping_task_type_views.xml delete mode 100644 pms_housekeeping/views/pms_housekeeping_task_view.xml delete mode 100644 pms_housekeeping/views/pms_reservation_view.xml delete mode 100644 pms_housekeeping/views/pms_room_view.xml diff --git a/pms_housekeeping/README.rst b/pms_housekeeping/README.rst index c3eaa9ee2..2e279c381 100644 --- a/pms_housekeeping/README.rst +++ b/pms_housekeeping/README.rst @@ -7,7 +7,7 @@ Housekeeping !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:20e74e9aef367010d0747e723279da0e6888174bdbc3a21577fc71504fb9fe12 + !! source digest: sha256:de773807356222adab5ee772d075d86a64a8a09828b1e137748c9562380fe750 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/pms_housekeeping/__manifest__.py b/pms_housekeeping/__manifest__.py index 8c5e3b195..425dc36f1 100644 --- a/pms_housekeeping/__manifest__.py +++ b/pms_housekeeping/__manifest__.py @@ -12,18 +12,14 @@ "depends": [ "pms", "hr", + "pms_hr_property", ], "data": [ - # "wizard/housekeeping_rack.xml", - "views/pms_room_view.xml", - "views/pms_reservation_view.xml", - "views/pms_housekeeping_task_view.xml", - "views/pms_housekeeping_views.xml", "security/ir.model.access.csv", - "data/cron_jobs.xml", - ], - "demo": [ - "demo/pms_housekeeping.xml", + "data/pms_housekeeping_data.xml", + "views/hr_employee_views.xml", + "views/pms_housekeeping_task_type_views.xml", + "views/pms_housekeeping_views.xml", ], "installable": True, } diff --git a/pms_housekeeping/data/cron_jobs.xml b/pms_housekeeping/data/cron_jobs.xml deleted file mode 100644 index 9686f4861..000000000 --- a/pms_housekeeping/data/cron_jobs.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Automatic add all today housekeeping tasks - 1 - - days - -1 - - code - - - model.add_all_today_tasks() - - diff --git a/pms_housekeeping/data/pms_housekeeping_data.xml b/pms_housekeeping/data/pms_housekeeping_data.xml new file mode 100644 index 000000000..9e7782898 --- /dev/null +++ b/pms_housekeeping/data/pms_housekeeping_data.xml @@ -0,0 +1,6 @@ + + + Housekeeper + open + + diff --git a/pms_housekeeping/demo/pms_housekeeping.xml b/pms_housekeeping/demo/pms_housekeeping.xml deleted file mode 100644 index c47eb8462..000000000 --- a/pms_housekeeping/demo/pms_housekeeping.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Full clean - exit - - - Soft clean - occupied - - - Review - - - Inspect - - exit - - - Inspect - - occupied - - - - - - - to_do - - - - - - to_do - - - - - - draft - - - - - - draft - - - Need clean it again - - - - to_do - - - - - - draft - - diff --git a/pms_housekeeping/i18n/pms_housekeeping.pot b/pms_housekeeping/i18n/pms_housekeeping.pot deleted file mode 100644 index 7d9562047..000000000 --- a/pms_housekeeping/i18n/pms_housekeeping.pot +++ /dev/null @@ -1,395 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * pms_housekeeping -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" -"Report-Msgid-Bugs-To: \n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_housekeeping_rack_kanban -msgid "" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_room_rack_kanban -msgid "" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__active -msgid "Active" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_room_rack_kanban -msgid "Add the housekeeping tasks" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.actions.server,name:pms_housekeeping.add_all_today_tasks_ir_actions_server -#: model:ir.cron,cron_name:pms_housekeeping.add_all_today_tasks -#: model:ir.cron,name:pms_housekeeping.add_all_today_tasks -msgid "Automatic add all today housekeeping tasks" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping_task__clean_type__clean -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_room__clean_status__clean -msgid "Clean" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.inherit_pms_room_view_form -msgid "Clean Status" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__task_date -msgid "Clean date" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__clean_type -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_room__clean_status -msgid "Clean type" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_room_rack_form -msgid "Clean type and status" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,help:pms_housekeeping.field_pms_room__clean_employee_id -msgid "Cleaning employee assigned by default" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__color -msgid "Color Index" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__create_uid -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__create_uid -msgid "Created by" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__create_date -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__create_date -msgid "Created on" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_room__clean_employee_id -msgid "Default employee" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_room_rack_kanban -msgid "Default:" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_housekeeping_rack_kanban -msgid "Delete" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__display_name -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__display_name -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_reservation__display_name -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_room__display_name -msgid "Display Name" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping_task__clean_type__dont_disturb -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_room__clean_status__dont_disturb -msgid "Don't disturb" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping__state__done -msgid "Done" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_reservation__dont_disturb -msgid "Dont disturb" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping__state__draft -msgid "Draft" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_housekeeping_rack_kanban -msgid "Edit" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__employee_id -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_filter_housekeeping_rack -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_filter_room_rack -msgid "Employee" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__def_employee_id -msgid "Employee assigned by default" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_housekeeping_rack_kanban -msgid "Employee image" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_room__employee_picture -msgid "Employee picture" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping_task__clean_type__exit -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_room__clean_status__exit -msgid "Exit" -msgstr "" - -#. module: pms_housekeeping -#: model:pms.housekeeping.task,name:pms_housekeeping.pms_housekeeping_task_0 -msgid "Full clean" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.ui.menu,name:pms_housekeeping.menu_action_pms_house_keeping_tasks_view_form -msgid "House Keeping Tasks" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model,name:pms_housekeeping.model_pms_housekeeping -msgid "HouseKeeping" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model,name:pms_housekeeping.model_pms_housekeeping_task -msgid "HouseKeeping Tasks" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.actions.act_window,name:pms_housekeeping.action_pms_house_keeping_view_form -#: model:ir.actions.act_window,name:pms_housekeeping.action_pms_house_keeping_view_today_form -#: model:ir.actions.act_window,name:pms_housekeeping.action_pms_room_rack_kanban -#: model:ir.ui.menu,name:pms_housekeeping.menu_action_pms_house_keeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_housekeeping_form -msgid "Housekeeping" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.actions.act_window,name:pms_housekeeping.action_pms_house_keeping_tasks_view_form -msgid "Housekeeping Tasks" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_filter_housekeeping_rack -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_filter_room_rack -msgid "Housekeeping filters" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_room__housekeeping_ids -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_housekeeping_tree -msgid "Housekeeping tasks" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__id -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__id -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_reservation__id -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_room__id -msgid "ID" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping__state__in_progress -msgid "In Progress" -msgstr "" - -#. module: pms_housekeeping -#: model:pms.housekeeping.task,name:pms_housekeeping.pms_housekeeping_task_3 -#: model:pms.housekeeping.task,name:pms_housekeeping.pms_housekeeping_task_4 -msgid "Inspect" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping_task__clean_type__inspected -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_room__clean_status__inspected -msgid "Inspected" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__notes -msgid "Internal Notes" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping____last_update -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task____last_update -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_reservation____last_update -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_room____last_update -msgid "Last Modified on" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__write_uid -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__write_uid -msgid "Last Updated by" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__write_date -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__write_date -msgid "Last Updated on" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__lostfound -msgid "Lost and Found" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping_task__clean_type__occupied -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_room__clean_status__occupied -msgid "Occupied" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping_task__clean_type__picked_up -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_room__clean_status__picked_up -msgid "Picked up" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__pms_property_ids -msgid "Properties" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,help:pms_housekeeping.field_pms_housekeeping_task__pms_property_ids -msgid "" -"Properties with access to the element; if not set, all properties can access" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model,name:pms_housekeeping.model_pms_room -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_room_rack_form -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_room_rack_tree -msgid "Property Room" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_housekeeping_tasks_tree -msgid "Property Ubications" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model,name:pms_housekeeping.model_pms_reservation -msgid "Reservation" -msgstr "" - -#. module: pms_housekeeping -#: model:pms.housekeeping.task,name:pms_housekeeping.pms_housekeeping_task_2 -msgid "Review" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__room_id -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_filter_housekeeping_rack -msgid "Room" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.ui.menu,name:pms_housekeeping.menu_action_pms_house_keeping_view_rack -msgid "Room Rack" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_filter_room_rack -msgid "Room type" -msgstr "" - -#. module: pms_housekeeping -#: model:pms.housekeeping.task,name:pms_housekeeping.pms_housekeeping_task_1 -msgid "Soft clean" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping_task__clean_type__staff -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_room__clean_status__staff -msgid "Staff" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__task_id -msgid "Task" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_room_rack_form -msgid "Task Lines" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping_task__name -msgid "Task Name" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__state -msgid "Task State" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__task_end -msgid "Task end at" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields,field_description:pms_housekeeping.field_pms_housekeeping__task_start -msgid "Task start at" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_filter_housekeeping_rack -msgid "Task type" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.ui.menu,name:pms_housekeeping.menu_action_pms_house_keeping_view_form -msgid "Tasks History" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.model.fields.selection,name:pms_housekeeping.selection__pms_housekeeping__state__to_do -msgid "To Do" -msgstr "" - -#. module: pms_housekeeping -#: model:ir.ui.menu,name:pms_housekeeping.menu_action_pms_house_keeping_view_today_form -msgid "Today Tasks" -msgstr "" - -#. module: pms_housekeeping -#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_filter_room_rack -msgid "Ubication" -msgstr "" diff --git a/pms_housekeeping/models/__init__.py b/pms_housekeeping/models/__init__.py index 4ec8da670..18e51fcb1 100644 --- a/pms_housekeeping/models/__init__.py +++ b/pms_housekeeping/models/__init__.py @@ -1,7 +1,5 @@ # Copyright 2021 Jose Luis Algara # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from . import pms_housekeeping_task -from . import pms_housekeeping -from . import pms_reservation -from . import pms_room +from . import hr_employee +from . import pms_housekeeping_task_type diff --git a/pms_housekeeping/models/hr_employee.py b/pms_housekeeping/models/hr_employee.py new file mode 100644 index 000000000..130ca4aa2 --- /dev/null +++ b/pms_housekeeping/models/hr_employee.py @@ -0,0 +1,14 @@ +# Copyright 2020 Jose Luis Algara (Alda Hotels ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class HrEmployee(models.Model): + _inherit = "hr.employee" + + pre_assigned_room_ids = fields.Many2many( + comodel_name="pms.room", + string="Pre Assigned Rooms", + help="Rooms pre assigned to this employee", + ) diff --git a/pms_housekeeping/models/pms_housekeeping.py b/pms_housekeeping/models/pms_housekeeping.py deleted file mode 100644 index f97a935d9..000000000 --- a/pms_housekeeping/models/pms_housekeeping.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2020 Jose Luis Algara (Alda Hotels ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class HouseKeeping(models.Model): - _name = "pms.housekeeping" - _description = "HouseKeeping" - # HouseKeeping 'log' - - # Fields declaration - - task_date = fields.Date( - string="Clean date", default=lambda self: fields.Datetime.now(), required=True - ) - task_start = fields.Datetime(string="Task start at") - task_end = fields.Datetime(string="Task end at") - room_id = fields.Many2one("pms.room", string="Room") - employee_id = fields.Many2one("hr.employee", string="Employee") - task_id = fields.Many2one("pms.housekeeping.task", string="Task", required=True) - notes = fields.Text("Internal Notes") - lostfound = fields.Text("Lost and Found") - state = fields.Selection( - string="Task State", - selection=[ - ("draft", "Draft"), - ("to_do", "To Do"), - ("in_progress", "In Progress"), - ("done", "Done"), - ], - default="draft", - ) - color = fields.Integer("Color Index") - - # Default Methods ang Gets - def name_get(self): - result = [] - for task in self: - name = task.task_id.name - result.append((task.id, name)) - return result diff --git a/pms_housekeeping/models/pms_housekeeping_task.py b/pms_housekeeping/models/pms_housekeeping_task.py deleted file mode 100644 index d3e09cebb..000000000 --- a/pms_housekeeping/models/pms_housekeeping_task.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2020 Jose Luis Algara (Alda Hotels ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class HouseKeepingTask(models.Model): - _name = "pms.housekeeping.task" - _description = "HouseKeeping Tasks" - # HouseKeeping 'Task types' - - # Fields declaration - active = fields.Boolean("Active", default=True) - name = fields.Char("Task Name", translate=True, required=True) - pms_property_ids = fields.Many2many( - string="Properties", - help="Properties with access to the element;" - " if not set, all properties can access", - required=False, - comodel_name="pms.property", - relation="pms_housekeepink_task_pms_property_rel", - column1="pms_housekeepink_task_id", - column2="pms_property_id", - ondelete="restrict", - check_pms_properties=True, - ) - - clean_type = fields.Selection( - string="Clean type", - selection=[ - ("occupied", "Occupied"), - ("exit", "Exit"), - ("picked_up", "Picked up"), - ("staff", "Staff"), - ("clean", "Clean"), - ("inspected", "Inspected"), - ("dont_disturb", "Don't disturb"), - ], - ) - def_employee_id = fields.Many2one( - "hr.employee", string="Employee assigned by default" - ) diff --git a/pms_housekeeping/models/pms_housekeeping_task_type.py b/pms_housekeeping/models/pms_housekeeping_task_type.py new file mode 100644 index 000000000..f00022e62 --- /dev/null +++ b/pms_housekeeping/models/pms_housekeeping_task_type.py @@ -0,0 +1,40 @@ +from odoo import fields, models + + +class PmsHouseKeepingTaskType(models.Model): + _name = "pms.housekeeping.task.type" + + name = fields.Char(string="Name", required=True) + description = fields.Text(string="Description") + is_automated = fields.Boolean(string="Is Automated") + clean_event = fields.Selection( + selection=[ + ("overnight", "Overnight"), + ("checkin", "Checkin"), + ("checkout", "Checkout"), + ("empty", "Empty"), + ("priority", "Priority"), + ], + string="Clean When", + required=True, + default="overnight", + ) + days_after_clean_event = fields.Integer(string="Days After Clean Event") + housekeepers = fields.Many2many( + comodel_name="hr.employee", + relation="pms_housekeeping_task_type_hr_employee_rel", + column1="task_type_id", + column2="employee_id", + string="Housekeepers", + domain="[('job_id.name', '=', 'Housekeeper')]", + ) + parent_id = fields.Many2many( + string="Parent Task Type", + help="Indicates that this task type is a child of another task type", + comodel_name="pms.housekeeping.task.type", + relation="pms_housekeeping_task_type_rel", + column1="parent_task_type_id", + column2="child_task_type_id", + ondelete="restrict", + domain="[('id', '!=', id)]", + ) diff --git a/pms_housekeeping/models/pms_reservation.py b/pms_housekeeping/models/pms_reservation.py deleted file mode 100644 index 10cd05469..000000000 --- a/pms_housekeeping/models/pms_reservation.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2021 Jose Luis Algara (Alda Hotels ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class PmsRoom(models.Model): - _inherit = "pms.reservation" - - dont_disturb = fields.Boolean( - string="Dont disturb", - default=False, - ) diff --git a/pms_housekeeping/models/pms_room.py b/pms_housekeeping/models/pms_room.py deleted file mode 100644 index 17a31b69d..000000000 --- a/pms_housekeeping/models/pms_room.py +++ /dev/null @@ -1,140 +0,0 @@ -# Copyright 2021 Jose Luis Algara (Alda Hotels ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -import logging -from datetime import datetime, timedelta - -from odoo import fields, models - -_logger = logging.getLogger(__name__) - - -def kanban_card_color(state): - colors = { - "occupied": 2, - "exit": 3, - "picked_up": 7, - "staff": 11, - "clean": 4, - "inspected": 10, - "dont_disturb": 9, - } - return colors[state] - - -class PmsRoom(models.Model): - _inherit = "pms.room" - - housekeeping_ids = fields.One2many( - string="Housekeeping tasks", - comodel_name="pms.housekeeping", - inverse_name="room_id", - domain=[("task_date", "=", datetime.now().date())], - ) - - clean_status = fields.Selection( - string="Clean type", - selection=[ - ("occupied", "Occupied"), - ("exit", "Exit"), - ("picked_up", "Picked up"), - ("staff", "Staff"), - ("clean", "Clean"), - ("inspected", "Inspected"), - ("dont_disturb", "Don't disturb"), - ], - compute="_compute_clean_status", - # store=True, - ) - - clean_employee_id = fields.Many2one( - "hr.employee", - string="Default employee", - help="Cleaning employee assigned by default", - ) - employee_picture = fields.Binary( - string="Employee picture", related="clean_employee_id.image_1920" - ) - - # @api.depends('clean_status_now') - def _compute_clean_status(self): - for room in self: - room.clean_status = room.get_clean_status() - return - - # Business methods - def get_clean_status(self, date_clean=False, margin_days=5): - status = "NONE" - if not date_clean: - date_clean = fields.Date.today() - reservations = self.env["pms.reservation.line"].search( - [ - ("room_id", "=", self.id), - ("date", "<=", date_clean + timedelta(days=margin_days)), - ("date", ">=", date_clean - timedelta(days=margin_days)), - ] - ) - today_res = reservations.filtered( - lambda reservation: reservation.date == date_clean - ) - yesterday_res = reservations.filtered( - lambda reservation: reservation.date == date_clean - (timedelta(days=1)) - ) - lasts_res = reservations.filtered( - lambda reservation: reservation.date < date_clean - ) - - if today_res.reservation_id.reservation_type == "out": - status = "dont_disturb" - return status - if len(today_res) == 0: - if len(yesterday_res) != 0: - status = "exit" - elif len(lasts_res) != 0: - status = "clean" - else: - # TODO hace cuantos dias se limpio o repaso.?? - status = "picked_up" - return status - else: - if yesterday_res.reservation_id != today_res.reservation_id: - status = "exit" - else: - if today_res.reservation_id.reservation_type == "staff": - status = "staff" - elif today_res.reservation_id.dont_disturb: - status = "dont_disturb" - else: - status = "occupied" - # TODO hace cuantos dias que la ocupa.?? - return status - - def add_today_tasks(self): - for room in self: - tasks = self.env["pms.housekeeping.task"].search( - [("clean_type", "=", room.clean_status)] - ) - for task in tasks: - new_task = self.env["pms.housekeeping"] - employee = ( - task.def_employee_id.id - if len(task.def_employee_id) > 0 - else room.clean_employee_id.id - ) - new_task.create( - { - "room_id": room.id, - "employee_id": employee, - "task_id": task.id, - "state": "draft", - "color": kanban_card_color(room.clean_status), - } - ) - return - - def add_all_today_tasks(self): - rooms = self.env["pms.room"].search([]) - _logger.warning("Init Add All today Task") - for room in rooms: - room.add_today_tasks() - return diff --git a/pms_housekeeping/security/ir.model.access.csv b/pms_housekeeping/security/ir.model.access.csv index 5c5e86eae..7f91d9e28 100644 --- a/pms_housekeeping/security/ir.model.access.csv +++ b/pms_housekeeping/security/ir.model.access.csv @@ -1,3 +1,2 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -user_access_pms_housekeeping,user_access_pms_housekeeping,model_pms_housekeeping,pms.group_pms_user,1,1,1,1 -user_access_pms_housekeeping_task,user_access_pms_housekeeping_task,model_pms_housekeeping_task,pms.group_pms_user,1,1,1,1 +user_access_pms_housekeeping_task_type,user_access_pms_housekeeping_task_type,model_pms_housekeeping_task_type,pms.group_pms_user,1,1,1,1 diff --git a/pms_housekeeping/static/description/index.html b/pms_housekeeping/static/description/index.html index fbeae54a7..49c265c4b 100644 --- a/pms_housekeeping/static/description/index.html +++ b/pms_housekeeping/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:20e74e9aef367010d0747e723279da0e6888174bdbc3a21577fc71504fb9fe12 +!! source digest: sha256:de773807356222adab5ee772d075d86a64a8a09828b1e137748c9562380fe750 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/pms Translate me on Weblate Try me on Runboat

This module adds housekeeping feature to property management system (PMS).

diff --git a/pms_housekeeping/views/hr_employee_views.xml b/pms_housekeeping/views/hr_employee_views.xml new file mode 100644 index 000000000..93c1553e3 --- /dev/null +++ b/pms_housekeeping/views/hr_employee_views.xml @@ -0,0 +1,13 @@ + + + + hr.employee + + + + + + + + + diff --git a/pms_housekeeping/views/pms_housekeeping_task_type_views.xml b/pms_housekeeping/views/pms_housekeeping_task_type_views.xml new file mode 100644 index 000000000..dc788b228 --- /dev/null +++ b/pms_housekeeping/views/pms_housekeeping_task_type_views.xml @@ -0,0 +1,41 @@ + + + + + pms.housekeeping.task.type.tree + pms.housekeeping.task.type + + + + + + + + + + + + + + pms.housekeeping.task.type.form + pms.housekeeping.task.type + form + +
+ + + + + + + + + +
+
+
+
+
diff --git a/pms_housekeeping/views/pms_housekeeping_task_view.xml b/pms_housekeeping/views/pms_housekeeping_task_view.xml deleted file mode 100644 index ae9e9da4a..000000000 --- a/pms_housekeeping/views/pms_housekeeping_task_view.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Housekeeping Tasks view - pms.housekeeping.task - tree - primary - - - - - - - - - - - - - Housekeeping Tasks - pms.housekeeping.task - tree,form - - - - - diff --git a/pms_housekeeping/views/pms_housekeeping_views.xml b/pms_housekeeping/views/pms_housekeeping_views.xml index 0e9398f33..685523638 100644 --- a/pms_housekeeping/views/pms_housekeeping_views.xml +++ b/pms_housekeeping/views/pms_housekeeping_views.xml @@ -1,257 +1,23 @@ - - Housekeeping tree view - pms.housekeeping - tree - primary - - - - - - - - - - - - - - - - - - - Housekeeping form view - pms.housekeeping - form - -
- - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - Housekeeping today tasks kanban view - pms.housekeeping - kanban - primary - - - - - - - - - - - -
- -
- - -
- -
-
- -
- -
- - - Employee image - -
-
- - - -
-
-
-
- - - - - - - - pms.housekeeping - - - - - - - - - - - - - - - - - - - - - - - - - - - Housekeeping - pms.housekeeping - tree,form - - - - Housekeeping - pms.housekeeping - [('task_date', '=',(context_today().strftime('%Y-%m-%d')))] - - kanban,tree,form - - - - - - - + + + Housekeeping Task Type + pms.housekeeping.task.type + tree,form + + + + diff --git a/pms_housekeeping/views/pms_reservation_view.xml b/pms_housekeeping/views/pms_reservation_view.xml deleted file mode 100644 index 79131a42d..000000000 --- a/pms_housekeeping/views/pms_reservation_view.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - view.model.form - pms.reservation - - - - - - - - - diff --git a/pms_housekeeping/views/pms_room_view.xml b/pms_housekeeping/views/pms_room_view.xml deleted file mode 100644 index 783746551..000000000 --- a/pms_housekeeping/views/pms_room_view.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - view.model.form - pms.room - - - - - - - - - - - - - Room rack form view - pms.room - form - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - Room rack tree view - pms.room - tree - - - - - - - - - - - - - - - pms.room - - - - - - - - - - - - - - - - - - - Room rack kanban view - pms.room - kanban - primary - - - - - - - -
- -
- -
- - -
- -
- -
- - - -
-
-
-
- - - - - - - Housekeeping - pms.room - kanban,tree,form - - - -