summaryrefslogtreecommitdiff
path: root/addons/resource/data/resource_data.xml
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2016-11-07 12:04:00 +0100
committerThibault Delavallée <tde@odoo.com>2017-01-18 10:26:53 +0100
commit2b90398cb6f5986167ca9306dd327659960c78a6 (patch)
tree6830667792200553967255403dbb6ef17a17f624 /addons/resource/data/resource_data.xml
parent2015cfd175865634caea5f3e7d1c55f224631baf (diff)
[REF] resource: strengthen link between companies and calendars
Purpose of this commit is to always have a default calendar for each company and ensure it is correctly set on resources. Some cleaning is also performed in resource models to remove unused fields, improve labels and make views a bit more odoo-ish. * [REF] res_company: add a m2o to the default calendar to use in the company as well as a o2m linking all resource calendars used in the company. Some code has been added to correctly update existing companies when installing the module; * [REF] resource_calendar * [REM] manager field on resource.calendar: this field is never used and is not necessary anyway * [ADD] global_leave_ids: filter leaves on a calendar to see global company leaves * [IMP] better default company / calendar computation to ensure there is always a calendar attached to a resource * [IMP] improve resource and calendar views in order to look more like other odoo views
Diffstat (limited to 'addons/resource/data/resource_data.xml')
-rw-r--r--addons/resource/data/resource_data.xml22
1 files changed, 9 insertions, 13 deletions
diff --git a/addons/resource/data/resource_data.xml b/addons/resource/data/resource_data.xml
index f6721316fb1..08281205c56 100644
--- a/addons/resource/data/resource_data.xml
+++ b/addons/resource/data/resource_data.xml
@@ -2,19 +2,15 @@
<odoo>
<record id="resource_calendar_std" model="resource.calendar">
<field name="name">Standard 40 Hours/Week</field>
- <field name="attendance_ids" eval="[
-(5, 0),
-(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': 17}),
-(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': 17}),
-(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': 17}),
-(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': 17}),
-(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': 17}),
-]"/>
<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="[]"/>
</odoo>