<?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 http://axelor.com/xml/ns/object-views/object-views_5.2.xsd">

	<grid name="employee-file-grid" title="Files" model="com.axelor.apps.hr.db.EmployeeFile" >	
		<field name="fileType"  />
		<field name="metaFile" />
        <field name="expirationDate" />		
    </grid>

    <form name="employee-file-form" title="File" model="com.axelor.apps.hr.db.EmployeeFile">   
    	<panel name="mainPanel">    	
	    	<field name="fileType" colSpan="4" onChange="action-record-set-expiration-date"/>
			<field name="metaFile" widget="binary-link" colSpan="4"/>	
			<field name="expirationDate" showIf="fileType.hasExpirationDate" colSpan="4"/>		
			<field name="fileType.hasExpirationDate" hidden="true" />
        </panel>       
    </form>
   
   <action-record name="action-record-set-expiration-date" model="com.axelor.apps.hr.db.EmployeeFile">
      <field name="expirationDate" expr="eval: null" if="!fileType?.hasExpirationDate"/>
   </action-record>

</object-views>
