| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
<data> |
| 4 |
<record model="ir.ui.view" id="view_task_form2_inherited"> |
| 5 |
<field name="name">project.task.form.inherited</field> |
| 6 |
<field name="model">project.task</field> |
| 7 |
<field name="inherit_id" ref="project.view_task_form2" /> |
| 8 |
<field name="arch" type="xml"> |
| 9 |
<xpath expr="//field[@name='child_ids']/list/field[@name='company_id']" position="after"> |
| 10 |
<field name="allocated_hours" widget="timesheet_uom_no_toggle" sum="Total Allocated Time" optional="hide" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 11 |
<field name="effective_hours" widget="timesheet_uom" sum="Time Spent" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 12 |
<field name="subtask_effective_hours" widget="timesheet_uom" sum="Sub-tasks Time Spent" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 13 |
<field name="total_hours_spent" widget="timesheet_uom" sum="Total Time Spent" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 14 |
<field name="remaining_hours" widget="timesheet_uom" sum="Time Remaining" optional="hide" decoration-danger="progress >= 1" decoration-warning="progress >= 0.8 and progress < 1" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 15 |
<field name="progress" widget="project_task_progressbar" optional="hide" options="{'overflow_class': 'bg-danger'}" groups="hr_timesheet.group_hr_timesheet_user" |
| 16 |
column_invisible="context.get('template_project')"/> |
| 17 |
</xpath> |
| 18 |
<xpath expr="//group/field[@name='allocated_hours']" position="replace"> |
| 19 |
<field name="encode_uom_in_days" invisible="1"/> |
| 20 |
<field name="subtask_count" invisible="1"/> |
| 21 |
<label for="allocated_hours" invisible="not allow_timesheets" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 22 |
<div id="allocated_hours_container" class="text-nowrap" invisible="not allow_timesheets" groups="hr_timesheet.group_hr_timesheet_user"> |
| 23 |
<field name="allocated_hours" class="oe_inline o_field_float_time o_task_planned_hours" widget="timesheet_uom_no_toggle"/> |
| 24 |
<span invisible="subtask_count == 0"> |
| 25 |
(incl. <field name="subtask_allocated_hours" nolabel="1" widget="timesheet_uom_no_toggle" class="oe_inline"/> on |
| 26 |
<span class="fw-bold text-dark"> Sub-tasks</span>) |
| 27 |
</span> |
| 28 |
<span invisible="is_template or has_project_template"> |
| 29 |
(<field name="progress" invisible="not project_id" class="oe_inline" nolabel="1" decoration-danger="progress > 1.005" digits="[1, 0]" widget="percentage"/>) |
| 30 |
</span> |
| 31 |
</div> |
| 32 |
</xpath> |
| 33 |
<xpath expr="//t[@name='warning_section']" position="inside"> |
| 34 |
<div class="alert alert-warning text-center mb-2" role="alert" invisible="analytic_account_active or not allow_timesheets or is_template or has_project_template" groups="hr_timesheet.group_hr_timesheet_user"> |
| 35 |
You cannot log timesheets on this project since it is linked to an inactive analytic account.<br/> Please change this account, or reactivate the current one to timesheet on the project. |
| 36 |
</div> |
| 37 |
</xpath> |
| 38 |
<xpath expr="//notebook/page[@name='description_page']" position="after"> |
| 39 |
<field name="allow_timesheets" invisible="1"/> |
| 40 |
<t groups="hr_timesheet.group_hr_timesheet_user"> |
| 41 |
<field name="analytic_account_active" invisible="1"/> |
| 42 |
</t> |
| 43 |
<page string="Timesheets" name="page_timesheets" id="timesheets_tab" invisible="not allow_timesheets or has_template_ancestor or has_project_template or (not id and context.get('hide_timesheet_ids'))" groups="hr_timesheet.group_hr_timesheet_user"> |
| 44 |
<field name="timesheet_ids" mode="list,kanban" readonly="not analytic_account_active" context="{'default_project_id': project_id, 'default_name': '', 'form_view_ref': 'hr_timesheet.timesheet_view_form_user'}"> |
| 45 |
<list editable="top" string="Timesheet Activities" decoration-muted="readonly_timesheet == True"> |
| 46 |
<field name="readonly_timesheet" column_invisible="True"/> |
| 47 |
<field name="date" readonly="readonly_timesheet"/> |
| 48 |
<field name="user_id" column_invisible="True"/> |
| 49 |
<field name="employee_id" widget="many2one_avatar_employee" context="{'active_test': True}" |
| 50 |
required="1" |
| 51 |
readonly="readonly_timesheet"/> |
| 52 |
<field name="name" required="0" readonly="readonly_timesheet"/> |
| 53 |
<field name="unit_amount" string="Time Spent" widget="timesheet_uom" decoration-danger="unit_amount > 24 or unit_amount < 0" |
| 54 |
readonly="readonly_timesheet"/> |
| 55 |
<field name="project_id" column_invisible="True"/> |
| 56 |
<field name="task_id" column_invisible="True"/> |
| 57 |
<field name="company_id" column_invisible="True"/> |
| 58 |
</list> |
| 59 |
<kanban class="o_kanban_mobile"> |
| 60 |
<templates> |
| 61 |
<t t-name="card"> |
| 62 |
<div class="row"> |
| 63 |
<div class="col-6 d-flex"> |
| 64 |
<field name="employee_id" class="me-1" widget="many2one_avatar_employee" context="{'active_test': True}" readonly="readonly_timesheet"/> |
| 65 |
<field name="employee_id" class="ps-1 fw-bold"/> |
| 66 |
</div> |
| 67 |
<field name="date" class="col-6 text-end fw-bold"/> |
| 68 |
</div> |
| 69 |
<div class="row"> |
| 70 |
<field name="name" class="col-6 text-muted" required="0" readonly="readonly_timesheet"/> |
| 71 |
<field name="unit_amount" widget="float_time" class="col-6 text-end"/> |
| 72 |
</div> |
| 73 |
</t> |
| 74 |
</templates> |
| 75 |
</kanban> |
| 76 |
<form string="Timesheet Activities"> |
| 77 |
<sheet> |
| 78 |
<group> |
| 79 |
<field name="readonly_timesheet" invisible="1"/> |
| 80 |
<field name="date" readonly="readonly_timesheet"/> |
| 81 |
<field name="user_id" invisible="1" readonly="readonly_timesheet"/> |
| 82 |
<field name="employee_id" widget="many2one_avatar_employee" context="{'active_test': True}" required="1" readonly="readonly_timesheet"/> |
| 83 |
<field name="name" required="0" readonly="readonly_timesheet"/> |
| 84 |
<field name="unit_amount" string="Time Spent" widget="float_time" decoration-danger="unit_amount > 24" |
| 85 |
readonly="readonly_timesheet"/> |
| 86 |
<field name="project_id" invisible="1"/> |
| 87 |
<field name="task_id" invisible="1"/> |
| 88 |
<field name="company_id" invisible="1"/> |
| 89 |
</group> |
| 90 |
</sheet> |
| 91 |
</form> |
| 92 |
</field> |
| 93 |
<group invisible="not analytic_account_active"> |
| 94 |
<group class="oe_subtotal_footer" name="project_hours"> |
| 95 |
<span class="o_td_label float-start"> |
| 96 |
<label class="fw-bold" for="effective_hours" string="Time Spent"/> |
| 97 |
</span> |
| 98 |
<field name="effective_hours" widget="timesheet_uom" nolabel="1"/> |
| 99 |
<button name="action_view_subtask_timesheet" type="object" class="ps-0 border-0 oe_inline oe_link mb-2 o_td_label float-start" invisible="subtask_effective_hours == 0.0"> |
| 100 |
<span class="text-nowrap">Time Spent on Sub-tasks:</span> |
| 101 |
</button> |
| 102 |
<field name="subtask_effective_hours" class="mt-2" widget="timesheet_uom" |
| 103 |
invisible="subtask_effective_hours == 0.0" nolabel="1"/> |
| 104 |
<span invisible="subtask_effective_hours == 0.0" class="o_td_label float-start my-1"> |
| 105 |
<label class="fw-bold" for="total_hours_spent" |
| 106 |
invisible="subtask_effective_hours == 0.0 or encode_uom_in_days"/> |
| 107 |
<label class="fw-bold" for="total_hours_spent" |
| 108 |
invisible="subtask_effective_hours == 0.0 or not encode_uom_in_days"/> |
| 109 |
</span> |
| 110 |
<field name="total_hours_spent" widget="timesheet_uom" class="oe_subtotal_footer_separator" nolabel="1" |
| 111 |
invisible="subtask_effective_hours == 0.0" /> |
| 112 |
<span class="o_td_label float-start my-1" invisible="allocated_hours == 0.0"> |
| 113 |
<label class="fw-bold" for="remaining_hours" |
| 114 |
invisible="remaining_hours < 0"/> |
| 115 |
<label class="fw-bold text-danger" for="remaining_hours" |
| 116 |
invisible="remaining_hours >= 0"/> |
| 117 |
</span> |
| 118 |
<field name="remaining_hours" widget="timesheet_uom" class="oe_subtotal_footer_separator" |
| 119 |
invisible="allocated_hours == 0.0" nolabel="1" decoration-danger="remaining_hours < 0"/> |
| 120 |
</group> |
| 121 |
</group> |
| 122 |
</page> |
| 123 |
</xpath> |
| 124 |
<xpath expr="//field[@name='depend_on_ids']/list//field[@name='company_id']" position="after"> |
| 125 |
<field name="progress" column_invisible="True" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 126 |
<field name="allocated_hours" widget="timesheet_uom_no_toggle" sum="Total Allocated Time" optional="hide" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 127 |
<field name="effective_hours" widget="timesheet_uom" sum="Effective Hours" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 128 |
<field name="subtask_effective_hours" widget="timesheet_uom" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 129 |
<field name="total_hours_spent" widget="timesheet_uom" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 130 |
<field name="remaining_hours" widget="timesheet_uom" sum="Time Remaining" optional="hide" decoration-danger="progress >= 1" decoration-warning="progress >= 0.8 and progress < 1" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 131 |
<field name="progress" widget="project_task_progressbar" optional="hide" options="{'overflow_class': 'bg-danger'}" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="context.get('template_project')"/> |
| 132 |
</xpath> |
| 133 |
</field> |
| 134 |
</record> |
| 135 |
|
| 136 |
<record id="view_task_tree2_inherited" model="ir.ui.view"> |
| 137 |
<field name="name">project.task.list.inherited</field> |
| 138 |
<field name="model">project.task</field> |
| 139 |
<field name="inherit_id" ref="project.project_task_view_tree_main_base" /> |
| 140 |
<field name="arch" type="xml"> |
| 141 |
<field name="priority" position="before"> |
| 142 |
<field name="progress" column_invisible="True"/> |
| 143 |
<field name="effective_hours" column_invisible="True"/> |
| 144 |
<field name="allocated_hours" widget="timesheet_uom_no_toggle" sum="Total Allocated Time" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="not context.get('allow_timesheets', True)"/> |
| 145 |
<field name="effective_hours" widget="timesheet_uom" sum="Effective Hours" optional="show" invisible="effective_hours == 0" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="not context.get('allow_timesheets', True) or context.get('template_project')"/> |
| 146 |
<field name="subtask_effective_hours" widget="timesheet_uom" sum="Time Spent on Sub-Tasks" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="not context.get('allow_timesheets', True) or context.get('template_project')"/> |
| 147 |
<field name="total_hours_spent" widget="timesheet_uom" sum="Total Time Spent" optional="hide" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="not context.get('allow_timesheets', True) or context.get('template_project')"/> |
| 148 |
<field name="remaining_hours" widget="timesheet_uom" sum="Time Remaining on SO" optional="hide" decoration-danger="progress >= 1" decoration-warning="progress >= 0.8 and progress < 1" invisible="allocated_hours == 0" groups="hr_timesheet.group_hr_timesheet_user" column_invisible="not context.get('allow_timesheets', True) or context.get('template_project')"/> |
| 149 |
<field name="progress" widget="project_task_progressbar" avg="Average of Progress" optional="show" groups="hr_timesheet.group_hr_timesheet_user" invisible="allocated_hours == 0" options="{'overflow_class': 'bg-danger'}" column_invisible="not context.get('allow_timesheets', True) or context.get('template_project')"/> |
| 150 |
</field> |
| 151 |
</field> |
| 152 |
</record> |
| 153 |
|
| 154 |
<record id="view_task_kanban_inherited_progress" model="ir.ui.view"> |
| 155 |
<field name="name">project.task.timesheet.kanban.inherited.progress</field> |
| 156 |
<field name="model">project.task</field> |
| 157 |
<field name="inherit_id" ref="project.view_task_kanban"/> |
| 158 |
<field name="arch" type="xml"> |
| 159 |
<templates position="before"> |
| 160 |
<field name="progress" /> |
| 161 |
<field name="remaining_hours" /> |
| 162 |
<field name="allocated_hours" /> |
| 163 |
<field name="allow_timesheets"/> |
| 164 |
<field name="encode_uom_in_days" invisible="1"/> |
| 165 |
</templates> |
| 166 |
<xpath expr="//footer//field[@name='priority']" position="before"> |
| 167 |
<t name="allocated_hours" t-if="record.allocated_hours.raw_value > 0 and record.allow_timesheets.raw_value" groups="hr_timesheet.group_hr_timesheet_user"> |
| 168 |
<t t-set="badge" t-value="'border border-success'"/> |
| 169 |
<t t-set="badge" t-value="'border border-warning'" t-if="record.progress.raw_value >= 0.8 and record.progress.raw_value <= 1"/> |
| 170 |
<t t-set="badge" t-value="'border border-danger'" t-if="record.remaining_hours.raw_value < 0"/> |
| 171 |
<t t-set="title" t-if="record.encode_uom_in_days.raw_value">Remaining days</t> |
| 172 |
<t t-set="title" t-else="">Time Remaining</t> |
| 173 |
<div t-attf-class="bg-transparent badge {{ badge }} me-0" t-att-title="title"> |
| 174 |
<field name="remaining_hours" widget="timesheet_uom" /> |
| 175 |
</div> |
| 176 |
</t> |
| 177 |
</xpath> |
| 178 |
</field> |
| 179 |
</record> |
| 180 |
|
| 181 |
<record id="project_task_view_search" model="ir.ui.view"> |
| 182 |
<field name="name">project.task.view.search.inherit.sale.timesheet.enterprise</field> |
| 183 |
<field name="model">project.task</field> |
| 184 |
<field name="inherit_id" ref="project.view_task_search_form_project_fsm_base"/> |
| 185 |
<field name="priority">10</field> |
| 186 |
<field name="arch" type="xml"> |
| 187 |
<xpath expr="//filter[@name='blocking']/following-sibling::separator[1]" position="after"> |
| 188 |
<filter string="Timesheets 80%" name="timesheet_80" |
| 189 |
domain="[('remaining_hours_percentage', '>', 0.0), ('remaining_hours_percentage', '<=', 0.2)]" |
| 190 |
groups="hr_timesheet.group_hr_timesheet_user" |
| 191 |
invisible="not context.get('allow_timesheets') or context.get('template_project')"/> |
| 192 |
<filter string="Timesheets >100%" name="timesheet_exceeded" domain="[('overtime', '>', 0)]" |
| 193 |
groups="hr_timesheet.group_hr_timesheet_user" |
| 194 |
invisible="not context.get('allow_timesheets') or context.get('template_project')"/> |
| 195 |
<separator/> |
| 196 |
</xpath> |
| 197 |
</field> |
| 198 |
</record> |
| 199 |
|
| 200 |
<record id="project_task_view_graph" model="ir.ui.view"> |
| 201 |
<field name="name">project.task.view.graph.inherited</field> |
| 202 |
<field name="model">project.task</field> |
| 203 |
<field name="inherit_id" ref="project.view_project_task_graph"/> |
| 204 |
<field name="arch" type="xml"> |
| 205 |
<xpath expr="//field[@name='stage_id']" position='after'> |
| 206 |
<field name="allocated_hours" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 207 |
<field name="allocated_hours" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 208 |
<field name="remaining_hours" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 209 |
<field name="remaining_hours" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 210 |
<field name="effective_hours" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 211 |
<field name="effective_hours" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 212 |
<field name="total_hours_spent" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 213 |
<field name="total_hours_spent" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 214 |
<field name="overtime" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 215 |
<field name="overtime" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 216 |
<field name="subtask_effective_hours" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 217 |
<field name="subtask_effective_hours" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 218 |
<field name="progress" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 219 |
<field name="progress" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 220 |
</xpath> |
| 221 |
</field> |
| 222 |
</record> |
| 223 |
|
| 224 |
<record id="project_task_view_pivot" model="ir.ui.view"> |
| 225 |
<field name="name">project.task.view.pivot.inherited</field> |
| 226 |
<field name="model">project.task</field> |
| 227 |
<field name="inherit_id" ref="project.view_project_task_pivot"/> |
| 228 |
<field name="arch" type="xml"> |
| 229 |
<xpath expr="//field[@name='allocated_hours']" position='attributes'> |
| 230 |
<attribute name="widget">timesheet_uom</attribute> |
| 231 |
<attribute name="groups">hr_timesheet.group_hr_timesheet_user</attribute> |
| 232 |
</xpath> |
| 233 |
<xpath expr="//field[@name='allocated_hours']" position='after'> |
| 234 |
<field name="allocated_hours" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 235 |
<field name="remaining_hours" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 236 |
<field name="remaining_hours" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 237 |
<field name="effective_hours" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 238 |
<field name="effective_hours" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 239 |
<field name="total_hours_spent" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 240 |
<field name="total_hours_spent" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 241 |
<field name="overtime" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 242 |
<field name="overtime" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 243 |
<field name="subtask_effective_hours" widget="timesheet_uom" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 244 |
<field name="subtask_effective_hours" widget="timesheet_uom" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 245 |
<field name="progress" groups="hr_timesheet.group_hr_timesheet_user"/> |
| 246 |
<field name="progress" invisible="1" groups="!hr_timesheet.group_hr_timesheet_user"/> |
| 247 |
</xpath> |
| 248 |
</field> |
| 249 |
</record> |
| 250 |
</data> |
| 251 |
</odoo> |