Skip to content

Commit

Permalink
[IMP] hr_timesheet_begin_end: missing form fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Rogos committed May 22, 2023
1 parent 8b6beb2 commit 8e8268f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hr_timesheet_begin_end/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"category": "Human Resources",
"depends": ["hr_timesheet"],
"website": "https://github.com/OCA/timesheet",
"data": ["views/hr_analytic_timesheet.xml"],
"data": ["views/hr_analytic_timesheet.xml", "views/project_task.xml"],
"installable": True,
"auto_install": False,
}
13 changes: 13 additions & 0 deletions hr_timesheet_begin_end/views/hr_analytic_timesheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
<field name="name">hr.analytic.timesheet.tree</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" />
<field name="arch" type="xml">
<field name="unit_amount" position="before">
<field name="time_start" widget="float_time" optional="show" />
<field name="time_stop" widget="float_time" optional="show" />
</field>
</field>
</record>
<record id="hr_timesheet_line_form" model="ir.ui.view">
<field
name="name"
>account.analytic.line.form (in hr_timesheet_begin_end)</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form" />
<field name="arch" type="xml">
<field name="unit_amount" position="before">
<field name="time_start" widget="float_time" />
Expand Down
26 changes: 26 additions & 0 deletions hr_timesheet_begin_end/views/project_task.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_task_form2_inherited" model="ir.ui.view">
<field
name="name"
>project.task.form.inherited (in hr_timesheet_begin_end)</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="//field[@name='timesheet_ids']/tree/field[@name='unit_amount']"
position="before"
>
<field name="time_start" widget="float_time" />
<field name="time_stop" widget="float_time" />
</xpath>
<xpath
expr="//field[@name='timesheet_ids']/form/sheet/group/field[@name='unit_amount']"
position="before"
>
<field name="time_start" widget="float_time" />
<field name="time_stop" widget="float_time" />
</xpath>
</field>
</record>
</odoo>

0 comments on commit 8e8268f

Please sign in to comment.