<?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="ebics-bank-grid" title="Ebics bank" model="com.axelor.apps.bankpayment.db.EbicsBank">
		<field name="hostId"/>
		<field name="name"/>
		<field name="url"/>
	</grid>

	<form name="ebics-bank-form" title="Ebics bank" model="com.axelor.apps.bankpayment.db.EbicsBank">
		<panel name="generalInfoPanel" title="General information">
			<field name="fullName" colSpan="12" showTitle="false" css="label-bold bold large" hideIf="!fullName" readonly="true"/>
			<field name="bank" canNew="true" onChange="action-ebics-bank-record-onchange-bank"/>
			<field name="hostId"/>
			<field name="fax" placeholder="+33000000000" pattern="^\+?([\s()-.]*\d){7,}$" onChange="action-partner-method-normalize-fax"/>
			<field name="emailAddress" placeholder="whatever@example.com" pattern="^[a-z0-9A-ZáàâäãåçéèêëíìîïñóòôöõúùûüýÿæœÁÀÂÄÃÅÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙÛÜÝŸÆŒ!#$%&amp;'*+/=?^_`{|}~-]+(?:\.[a-z0-9A-ZáàâäãåçéèêëíìîïñóòôöõúùûüýÿæœÁÀÂÄÃÅÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙÛÜÝŸÆŒ!#$%&amp;'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[a-z]{2,})$"/>
			<field name="protocolSelect" required="true" />
			<field name="url" colSpan="12" pattern="http(s)?://.+" />
			<field name="language" canEdit="false" />
			<field name="certValidityPeriodSelect" />
			<field name="useX509ExtentionForAutoSignedCert"/>
		</panel>

		<panel-related name="ebicsCertificateListPanel" field="ebicsCertificateList" form-view="ebics-certificate-form" grid-view="ebics-certificate-grid"/>
		
		<panel-dashlet name="ebicsBankDetailsPanel" hideIf="!bank" action="action-ebics-bank-view-bank-details"/>
		
		<panel-dashlet name="ebicsUsersPanel" action="action-ebics-bank-view-ebics-users"/>
	</form>

	<action-record name="action-ebics-bank-record-onchange-bank" model="com.axelor.apps.bankpayment.db.EbicsBank">
		<field name="hostId" expr="eval: bank?.code"/>
	</action-record>

	<action-view name="action-ebics-bank-view-bank-details" model="com.axelor.apps.base.db.BankDetails" title="Bank Details">
		<view name="bank-details-grid" type="grid"/>
		<view name="bank-details-form" type="form"/>
		<domain>self.id IN (:bankDetailsSet)</domain>
		<context name="bankDetailsSet" expr="eval: (!bankDetailsSet || bankDetailsSet.isEmpty()) ? 0 : __repo__(EbicsPartner).all().filter('self.ebicsBank.id = ?', __this__.id).fetch().collect{ it.getBankDetailsSet().collect { it.getId() } }.flatten()"/>
	</action-view>
	
	<action-view name="action-ebics-bank-view-ebics-users" model="com.axelor.apps.bankpayment.db.EbicsUser" title="Ebics users">
		<view name="ebics-user-grid" type="grid"/>
		<view name="ebics-user-form" type="form"/>
		<domain>self.ebicsPartner.ebicsBank.id = :id</domain>
	</action-view>
	
	
</object-views>
