<?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="analytic-journal-grid" title="Analytic Journal" model="com.axelor.apps.account.db.AnalyticJournal">
		<field name="name"/>
		<field name="type" form-view="analytic-journal-type-form" grid-view="analytic-journal-type-grid"/>
		<field name="company" form-view="company-form" grid-view="company-grid" if="__config__.app.getApp('base').getEnableMultiCompany()"/>
	</grid>
	
    <form name="analytic-journal-form" title="Analytic Journal" model="com.axelor.apps.account.db.AnalyticJournal" onNew="action-analytic-journal-set-default" >
        <panel name="mainPanel" >
        	<field name="name"/>
        	<field name="type" form-view="analytic-journal-type-form" grid-view="analytic-journal-type-grid"/>
        	<field name="company" canEdit="false" widget="SuggestBox" form-view="company-form" grid-view="company-grid"/>
        </panel>
    </form>
    
    <action-record name="action-analytic-journal-set-default" model="com.axelor.apps.account.db.AnalyticJournal">
        <field name="company"  expr="eval:__user__.activeCompany" if="__user__.activeCompany != null"/>
    	<field name="company"  expr="eval:__repo__(Company).all().fetchOne()" if="__user__.activeCompany == null &amp;&amp; __repo__(Company).all().fetch().size == 1"/>
    </action-record>
    
    
</object-views>