File: resource_calendar_views.xml

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (106 lines) | stat: -rw-r--r-- 5,999 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_resource_calendar_search" model="ir.ui.view">
        <field name="name">resource.calendar.search</field>
        <field name="model">resource.calendar</field>
        <field name="arch" type="xml">
            <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>

    <record id="resource_calendar_form" model="ir.ui.view">
        <field name="name">resource.calendar.form</field>
        <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" invisible="two_weeks_calendar or flexible_hours" string="Switch to 2 weeks calendar" type="object"
                        confirm="Are you sure you want to switch to a 2-week calendar? All work entries will be lost."
                        confirm-label="Switch"/>
                    <button name="switch_calendar_type" invisible="not two_weeks_calendar" string="Switch to 1 week calendar" type="object"
                        confirm="Are you sure you want to switch to a 1-week calendar? All work entries will be lost."
                        confirm-label="Switch"/>
                </header>
                <sheet string="Working Time">
                    <widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
                    <div class="oe_button_box" name="button_box">
                        <button name="%(resource_calendar_leaves_action_from_calendar)d" type="action"
                                icon="fa-plane"
                                class="oe_stat_button"
                                groups="base.group_no_one">
                                <div class="o_field_widget o_stat_info">
                                    <span class="o_stat_text">Time Off</span>
                                </div>
                        </button>
                        <button name="%(resource_resource_action_from_calendar)d" type="action"
                                icon="fa-cogs"
                                class="oe_stat_button"
                                groups="base.group_user">
                                <div class="o_field_widget o_stat_info">
                                    <span class="o_stat_text">Work Resources</span>
                                </div>
                        </button>
                    </div>
                    <div class="oe_title">
                        <h1><field name="name"/></h1>
                    </div>
                    <group name="resource_details" col="2">
                        <group name="resource_working_hours">
                            <field name="flexible_hours"/>
                            <label for="full_time_required_hours" invisible="flexible_hours"/>
                            <label for="full_time_required_hours" string="Hours per Week" invisible="not flexible_hours"/>
                            <div>
                                <field name="full_time_required_hours" style="width: 10%" widget="float_time"/>
                                <span> hours/week</span>
                            </div>
                            <field name="hours_per_day" widget="float_time" readonly="not flexible_hours"/>
                        </group>
                        <group name="resource_company">
                            <field name="active" invisible="1"/>
                            <field name="company_id" groups="base.group_multi_company"/>
                            <field name="tz" widget="timezone_mismatch" options="{'tz_offset_field': 'tz_offset', 'mismatch_title': 'Timezone Mismatch : This timezone is different from that of your browser.\nPlease, be mindful of this when setting the working hours or the time off.'}" />
                            <field name="tz_offset" invisible="1"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Working Hours" name="working_hours" invisible="flexible_hours">
                            <field name="two_weeks_explanation" invisible="not two_weeks_calendar"/>
                            <field name="attendance_ids" widget="section_one2many"/>
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="view_resource_calendar_tree" model="ir.ui.view">
        <field name="name">resource.calendar.list</field>
        <field name="model">resource.calendar</field>
        <field name="arch" type="xml">
            <list string="Working Time">
                <field name="name" string="Working Time"/>
                <field name="company_id" groups="base.group_multi_company"/>
            </list>
        </field>
    </record>

    <record id="action_resource_calendar_form" model="ir.actions.act_window">
        <field name="name">Working Schedules</field>
        <field name="res_model">resource.calendar</field>
        <field name="view_mode">list,form</field>
        <field name="domain">['|', ('company_id', '=', False), ('company_id', 'in', allowed_company_ids)]</field>
        <field name="view_id" eval="False"/>
        <field name="search_view_id" ref="view_resource_calendar_search"/>
        <field name="help" type="html">
          <p class="o_view_nocontent_smiling_face">
            Define working hours and time table that could be scheduled to your project members
          </p>
        </field>
    </record>
</odoo>