[IMP] project_timesheet_holidys: make timesheet page readonly for time off tasks

This commit make timesheet page of tasks related to time off types readonly
so user can not create,update or delete timesheets create by leaves

task-2888607

closes odoo/odoo#96359

Related: odoo/enterprise#29678
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit is contained in:
Kartik Chavda
2022-11-07 13:49:50 +01:00
parent 2b21daec04
commit 1f3a392ffa
2 changed files with 19 additions and 0 deletions
@@ -17,6 +17,7 @@ on leaves. Project and task can be configured company-wide.
'data': [
'views/res_config_settings_views.xml',
'views/hr_holidays_views.xml',
'views/project_task_views.xml',
'security/ir.model.access.csv',
],
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="leave_task_form_view">
<field name="name">project.task.leave.form.view</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited"/>
<field name="arch" type="xml">
<xpath expr="/form" position="inside">
<field name="is_timeoff_task" invisible="1"/>
</xpath>
<xpath expr="//field[@name='timesheet_ids']" position="attributes">
<attribute name="attrs">{'invisible': [('analytic_account_active', '=', False)], 'readonly': [('is_timeoff_task', '=', True)]}</attribute>
</xpath>
</field>
</record>
</odoo>