[FIX] project_issue_sheet: hide timesheets tab on issues w/o project

Since it is not possible to create a timesheet entry on a issue without a
project_id, the timesheets page in the form view should be hidden if no
project is set.

This prevents the user from trying to create a timesheet entry on the
issue and receive a not so transparent message like:
mandatory field is not set: [object with reference: account_id - account.id]
This commit is contained in:
Damien Bouvy
2016-08-17 16:37:44 +02:00
parent cda132bba5
commit 037a152db6
@@ -14,7 +14,7 @@
<attribute name="on_change">on_change_project(project_id)</attribute>
</field>
<xpath expr="//notebook/page[@name='extra_info']" position="before">
<page string="Timesheets">
<page string="Timesheets" attrs="{'invisible': [('project_id', '=', False)]}">
<field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : uid, 'default_project_id': project_id}"
groups="base.group_user">
<tree editable="top" string="Timesheet Activities">