[FIX] project timesheet: Open task without timesheet rights

Before this commit:
If you have not at least the timesheet user right, you can't open
project task as a field in not present in the view.

After this commit:
You can open the task view

closes odoo/odoo#41229

Taskid: 2148606
Related: odoo/enterprise#6984
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
jbm-odoo
2019-12-03 09:21:27 +00:00
parent 13babd5c48
commit 9f7c8d305e
+13 -3
View File
@@ -59,15 +59,25 @@
</field>
</record>
<record model="ir.ui.view" id="view_task_form2_inherited">
<record model="ir.ui.view" id="view_task_form2_inherited_hr_timesheet">
<field name="name">project.task.form.inherited</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2" />
<field name="arch" type="xml">
<xpath expr="//field[@name='legend_done']" position="after">
<field name="analytic_account_active" invisible="1"/>
<field name="allow_timesheets" invisible="1"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_task_form2_inherited">
<field name="name">project.task.form.inherited</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited_hr_timesheet" />
<field name="groups_id" eval="[(6,0, (ref('hr_timesheet.group_hr_timesheet_user'),))]"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page[@name='description_page']" position="after">
<field name="analytic_account_active" invisible="1"/>
<field name="allow_timesheets" invisible="1"/>
<page string="Timesheets" id="timesheets_tab" attrs="{'invisible': [('allow_timesheets', '=', False)]}">
<group>
<group>