[IMP]14.0-pms_housekeeping: new hr_employee inherit and housekeeping_task_type model

This commit is contained in:
braisab
2024-02-07 18:01:33 +01:00
committed by Darío Lodeiros
parent 3e14695c56
commit 9c5fbd03d8
21 changed files with 144 additions and 1246 deletions

View File

@@ -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

View File

@@ -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,
}

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Set all task -->
<record model="ir.cron" id="add_all_today_tasks">
<field name="name">Automatic add all today housekeeping tasks</field>
<field name="interval_number">1</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
<field name="state">code</field>
<field name="model_id" ref="model_pms_room" />
<field
name="nextcall"
eval="(DateTime.now() + timedelta(days=1)).strftime('%Y-%m-%d 03:00:00')"
/>
<field name="code">model.add_all_today_tasks()</field>
</record>
</odoo>

View File

@@ -0,0 +1,6 @@
<odoo noupdate="1">
<record id="housekeeping_job_id" model="hr.job">
<field name="name">Housekeeper</field>
<field name="state">open</field>
</record>
</odoo>

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- pms.housekeeping.task -->
<record id="pms_housekeeping_task_0" model="pms.housekeeping.task">
<field name="name">Full clean</field>
<field name="clean_type">exit</field>
</record>
<record id="pms_housekeeping_task_1" model="pms.housekeeping.task">
<field name="name">Soft clean</field>
<field name="clean_type">occupied</field>
</record>
<record id="pms_housekeeping_task_2" model="pms.housekeeping.task">
<field name="name">Review</field>
</record>
<record id="pms_housekeeping_task_3" model="pms.housekeeping.task">
<field name="name">Inspect</field>
<field name="def_employee_id" ref="hr.employee_vad" />
<field name="clean_type">exit</field>
</record>
<record id="pms_housekeeping_task_4" model="pms.housekeeping.task">
<field name="name">Inspect</field>
<field name="def_employee_id" ref="hr.employee_vad" />
<field name="clean_type">occupied</field>
</record>
<!-- pms.housekeeping -->
<record id="pms_housekeeping_0" model="pms.housekeeping">
<field name="room_id" ref="pms.pms_room_eco_04" />
<field name="employee_id" ref="hr.employee_jep" />
<field name="task_id" ref="pms_housekeeping.pms_housekeeping_task_0" />
<field name="state">to_do</field>
</record>
<record id="pms_housekeeping_1" model="pms.housekeeping">
<field name="room_id" ref="pms.pms_room_eco_03" />
<field name="employee_id" ref="hr.employee_jep" />
<field name="task_id" ref="pms_housekeeping.pms_housekeeping_task_0" />
<field name="state">to_do</field>
</record>
<record id="pms_housekeeping_2" model="pms.housekeeping">
<field name="room_id" ref="pms.pms_room_eco_01" />
<field name="employee_id" ref="hr.employee_jep" />
<field name="task_id" ref="pms_housekeeping.pms_housekeeping_task_1" />
<field name="state">draft</field>
</record>
<record id="pms_housekeeping_3" model="pms.housekeeping">
<field name="room_id" ref="pms.pms_room_eco_04" />
<field name="employee_id" ref="hr.employee_vad" />
<field name="task_id" ref="pms_housekeeping.pms_housekeeping_task_3" />
<field name="state">draft</field>
</record>
<record id="pms_housekeeping_4" model="pms.housekeeping">
<field name="notes">Need clean it again</field>
<field name="room_id" ref="pms.pms_room_eco_02" />
<field name="employee_id" ref="hr.employee_mit" />
<field name="task_id" ref="pms_housekeeping.pms_housekeeping_task_2" />
<field name="state">to_do</field>
</record>
<record id="pms_housekeeping_5" model="pms.housekeeping">
<field name="room_id" ref="pms.pms_room_eco_03" />
<field name="employee_id" ref="hr.employee_jog" />
<field name="task_id" ref="pms_housekeeping.pms_housekeeping_task_1" />
<field name="state">draft</field>
</record>
</odoo>

View File

