<?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="forecast-grid" title="Forecasts" model="com.axelor.apps.cash.management.db.Forecast">
		<field name="company" if="__config__.app.getApp('base').getEnableMultiCompany()"/>
		<field name="bankDetails"/>
		<field name="typeSelect"/>
		<field name="amount" aggregate="sum"/>
		<field name="estimatedDate"/>
		<field name="realizedSelect"/>
	</grid>
 
	 <form name="forecast-form" title="Forecast" model="com.axelor.apps.cash.management.db.Forecast"
	 	onNew="action-forecast-record-default-on-new">
	 	<panel name="mainPanel" >
			<field name="company" canEdit="false" onChange="action-forecast-record-bank"/>
	       	<field name="bankDetails" onSelect="action-accounting-batch-attrs-bank-details-domain"/>
	       	<field name="typeSelect"/>
	       	<field name="amount"/>
	       	<field name="estimatedDate"/>
	       	<field name="forecastReason"/>
	       	<field name="realizedSelect" widget="RadioSelect"/>
	       	<field name="comments" colSpan="12"/>
	 	</panel>
	 </form>
	 
	 <action-record name="action-forecast-record-default-on-new" model="com.axelor.apps.cash.management.db.Forecast">
	 	<field name="company" expr="eval: __user__.activeCompany"/>
	 	<field name="bankDetails" expr="eval: __user__.activeCompany?.defaultBankDetails" if="__user__.activeCompany?.defaultBankDetails?.active"/>
	 </action-record>
	 
	  <action-record name="action-forecast-record-bank" model="com.axelor.apps.cash.management.db.Forecast">
	 	<field name="bankDetails" expr="eval: company?.defaultBankDetails" if="company?.defaultBankDetails?.active"/>
	 </action-record>
    
</object-views>