-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP]14.0-pms_new_housekeeping: working in housekeeping tasks
- Loading branch information
Showing
8 changed files
with
139 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
from . import hr_employee | ||
from . import pms_housekeeping_task_type | ||
from . import pms_housekeeping_task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class PmsHouseKeepingTask(models.Model): | ||
_name = "pms.housekeeping.task" | ||
|
||
name = fields.Char(string="Name", required=True) | ||
room_id = fields.Many2one( | ||
comodel_name="pms.room", | ||
string="Room", | ||
required=True, | ||
ondelete="restrict", | ||
) | ||
task_type_id = fields.Many2one( | ||
comodel_name="pms.housekeeping.task.type", | ||
string="Task Type", | ||
required=True, | ||
ondelete="restrict", | ||
) | ||
task_datetime = fields.Datetime(string="Date") | ||
state = fields.Selection( | ||
selection=[ | ||
("holding", "On Holding"), | ||
("to_do", "To Do"), | ||
("in_progress", "In Progress"), | ||
("done", "Done"), | ||
("cancel", "Cancel"), | ||
], | ||
string="State", | ||
required=True, | ||
default="to_do", | ||
) | ||
priority = fields.Integer(string="Priority", default=0) | ||
cleaning_comments = fields.Text(string="Cleaning Comments") | ||
employee_ids = fields.Many2many( | ||
comodel_name="hr.employee", | ||
relation="pms_housekeeping_task_hr_employee_rel", | ||
column1="task_id", | ||
column2="employee_id", | ||
string="Employees", | ||
domain="[('job_id.name', '=', 'Housekeeper')]", | ||
) | ||
parent_id = fields.Many2one( | ||
string="Parent Task", | ||
help="Indicates that this task is a child of another task", | ||
comodel_name="pms.housekeeping.task", | ||
ondelete="restrict", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
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 | ||
user_access_pms_housekeeping_task,user_access_pms_housekeeping_task_,model_pms_housekeeping_task,pms.group_pms_user,1,1,1,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<data> | ||
<record id="view_pms_housekeeping_task_tree" model="ir.ui.view"> | ||
<field name="name">pms.housekeeping.task.tree</field> | ||
<field name="model">pms.housekeeping.task</field> | ||
<field name="arch" type="xml"> | ||
<tree string="Housekeeping Task"> | ||
<field name="name" /> | ||
<field name="room_id" /> | ||
<field name="task_type_id" /> | ||
<field name="state"/> | ||
<field name="priority" /> | ||
<field name="cleaning_comments" /> | ||
<field name="employee_ids" /> | ||
<field name="parent_id" /> | ||
</tree> | ||
</field> | ||
</record> | ||
<record id="view_pms_housekeeping_task_form" model="ir.ui.view"> | ||
<field name="name">pms.housekeeping.task.form</field> | ||
<field name="model">pms.housekeeping.task</field> | ||
<field name="type">form</field> | ||
<field name="arch" type="xml"> | ||
<form string="Housekeeping Task"> | ||
<header> | ||
<field name="state" widget="statusbar" /> | ||
</header> | ||
<group class="col-6"> | ||
<field name="name" /> | ||
<field name="room_id" /> | ||
<field name="task_type_id" /> | ||
</group> | ||
<group class="col-6"> | ||
<field name="task_datetime" /> | ||
<field name="priority" /> | ||
<field name="employee_ids" widget="many2many_tags"/> | ||
</group> | ||
<group class="col-12"> | ||
<field name="parent_id" widget="many2many_tags"/> | ||
<field name="cleaning_comments" /> | ||
</group> | ||
</form> | ||
</field> | ||
</record> | ||
</data> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters