<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<object-views xmlns="http://axelor.com/xml/ns/object-views"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://axelor.com/xml/ns/object-views
  https://axelor.com/xml/ns/object-views/object-views_6.0.xsd">

  <grid name="absence-grid" title="Absence" model="com.axelor.apps.hr.db.Absence">
        <toolbar>
          <button name="chooseAbsenceType" title="Choisir Type d'absence" onClick="action-choose-absence-type-wizard" colSpan="12"/>
        </toolbar>
        <field name="employee" title="Employé"/>
        <field name="typeAbsence" title="Type Absence"/>
        <field name="absDate" readonly="true"/>
        <field name="absDateFin"/>
        <field name="heureAbsence" title="Heure Absence"/>
	</grid>

	<form name="absence-form" title="Form" model="com.axelor.apps.hr.db.Absence" onSave="save,action-method-absence-save,save">
      <panel name="absence" title="Absence Form">
        <field name="employee" title="Employé"/>
        <field name="typeAbsence" title="Type Absence"/>
        <field name="absDate"/>
        <field name="absDateFin"/>
        <field name="heureAbsence" title="Heure Absence"/>
      </panel>
      <panel name="commentaire" title="Commentaire">
        <field name="commentaire" showTitle="false" colSpan="12" widget="HTML"/>
    </panel>
 	</form>

  <action-view name="action-absence" model="com.axelor.apps.hr.db.Absence" title="Absence">
        <view name="absence-grid" type="grid"/>
        <view name="absence-form" type="form"/>
  </action-view>

  <action-method name="action-method-absence-save">
        <call class="com.axelor.apps.hr.web.AbsenceController" method="attachTheAbsenceWithDailyReport"/>
  </action-method>

  <form name="choose-absence-type-popup-form" title="Voir les absences" model="com.axelor.apps.base.db.Wizard">
    <panel name="absence-all-day-popup" title="Les absences">
      <field name="$chooseTypeAbsence" title="Type Absence" widget="SelectProgress" selection="hr.type.absence.selection"/>
      <button name="chooseAbsenceTypeButton" title="Ajouter Type" onClick="save,action-method-hr-choose-absence-type,save,close" colSpan="12"/>
    </panel>
  </form>

  <action-view name="action-choose-absence-type-wizard" model="com.axelor.apps.base.db.Wizard" title="Choisir Type d'absence">
      <view name="choose-absence-type-popup-form" type="form"/>
      <view-param name="popup" value="true"/>
      <view-param name="show-toolbar" value="false"/>
      <view-param name="show-confirm" value="false"/>
      <view-param name="popup-save" value="false"/>
  </action-view>

  <action-method name="action-method-hr-choose-absence-type">
        <call class="com.axelor.apps.hr.web.AbsenceController" method="chooseAbsenceType"/>
  </action-method>
</object-views>