<?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="cancel-reason-grid" title="Cancel Reasons" model="com.axelor.apps.base.db.CancelReason">
        <field name="name"/>
    </grid>

    <form name="cancel-reason-form" title="Cancel Reason" model="com.axelor.apps.base.db.CancelReason"
          onNew="action-cancel-reason-attrs-fill-application-type">
        <panel name="mainPanel" >
            <field name="name"/>
            <field name="applicationType" hidden="true"/>
            <field name="cancelQuantityAllocation" if-module="axelor-supplychain" if="__config__.app.getApp('supplychain')?.getManageStockReservation()" hideIf="applicationType == 'com.axelor.apps.account.db.Invoice'" colSpan="12"/>
            <field name="freeText" widget="boolean-switch"/>
        </panel>
    </form>

    <action-attrs name="action-cancel-reason-attrs-fill-application-type">
        <attribute if="_xApplicationType" for="applicationType" name="value" expr="eval: _xApplicationType"/>
        <attribute for="applicationType" name="hidden" expr="eval: _xApplicationType != null"/>
    </action-attrs>

</object-views>
