[IMP] resource: add possibility to archive resource calendar

Before this commit, It was not possible to Hide Working Time or Deleting Working Time if Resource is linked to it.

Now we add, Active field to Hide Working timw without removing it.

closes odoo/odoo#50963

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Swapnesh Shah
2020-05-09 05:24:38 +00:00
parent ce08c58f31
commit 2eecd98679
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -177,6 +177,8 @@ class ResourceCalendar(models.Model):
return res
name = fields.Char(required=True)
active = fields.Boolean("Active", default=True,
help="If the active field is set to false, it will allow you to hide the Working Time without removing it.")
company_id = fields.Many2one(
'res.company', 'Company',
default=lambda self: self.env.company)
+4
View File
@@ -240,6 +240,8 @@
<search string="Search Working Time">
<field name="name" string="Working Time"/>
<field name="company_id" groups="base.group_multi_company"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
@@ -250,6 +252,7 @@
<field name="arch" type="xml">
<form string="Working Time">
<sheet string="Working Time">
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_button_box" name="button_box">
<button name="%(resource_calendar_leaves_action_from_calendar)d" type="action"
string="Time Off" icon="fa-plane"
@@ -265,6 +268,7 @@
</h1>
<group name="resource_details">
<group>
<field name="active" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="hours_per_day" widget="float_time"/>
<field name="tz"/>