@@ -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 "<span class=\"fa fa-ellipsis-v\" title=\"menu\"/>"
msgstr ""
#. module: pms_housekeeping
#: model_terms:ir.ui.view,arch_db:pms_housekeeping.view_pms_room_rack_kanban
msgid "<span class=\"fa fa-plus-square\" title=\"Add all today tasks\"/>"
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 ""

View File

@@ -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

View File

@@ -0,0 +1,14 @@
# Copyright 2020 Jose Luis Algara (Alda Hotels <https://www.aldahotels.es>)
# 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",
)

View File

@@ -1,42 +0,0 @@
# Copyright 2020 Jose Luis Algara (Alda Hotels <https://www.aldahotels.es>)
# 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

View File

@@ -1,42 +0,0 @@
# Copyright 2020 Jose Luis Algara (Alda Hotels <https://www.aldahotels.es>)
# 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"
)

View File

@@ -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)]",
)

View File

@@ -1,13 +0,0 @@
# Copyright 2021 Jose Luis Algara (Alda Hotels <https://www.aldahotels.es>)
# 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,
)

View File

@@ -1,140 +0,0 @@
# Copyright 2021 Jose Luis Algara (Alda Hotels <https://www.aldahotels.es>)
# 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

View File

@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 user_access_pms_housekeeping user_access_pms_housekeeping_task_type user_access_pms_housekeeping user_access_pms_housekeeping_task_type model_pms_housekeeping model_pms_housekeeping_task_type 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

View File

@@ -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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pms/tree/14.0/pms_housekeeping"><img alt="OCA/pms" src="https://img.shields.io/badge/github-OCA%2Fpms-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pms-14-0/pms-14-0-pms_housekeeping"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pms&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds housekeeping feature to property management system (PMS).</p>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="hr_housekeeping_employee_form" model="ir.ui.view">
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='work_location']" position="after">
<field name="pre_assigned_room_ids" widget="many2many_tags" />
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="view_pms_housekeeping_task_type_tree" model="ir.ui.view">
<field name="name">pms.housekeeping.task.type.tree</field>
<field name="model">pms.housekeeping.task.type</field>
<field name="arch" type="xml">
<tree string="Housekeeping Task Type">
<field name="name" />
<field name="description" />
<field name="is_automated" />
<field name="clean_event" />
<field name="days_after_clean_event" />
<field name="housekeepers" />
<field name="parent_id" />
</tree>
</field>
</record>
<record id="view_pms_housekeeping_task_type_form" model="ir.ui.view">
<field name="name">pms.housekeeping.task.type.form</field>
<field name="model">pms.housekeeping.task.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Housekeeping Task Type">
<group>
<field name="name" />
<field name="description" />
<field name="is_automated" />
<field name="clean_event" />
<field
name="days_after_clean_event"
attrs="{'invisible': [('clean_event', '!=', 'overnight'), ('clean_event', '!=', 'empty')]}"
/>
<field name="housekeepers" widget="many2many_tags" />
<field name="parent_id" widget="many2many_tags" />
</group>
</form>
</field>
</record>
</data>
</odoo>

View File

@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_pms_housekeeping_tasks_tree" model="ir.ui.view">
<field name="name">Housekeeping Tasks view</field>
<field name="model">pms.housekeeping.task</field>
<field name="type">tree</field>
<field name="mode">primary</field>
<field name="priority" eval="16" />
<field name="active" eval="True" />
<field name="arch" type="xml">
<tree name=" Property Ubications">
<field name="active" colspan="1" />
<field name="name" colspan="1" />
<field name="clean_type" colspan="1" />
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_pms_house_keeping_tasks_view_form">
<field name="name">Housekeeping Tasks</field>
<field name="res_model">pms.housekeeping.task</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
name="House Keeping Tasks"
id="menu_action_pms_house_keeping_tasks_view_form"
action="action_pms_house_keeping_tasks_view_form"
sequence="90"
parent="pms.pms_configuration_menu"
/>
</odoo>

View File

@@ -1,257 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_pms_housekeeping_tree" model="ir.ui.view">
<field name="name">Housekeeping tree view</field>
<field name="model">pms.housekeeping</field>
<field name="type">tree</field>
<field name="mode">primary</field>
<field name="priority" eval="16" />
<field name="active" eval="True" />
<field name="arch" type="xml">
<tree name="Housekeeping tasks">
<field name="task_date" colspan="1" />
<field name="state" colspan="1" />
<field name="room_id" colspan="1" />
<field name="employee_id" colspan="1" />
<field name="task_id" colspan="1" />
<field name="task_start" />
<field name="task_end" />
<field name="notes" colspan="1" />
<field name="lostfound" />
</tree>
</field>
</record>
<record id="view_pms_housekeeping_form" model="ir.ui.view">
<field name="name">Housekeeping form view</field>
<field name="model">pms.housekeeping</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Housekeeping">
<sheet>
<group>
<group col="2" colspan="2">
<field name="task_id" />
</group>
<group col="4" colspan="2">
<field name="task_date" />
<field name="task_start" />
<field name="state" />
<field name="task_end" />
</group>
<group col="4" colspan="2">
<field name="room_id" />
<field name="employee_id" />
</group>
<group col="4" colspan="2">
<field name="notes" />
<field name="lostfound" />
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_pms_housekeeping_rack_kanban" model="ir.ui.view">
<field name="name">Housekeeping today tasks kanban view</field>
<field name="model">pms.housekeeping</field>
<field name="type">kanban</field>
<field name="mode">primary</field>
<field name="priority" eval="16" />
<field name="active" eval="True" />
<field name="arch" type="xml">
<kanban
default_group_by="employee_id"
default_order="room_id"
class="o_res_partner_kanban"
sample="1"
group_create="false"
create="false"
>
<field name="color" />
<field name="state" />
<field name="employee_id" />
<templates>
<t t-name="kanban-box">
<div
t-attf-class="oe_kanban_global_click
oe_kanban_color_#{kanban_getcolor(record.color.raw_value)}"
>
<div class="o_dropdown_kanban dropdown">
<!-- Top-right drop down menu here... -->
<a
class="dropdown-toggle btn"
data-toggle="dropdown"
role="button"
href="#"
>
<span class="fa fa-ellipsis-v" title="menu" />
</a>
<div class="dropdown-menu" role="menu">
<!-- Edit and Delete actions, if available: -->
<t t-if="widget.editable">
<a
role="menuitem"
type="edit"
class="dropdown-item"
>Edit</a>
</t>
<t t-if="widget.deletable">
<a
role="menuitem"
type="delete"
class="dropdown-item"
>Delete</a>
</t>
<!-- Color picker option: -->
<!-- <ul class="oe_kanban_colorpicker" data-field="color"/>-->
</div>
</div>
<div class="oe_kanban_body">
<!-- Content elements and fields go here... -->
<div style="font-size: 1.5em;">
<field name="task_id" />
</div>
<div style="font-size: 1.1em;">
<field name="room_id" />
</div>
<div class="o_kanban_image float-right">
<t t-if="record.employee_id.raw_value">
<img
alt="Employee image"
t-att-title="record.employee_id.value"
t-att-alt="record.employee_id.value"
t-att-src="kanban_image('hr.employee', 'image_128', record.employee_id.raw_value)"
width="40"
height="40"
class="oe_kanban_avatar"
/>
</t>
</div>
</div>
<div class="oe_kanban_footer">
<div class="oe_kanban_footer_left">
<!-- Left hand footer... -->
<!-- <div style="font-size: 0.8em;">-->
<!-- <field name="state"/>-->
<!-- </div>-->
<div style="font-size: 0.8em;">
<field name="notes" />
</div>
<div>
<!-- <field name="clean_type" /> -->
</div>
</div>
<div class="oe_kanban_footer_right">
<field name="state" widget="state_selection" />
</div>
</div>
<div class="oe_clear" />
<div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_filter_housekeeping_rack" model="ir.ui.view">
<field name="model">pms.housekeeping</field>
<field name="arch" type="xml">
<search string="Housekeeping filters">
<field name="employee_id" />
<!-- <field name="room_id.floor_id" />-->
<field name="task_id" />
<!-- <filter name="filter_occupied" string="Occupied" domain="[('clean_status','=','occupied')]"/> -->
<searchpanel>
<!-- <field-->
<!-- name="room_id.floor_id"-->
<!-- string="Floor"-->
<!-- enable_counters="1"-->
<!-- select="multi"-->
<!-- icon="fa-hospital-o"-->
<!-- />-->
<field
name="task_id"
string="Task type"
enable_counters="1"
select="multi"
icon="fa-bath"
/>
<field
name="employee_id"
string="Employee"
enable_counters="1"
select="multi"
icon="fa-user"
/>
<field
name="room_id"
string="Room"
enable_counters="1"
select="multi"
icon="fa-bed"
/>
<!-- <field name="clean_status" string="Clean Type" enable_counters="1" select="multi"/> -->
</searchpanel>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_pms_house_keeping_view_form">
<field name="name">Housekeeping</field>
<field name="res_model">pms.housekeeping</field>
<field name="view_mode">tree,form</field>
</record>
<record model="ir.actions.act_window" id="action_pms_house_keeping_view_today_form">
<field name="name">Housekeeping</field>
<field name="res_model">pms.housekeeping</field>
<field name="domain">[('task_date', '=',(context_today().strftime('%Y-%m-%d')))]
</field>
<field name="view_mode">kanban,tree,form</field>
</record>
<menuitem
name="Housekeeping"
id="menu_action_pms_house_keeping"
sequence="17"
parent="pms.pms_management_menu"
/>
<menuitem
name="Room Rack"
id="menu_action_pms_house_keeping_view_rack"
action="pms_housekeeping.action_pms_room_rack_kanban"
sequence="10"
parent="pms_housekeeping.menu_action_pms_house_keeping"
/>
<menuitem
name="Today Tasks"
id="menu_action_pms_house_keeping_view_today_form"
action="action_pms_house_keeping_view_today_form"
sequence="20"
parent="pms_housekeeping.menu_action_pms_house_keeping"
/>
<menuitem
name="Tasks History"
id="menu_action_pms_house_keeping_view_form"
action="action_pms_house_keeping_view_form"
sequence="30"
parent="pms_housekeeping.menu_action_pms_house_keeping"
/>
<data>
<record model="ir.actions.act_window" id="action_pms_housekeeping_task_type">
<field name="name">Housekeeping Task Type</field>
<field name="res_model">pms.housekeeping.task.type</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
name="Housekeeping"
id="menu_action_pms_housekeeping"
sequence="17"
parent="pms.pms_management_menu"
/>
<menuitem
name="Task Type"
id="menu_action_pms_housekeeping_view_task_type"
action="pms_housekeeping.action_pms_housekeeping_task_type"
sequence="10"
parent="pms_housekeeping.menu_action_pms_housekeeping"
/>
</data>
</odoo>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="inheit_pms_reservation_view_form" model="ir.ui.view">
<field name="name">view.model.form</field>
<field name="model">pms.reservation</field>
<field name="inherit_id" ref="pms.pms_reservation_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='departure_hour']" position="after">
<field name="dont_disturb" />
</xpath>
</field>
</record>
</odoo>

