[FIX] Make hr_timesheet updatable, remove command 0 in one2many that will violate the unique key constraint and replace them by the creation of ir.actions.act_window.view

This commit is contained in:
Thibault Francois
2016-07-04 14:17:07 +02:00
parent d4d09df143
commit 2b775b0136
2 changed files with 34 additions and 9 deletions
+13 -4
View File
@@ -66,10 +66,6 @@
<record id="act_hr_timesheet_line" model="ir.actions.act_window">
<field name="name">Activities</field>
<field name="res_model">account.analytic.line</field>
<field name="view_ids" eval="[
(0, False, {'view_mode': 'tree', 'view_id': ref('hr_timesheet.hr_timesheet_line_tree')}),
(0, False, {'view_mode': 'form', 'view_id': ref('hr_timesheet.hr_timesheet_line_form')})
]"/>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="context">{"search_default_today":1}</field>
<field name="search_view_id" ref="hr_timesheet_line_search"/>
@@ -83,6 +79,19 @@
</p>
</field>
</record>
<record model="ir.actions.act_window.view" id="act_hr_timesheet_line_view_tree">
<field name="view_mode">tree</field>
<field name="view_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="act_window_id" ref="act_hr_timesheet_line"/>
</record>
<record model="ir.actions.act_window.view" id="act_hr_timesheet_line_view_form">
<field name="view_mode">form</field>
<field name="view_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="act_window_id" ref="act_hr_timesheet_line"/>
</record>
<menuitem id="menu_hr_working_hours" parent="menu_hr_time_tracking" action="act_hr_timesheet_line"
name="Detailed Activities"/>
@@ -4,11 +4,6 @@
<record id="act_hr_timesheet_report" model="ir.actions.act_window">
<field name="name">Activities</field>
<field name="res_model">account.analytic.line</field>
<field name="view_ids" eval="[
(0, False, {'view_mode': 'pivot', 'view_id': ref('hr_timesheet.view_hr_timesheet_line_pivot') }),
(0, False, {'view_mode': 'tree', 'view_id': ref('hr_timesheet.hr_timesheet_line_tree')}),
(0, False, {'view_mode': 'form'})
]"/>
<field name="domain">[('project_id', '!=', False)]</field>
<field name="context">{"search_default_today":1}</field>
<field name="search_view_id" ref="hr_timesheet_line_search"/>
@@ -23,6 +18,27 @@
</field>
</record>
<record model="ir.actions.act_window.view" id="act_hr_timesheet_report_pivot">
<field name="sequence" eval="1" />
<field name="view_mode">pivot</field>
<field name="view_id" ref="hr_timesheet.view_hr_timesheet_line_pivot"/>
<field name="act_window_id" ref="act_hr_timesheet_report"/>
</record>
<record model="ir.actions.act_window.view" id="act_hr_timesheet_report_tree">
<field name="sequence" eval="2" />
<field name="view_mode">tree</field>
<field name="view_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="act_window_id" ref="act_hr_timesheet_report"/>
</record>
<record model="ir.actions.act_window.view" id="act_hr_timesheet_report_form">
<field name="sequence" eval="3" />
<field name="view_mode">form</field>
<field name="act_window_id" ref="act_hr_timesheet_report"/>
</record>
<menuitem id="menu_timesheets_reports" name="Reports"
parent="timesheet_menu_root" sequence="99" groups="base.group_hr_manager"/>
<menuitem id="menu_hr_activity_analysis" parent="menu_timesheets_reports" action="act_hr_timesheet_report"