[FIX] hr_timesheet: Hide timesheets on tasks w/o project

Since it is not possible to create a timesheet entry on a task without a project_id,
the timesheets page on the task form view will be hidden on such tasks.
This prevents the user from trying to create a timesheet entry on such a task 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:
Tanguy Charlier
2016-08-10 14:53:40 +02:00
parent 369bcf610c
commit eef14dd5cb
@@ -75,7 +75,7 @@
<field name="subtask_project_id" invisible="1" />
</field>
<xpath expr="//notebook/page[@name='description_page']" position="after">
<page string="Timesheets">
<page string="Timesheets" attrs="{'invisible': [('project_id', '=', False)]}">
<field name="timesheet_ids" context="{'default_project_id': project_id}">
<tree editable="bottom" string="Timesheet Activities" default_order="date">
<field name="date"/>