Using a working calendar, you might want to know how much hour correspond a work day. This depends of you working calendar. This might be usefull to compute leave duration (half a day is not 8 hours, but 4). The hours_per_day field is not computed as the average of working hour of all work day of calendar to allow customization. By default, it is 8, as the default attendances are the one from the 40h/week calendar. A constant is also available to handle case where resource calendar is not available.
67 lines
3.2 KiB
XML
67 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<data>
|
|
|
|
<record id="resource_calendar_std" model="resource.calendar">
|
|
<field name="name">Standard 40 Hours/Week</field>
|
|
<field name="company_id" ref="base.main_company"/>
|
|
</record>
|
|
|
|
<record id="base.main_company" model="res.company">
|
|
<field name="resource_calendar_id" ref="resource_calendar_std"/>
|
|
</record>
|
|
|
|
<function id="_init_data_resource_calendar"
|
|
model="res.company"
|
|
name="_init_data_resource_calendar"
|
|
eval="[]"/>
|
|
|
|
</data>
|
|
|
|
<data noupdate="1">
|
|
|
|
<record id="resource_calendar_std_35h" model="resource.calendar">
|
|
<field name="name">Standard 35 Hours/Week</field>
|
|
<field name="company_id" ref="base.main_company"/>
|
|
<field name="hours_per_day">7.0</field>
|
|
<field name="attendance_ids"
|
|
eval="[
|
|
(0, 0, {'name': 'Monday Morning', 'dayofweek': '0', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Monday Evening', 'dayofweek': '0', 'hour_from': 13, 'hour_to': 16}),
|
|
(0, 0, {'name': 'Tuesday Morning', 'dayofweek': '1', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Tuesday Evening', 'dayofweek': '1', 'hour_from': 13, 'hour_to': 16}),
|
|
(0, 0, {'name': 'Wednesday Morning', 'dayofweek': '2', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Wednesday Evening', 'dayofweek': '2', 'hour_from': 13, 'hour_to': 16}),
|
|
(0, 0, {'name': 'Thursday Morning', 'dayofweek': '3', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Thursday Evening', 'dayofweek': '3', 'hour_from': 13, 'hour_to': 16}),
|
|
(0, 0, {'name': 'Friday Morning', 'dayofweek': '4', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Friday Evening', 'dayofweek': '4', 'hour_from': 13, 'hour_to': 16})
|
|
]"
|
|
/>
|
|
</record>
|
|
|
|
<record id="resource_calendar_std_38h" model="resource.calendar">
|
|
<field name="name">Standard 38 Hours/Week</field>
|
|
<field name="company_id" ref="base.main_company"/>
|
|
<field name="hours_per_day">7.6</field>
|
|
<field name="attendance_ids"
|
|
eval="[
|
|
(0, 0, {'name': 'Monday Morning', 'dayofweek': '0', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Monday Evening', 'dayofweek': '0', 'hour_from': 13, 'hour_to': 16.6}),
|
|
(0, 0, {'name': 'Tuesday Morning', 'dayofweek': '1', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Tuesday Evening', 'dayofweek': '1', 'hour_from': 13, 'hour_to': 16.6}),
|
|
(0, 0, {'name': 'Wednesday Morning', 'dayofweek': '2', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Wednesday Evening', 'dayofweek': '2', 'hour_from': 13, 'hour_to': 16.6}),
|
|
(0, 0, {'name': 'Thursday Morning', 'dayofweek': '3', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Thursday Evening', 'dayofweek': '3', 'hour_from': 13, 'hour_to': 16.6}),
|
|
(0, 0, {'name': 'Friday Morning', 'dayofweek': '4', 'hour_from': 8, 'hour_to': 12}),
|
|
(0, 0, {'name': 'Friday Evening', 'dayofweek': '4', 'hour_from': 13, 'hour_to': 16.6})
|
|
]"
|
|
/>
|
|
</record>
|
|
|
|
</data>
|
|
|
|
</odoo>
|