<?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="file-tab-grid" title="File tabs" model="com.axelor.apps.base.db.FileTab">
		<hilite color="danger" if="validationLog != null"/>
		<field name="name"/>
		<field name="metaModel"/>
		<field name="importType"/>
		<field name="validationLog" hidden="true"/>
	</grid>
    
	<form name="file-tab-form" title="File tab" model="com.axelor.apps.base.db.FileTab">
		<panel name="mainPanel">
			<field name="name"/>
			<field name="metaModel" required="true" onChange="action-file-tab-group-on-meta-model"/>
			<field name="importType" selection-in="[1,2,3]" showIf="metaModel != null" onChange="action-file-tab-record-set-search-field" validIf="$number(importType) > 0"/>
			<field name="searchFieldSet" domain="self.fileTab = :id" widget="TagSelect" form-view="file-field-form" grid-view="file-field-grid" colSpan="12" canNew="false" showIf="(importType == 1 || importType == 2) &amp;&amp; metaModel != null"/>
			<panel-related field="fileFieldList" onChange="action-file-tab-method-compute" colSpan="12" grid-view="file-field-grid" form-view="file-field-form" orderBy="sequence"/>
			<field name="validationLog" widget="binary-link" showIf="validationLog != null"/>
			<field name="advancedImport.statusSelect" hidden="true"/>
		</panel>
	</form>
	
	<action-method name="action-file-tab-method-update-fields">
		<call class="com.axelor.apps.base.web.FileTabController" method="updateFields"/>
	</action-method>
	
	<action-record name="action-file-tab-record-set-search-field" model="com.axelor.apps.base.db.FileTab">
		<field name="searchFieldSet" expr="eval: null" if="importType == 3 &amp;&amp; searchFieldSet != null"/>
	</action-record>
	
	<action-record name="action-file-tab-record-import-type" model="com.axelor.apps.base.db.FileTab">
		<field name="importType" expr="3"/>
	</action-record>
	
	<action-method name="action-file-tab-method-compute">
		<call class="com.axelor.apps.base.web.FileTabController" method="compute"/>
	</action-method>
	
	<action-method name="action-file-tab-method-show-record">
		<call class="com.axelor.apps.base.web.FileTabController" method="showRecord"/>
	</action-method>
	
	<action-group name="action-file-tab-group-on-meta-model">
	  <action name="action-file-tab-record-import-type"/>
	  <action name="action-file-tab-record-set-search-field"/>
	  <action name="action-file-tab-method-update-fields"/>
	</action-group>
	
</object-views>
