<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">

  <module name="sale" package="com.axelor.apps.sale.db"/>

  <entity name="SaleOrderLine" lang="java">
  
  	<integer name="saleSupplySelect" title="Supply method" selection="product.sale.supply.select"/>
  	
  	<date name="invoicingDate" title="Invoicing Date"/>
  	
  	<decimal name="amountInvoiced" title="Amount invoiced W.T." readonly="true"/>
  	
  	
<!-- Bon de livraison -->
  	<boolean name="isInvoiceControlled" title="Invoice controlled"/>
  	
  	<one-to-many name="analyticMoveLineList" ref="com.axelor.apps.account.db.AnalyticMoveLine" title="Analytic move lines" mappedBy="saleOrderLine"/>
  	<many-to-one name="analyticDistributionTemplate" title="Analytic distribution template" ref="com.axelor.apps.account.db.AnalyticDistributionTemplate"/>
	<boolean name="invoiced" readonly="true"/>

	<string name="pickingOrderInfo" title="Picking Order Info" large="true"/>

	<decimal name="reservedQty" title="Allocated qty" min="0"/>
	<decimal name="requestedReservedQty" title="Requested reserved qty" min="0"/>
  <boolean name="isQtyRequested" readonly="true" title="Quantity requested"/>

  	<integer name="deliveryState" title="Delivery state" selection="sale.order.delivery.state" readonly="true" default="0"/>

	<integer name="standardDelay" title="Standard delay (days)" default="0"  />
  	<extra-code>
  		<![CDATA[
            // SALE SUPPLY SELECT
	  		public static final int SALE_SUPPLY_NONE = 0;
	  		public static final int SALE_SUPPLY_FROM_STOCK = 1;
	  		public static final int SALE_SUPPLY_PURCHASE = 2;
	  		public static final int SALE_SUPPLY_PRODUCE = 3;
	  		
	        // DELIVERY STATE SELECT
            public static final int DELIVERY_STATE_NOT_DELIVERED = 1;
            public static final int DELIVERY_STATE_PARTIALLY_DELIVERED = 2;
            public static final int DELIVERY_STATE_DELIVERED = 3;
	  	]]>
  	</extra-code>
  	
  	
		<track on="UPDATE">
			<field name="requestedReservedQty"/>
			<field name="reservedQty"/>
		</track>

  </entity>

</domain-models>
