<?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="reconcile-group-grid" title="Reconcile group" model="com.axelor.apps.account.db.ReconcileGroup" canNew="false"
    canDelete="false">
    <field name="code" width="120"/>
    <field name="company" if="__config__.app.getApp('base').getEnableMultiCompany()"/>
  </grid>

  <form name="reconcile-group-form" title="Reconcile group"
    model="com.axelor.apps.account.db.ReconcileGroup"
    canNew="false"
    canDelete="false">
    <panel itemSpan="12" name="infoPanel">
      <field name="statusSelect" widget="NavSelect" showTitle="false"/>
      <field name="code" showTitle="false">
        <viewer depends="code">
          <![CDATA[
						<h3>
							<span  style="margin: 5px 0 !important; display: inline-table; line-height: initial;">{{record.code}}</span>
						</h3>
					]]>
        </viewer>
      </field>
    </panel>
    <panel name="companyPanel" showTitle="false" readonly="true">
      <field name="company"/>
      <field name="dateOfLettering" showIf="statusSelect==2" readonly="true"/>
      <field name="unletteringDate" showIf="unletteringDate != null"/>
    </panel>
    <panel name="mainPanel" showIf="company">
      <panel-dashlet name="viewReconcilePanel" action="action-reconcile-group-view-reconcile" colSpan="12"/>
      <panel-dashlet name="viewMoveLinePanel" action="action-reconcile-group-view-move-line" colSpan="12"/>
    </panel>
    <panel name="actionsPanel" sidebar="true" hideIf="unletteringDate">
      <button  name="unletterBtn" title="Unletter" onClick="action-reconcile-group-method-unletter" colSpan="12"/>
    </panel>
  </form>

  <action-view name="action-reconcile-group-view-reconcile" title="Reconcile list"
    model="com.axelor.apps.account.db.Reconcile">
    <view type="grid" name="move-line-reconcile-grid"/>
    <view type="form" name="reconcile-form"/>
    <domain>self.reconcileGroup.id = :id</domain>
  </action-view>

  <action-view name="action-reconcile-group-view-move-line" title="Move line list"
    model="com.axelor.apps.account.db.MoveLine">
    <view type="grid" name="move-line-grid"/>
    <view type="form" name="move-line-form"/>
    <domain>self.reconcileGroup.id = :id</domain>
  </action-view>

  <action-method name="action-reconcile-group-method-unletter">
    <call class="com.axelor.apps.account.web.ReconcileGroupController" method="unletter"/>
  </action-method>

</object-views>
