odoo18/addons_extensions/weekly_timesheets/views/weekly_period_timesheets.xml

124 lines
5.4 KiB
XML

<odoo>
<record id="view_weekly_period_timesheets_form" model="ir.ui.view">
<field name="name">weekly.periodtimesheets.form</field>
<field name="model">weekly.periodtimesheets</field>
<field name="arch" type="xml">
<form string="Weekly Period Timesheets">
<header>
<button name="action_submit"
string="Submit"
type="object"
class="btn-primary"
invisible="state != 'draft'"/>
<button name="action_approve"
string="Approve"
type="object"
class="btn-primary"
invisible="state != 'submitted' or not all_pm_approved"/>
<button name="action_reset_to_draft"
string="Reset to Draft"
type="object"
class="btn-primary"
invisible="state == 'draft'"/>
<button name="action_refresh_timesheets"
string="Refresh"
type="object"
class="btn-secondary"
invisible="state in ('submitted','approved')"/>
<field name="state"
widget="statusbar"/>
</header>
<sheet>
<group>
<field name="employee_id"
readonly="state in ('submitted','approved')"/>
<field name="year_id"
readonly="state in ('submitted','approved')"/>
<field name="week_line_id"
readonly="state in ('submitted','approved')"/>
<field name="total_hours"
readonly="1"/>
</group>
<notebook>
<page string="Weekly Timesheets Summary">
<field name="timesheet_line_ids"
readonly="state in ('submitted','approved')">
<list create="0"
edit="0"
delete="0">
<field name="date"/>
<field name="day_name"/>
<field name="hours"/>
</list>
</field>
</page>
<page string="Daily Timesheets">
<field name="analytic_line_ids"
readonly="1">
<list create="0"
edit="0"
delete="0">
<field name="date"/>
<field name="employee_id"/>
<field name="name"/>
<field name="project_id"/>
<field name="task_id"/>
<field name="unit_amount" string="Time Spent"/>
<button name="action_pm_approve"
string="Approve"
type="object"
class="btn-success"
invisible="approval_state == 'approved' or not project_id or not weekly_submitted"/>
<button name="action_pm_reject"
string="Reject"
type="object"
class="btn-danger"
invisible="approval_state == 'rejected' or not project_id or not weekly_submitted"/>
</list>
</field>
</page>
</notebook>
<group class="oe_subtotal_footer oe_right">
<field name="total_hours" readonly="1"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_weekly_period_timesheets_list" model="ir.ui.view">
<field name="name">weekly.periodtimesheets.list</field>
<field name="model">weekly.periodtimesheets</field>
<field name="arch" type="xml">
<list string="Weekly Period Timesheets">
<field name="employee_id"/>
<field name="year_id"/>
<field name="week_line_id"/>
</list>
</field>
</record>
<record id="action_weekly_period_timesheets" model="ir.actions.act_window">
<field name="res_model">weekly.periodtimesheets</field>
<field name="view_mode">list,form</field>
<field name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'list', 'view_id': ref('view_weekly_period_timesheets_list')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('view_weekly_period_timesheets_form')})]"/>
</record>
</odoo>