From 8e5a0ac43cc38cd9e36b9c52523962b5e51dca95 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 5 Feb 2015 13:10:56 +0100 Subject: [PATCH] [FIX]hr_timesheet: prevent quick creation and record opening for account fields The quick creation and account record opening in the sheets are not useful. Besides, restricted users (simple employees) have no read access on account.account. opw:626989 --- .../analytic_user_function_view.xml | 16 ++++++++++------ addons/hr_timesheet/hr_timesheet_view.xml | 4 ++-- .../hr_timesheet_invoice_view.xml | 12 ++++++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/addons/analytic_user_function/analytic_user_function_view.xml b/addons/analytic_user_function/analytic_user_function_view.xml index 051f15fd7f3..42e8123c2bc 100644 --- a/addons/analytic_user_function/analytic_user_function_view.xml +++ b/addons/analytic_user_function/analytic_user_function_view.xml @@ -78,8 +78,10 @@ - - + + [('type','=','normal'),('state', '<>', 'close')] + on_change_account_id(account_id, user_id, unit_amount) + {'default_use_timesheets': 1} @@ -90,8 +92,9 @@ hr.analytic.timesheet - - + + [('type','=','normal'),('state', '<>', 'close')] + on_change_account_id(account_id, user_id, unit_amount) @@ -112,8 +115,9 @@ hr.analytic.timesheet - - + + [('type','=','normal'),('state', '<>', 'close')] + on_change_account_id(account_id, user_id, unit_amount) diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index fc0cd4ff7a1..4e19e1b689a 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -11,7 +11,7 @@ - + @@ -49,7 +49,7 @@ - + diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml index bc06ed16ee2..a2c53f01db0 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml @@ -48,8 +48,10 @@ hr.analytic.timesheet - - + + [('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)] + on_change_account_id(account_id, user_id) + {'default_use_timesheets': 1} @@ -70,8 +72,10 @@ hr.analytic.timesheet - - + + [('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)] + on_change_account_id(account_id, user_id) + {'default_use_timesheets': 1}