[FIX] resource: move "Switch to 1 or 2 weeks calendar" buttons

The "Switch to 1 or 2 weeks calendar" are breaking the layout by
being placed just before attendances_ids on the Working Hours sheet.

With this commit, the buttons are moved in the header of the form.

task-2996235

closes odoo/odoo#102711

X-original-commit: e81e03e6511c4d975bd7da4748f11747faf38251
Related: odoo/enterprise#32539
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
This commit is contained in:
Philippe Wauthy
2022-10-10 10:53:54 +02:00
parent 81f9416596
commit 4bb09505b0
+6 -7
View File
@@ -262,6 +262,11 @@
<field name="model">resource.calendar</field>
<field name="arch" type="xml">
<form string="Working Time">
<field name="two_weeks_calendar" invisible="1"/>
<header>
<button name="switch_calendar_type" attrs="{'invisible':[('two_weeks_calendar', '=', True)]}" string="Switch to 2 weeks calendar" type="object" confirm="Are you sure you want to switch this calendar to 2 weeks calendar ? All entries will be lost"/>
<button name="switch_calendar_type" attrs="{'invisible':[('two_weeks_calendar', '=', False)]}" string="Switch to 1 week calendar" type="object" confirm="Are you sure you want to switch this calendar to 1 week calendar ? All entries will be lost"/>
</header>
<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">
@@ -288,13 +293,7 @@
</group>
<notebook>
<page string="Working Hours" name="working_hours">
<button name="switch_calendar_type" attrs="{'invisible':[('two_weeks_calendar', '=', True)]}" string="Switch to 2 weeks calendar" type="object" confirm="Are you sure you want to switch this calendar to 2 weeks calendar ? All entries will be lost"/>
<button name="switch_calendar_type" attrs="{'invisible':[('two_weeks_calendar', '=', False)]}" string="Switch to 1 week calendar" type="object" confirm="Are you sure you want to switch this calendar to 1 week calendar ? All entries will be lost"/>
<field name="two_weeks_calendar" invisible="1"/>
<group attrs="{'invisible':[('two_weeks_calendar', '=', False)]}">
<field name="two_weeks_explanation" nolabel="1"/>
</group>
<field name="two_weeks_explanation" attrs="{'invisible':[('two_weeks_calendar', '=', False)]}"/>
<field name="attendance_ids" widget="section_one2many"/>
</page>
</notebook>