View File

@@ -1,212 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="inherit_pms_room_view_form" model="ir.ui.view">
<field name="name">view.model.form</field>
<field name="model">pms.room</field>
<field name="inherit_id" ref="pms.pms_room_view_form" />
<field name="arch" type="xml">
<xpath expr="//page[@name='information_pms_room']" position="inside">
<group colspan="4" col="4">
<field name="clean_status" string="Clean Status" />
<!-- <field name="clean_type" string="Clean Type" attrs="{'readonly': True}" /> -->
</group>
</xpath>
</field>
</record>
<record id="view_pms_room_rack_form" model="ir.ui.view">
<field name="name">Room rack form view</field>
<field name="model">pms.room</field>
<field name="type">form</field>
<field name="priority" eval="40" />
<field name="active" eval="True" />
<field name="arch" type="xml">
<form string="Property Room">
<group col="4" colspan="4" name="header">
<field
name="name"
readonly="1"
nolabel="1"
style="font-size: 2em;"
/>
<group col="1">
<field name="clean_employee_id" />
</group>
<group col="1">
<field
name="employee_picture"
widget="image"
class="oe_left oe_avatar"
nolabel="1"
readonly="1"
/>
</group>
</group>
<group col="4" colspan="4" name="status" string="Clean type and status">
<field
name="clean_status"
readonly="1"
nolabel="1"
style="font-size: 2em;"
/>
<!-- <group col="1">
<field name="clean_status" />
</group> -->
</group>
<separator string="Task Lines" colspan="4" />
<field
name="housekeeping_ids"
readonly="0"
context="{'default_state': 'to_do',
'default_employee_id': clean_employee_id,
'tree_view_ref':'view_pms_room_rack_tree',
'form_view_ref':'view_pms_room_rack_form',
'default_room_id': id}"
/>
</form>
</field>
</record>
<record id="view_pms_room_rack_tree" model="ir.ui.view">
<field name="name">Room rack tree view</field>
<field name="model">pms.room</field>
<field name="type">tree</field>
<field name="priority" eval="20" />
<field name="active" eval="True" />
<field name="arch" type="xml">
<tree name="Property Room">
<field name="sequence" widget="handle" />
<field name="name" />
<field name="capacity" />
<field name="clean_status" />
<field name="clean_employee_id" />
</tree>
</field>
</record>
<record id="view_filter_room_rack" model="ir.ui.view">
<field name="model">pms.room</field>
<field name="arch" type="xml">
<search string="Housekeeping filters">
<field name="clean_employee_id" />
<field name="ubication_id" />
<field name="room_type_id" />
<!-- <filter name="filter_occupied" string="Occupied" domain="[('clean_status','=','occupied')]"/> -->
<searchpanel>
<field
name="room_type_id"
string="Room type"
enable_counters="1"
select="multi"
icon="fa-bed"
/>
<field
name="clean_employee_id"
string="Employee"
enable_counters="1"
select="multi"
icon="fa-user"
/>
<field
name="ubication_id"
string="Ubication"
enable_counters="1"
select="multi"
icon="fa-hospital-o"
/>
<!-- <field name="clean_status" string="Clean Type" enable_counters="1" select="multi"/> -->
</searchpanel>
</search>
</field>
</record>
<record id="view_pms_room_rack_kanban" model="ir.ui.view">
<field name="name">Room rack kanban view</field>
<field name="model">pms.room</field>
<field name="type">kanban</field>
<field name="mode">primary</field>
<field name="priority" eval="16" />
<field name="active" eval="True" />
<field name="arch" type="xml">
<kanban
default_group_by="ubication_id"
default_order="ubication_id"
class="o_res_partner_kanban"
sample="1"
group_create="false"
create="false"
>
<field name="name" />
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click_edit">
<div class="o_dropdown_kanban dropdown">
<!-- Top-right drop down menu here... -->
</div>
<div class="oe_kanban_body">
<!-- Content elements and fields go here... -->
<div style="font-size: 1.5em;">
<field name="name" />
<!-- class="oe_stat_button" -->
</div><div style="font-size: 1.1em;">
<field name="clean_status" />
</div>
</div>
<div class="oe_kanban_footer">
<div class="oe_kanban_footer_left">
<!-- Left hand footer... -->
<field
name="housekeeping_ids"
widget="many2many_tags"
domain="[('state', '=', 'draft')]"
/>
Default: <field name="clean_employee_id" />
<div>
<!-- <field name="clean_type" /> -->
</div>
</div>
<div class="oe_kanban_footer_right">
<!-- Right hand footer... -->
<a
type="object"
name="add_today_tasks"
help="Add the housekeeping tasks"
>
<span
class="fa fa-plus-square"
title="Add all today tasks"
/>
</a>
</div>
</div>
<div class="oe_clear" />
<div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record model="ir.actions.act_window" id="action_pms_room_rack_kanban">
<field name="name">Housekeeping</field>
<field name="res_model">pms.room</field>
<field name="view_mode">kanban,tree,form</field>
<field
name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('view_pms_room_rack_kanban')}),
(0, 0, {'view_mode': 'tree', 'view_id': ref('view_pms_room_rack_tree')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('view_pms_room_rack_form')})]"
/>
</record>
</odoo>