Sélectionner une révision Git
cgscop_timesheet_sheet.xml
-
Benjamin - Le Filament a rédigéBenjamin - Le Filament a rédigé
cgscop_timesheet_sheet.xml 8,72 Kio
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
Vues
-->
<!-- Tree view -->
<record id="view_cgscop_timesheet_sheet_tree" model="ir.ui.view">
<field name="name">cgscop.timesheet.sheet.tree</field>
<field name="model">cgscop.timesheet.sheet</field>
<field name="arch" type="xml">
<tree string="Timesheet Reports" decoration-warning="state=='draft'">
<field name="name" />
<field name="employee_id"/>
<field name="create_date"/>
<field name="validation_date" />
<field name="total_hour" sum="Total"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Form view -->
<record id="view_cgscop_timesheet_sheet_form" model="ir.ui.view">
<field name="name">cgscop.timesheet.sheet.form</field>
<field name="model">cgscop.timesheet.sheet</field>
<field eval="25" name="priority"/>
<field name="arch" type="xml">
<form>
<header>
<button name="action_submit_timesheet" states="draft" string="Soumettre" type="object" class="oe_highlight"/>
<button name="approve_timesheet_sheets" states="submit" string="Valider" type="object" groups="hr_timesheet.group_timesheet_manager" class="oe_highlight"/>
<button name="print_timesheet" string="Imprimer" type="object" />
<button name="reset_timesheet_sheets" string="Remettre en brouillon" type="object" attrs="{'invisible': [('state', '=', 'draft')]}" groups="hr_timesheet.group_timesheet_manager"/>
<field name="state" widget="statusbar" statusbar_visible="draft,submit,valid"/>
</header>
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" attrs="{'readonly': [('can_edit','=', False), ('state','!=', 'draft')]}"/>
</h1>
</div>
<group>
<group>
<field name="employee_id" groups="hr_timesheet.group_timesheet_manager" options="{'no_open': True, 'no_create': True}"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_open': True, 'no_create': True}"/>
</group>
<group>
<field name="create_date" readonly="1"/>
<field name="submit_date" readonly="1"/>
<field name="validation_date" readonly="1"/>
<field name="total_hour" widget="float_time"/>
</group>
</group>
<field name="can_edit" invisible="1"/>
<field name="timesheet_line_ids" widget="many2many" domain="[('sheet_id', '=', False), ('employee_id', '=', employee_id)]" options="{'reload_on_button': True}" attrs="{'readonly': [('can_edit','=', False), ('state','!=', 'draft')]}" context="{'form_view_ref' : 'hr_timesheet.timesheet_view_form_user'}">
<tree editable="top">
<field name="date"/>
<field name="employee_id" readonly="1"/>
<field name="state" invisible="1"/>
<field name="sheet_id" invisible="1"/>
<field name="project_id" options="{'no_open': True, 'no_create': True}" />
<field name="partner_id" options="{'no_open': True, 'no_create': True}" />
<field name="name"/>
<field name="unit_amount" widget="float_time" />
<field name="ur_financial_system_id" options="{'no_open': True, 'no_create': True}" />
</tree>
</field>
</sheet>