<?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="account-equiv-grid" title="Account equivalences" model="com.axelor.apps.account.db.AccountEquiv" orderBy="fromAccount" editable="true">
        <field name="fromAccount" onChange="action-account-equiv-attrs-reset-to-account" form-view="account-form" grid-view="account-grid"/>
        <field name="toAccount" onSelect="action-account-equiv-attrs-domain-to-account" form-view="account-form" grid-view="account-grid"/>
    </grid>

    <form name="account-equiv-form" title="Account equivalence" model="com.axelor.apps.account.db.AccountEquiv"  >
        <panel name="mainPanel" >
        	<field name="fromAccount" onChange="action-account-equiv-attrs-reset-to-account" form-view="account-form" grid-view="account-grid"/>
       		<field name="toAccount" onSelect="action-account-equiv-attrs-domain-to-account" form-view="account-form" grid-view="account-grid"/>
        </panel>
    </form>
    
    <action-attrs name="action-account-equiv-attrs-domain-to-account">
    	<attribute name="domain" for="toAccount" expr="eval: &quot; self.company = ${fromAccount.company.id} &quot;"/>
    </action-attrs>
    
    <action-attrs name="action-account-equiv-attrs-reset-to-account">
    	<attribute name="value" for="toAccount" expr="eval: null"/>
    </action-attrs>

</object-views>