<?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="stock" package="com.axelor.apps.stock.db"/>

  <entity name="StockLocation" lang="java">

    <string name="name" title="Name" required="true"/>
    <many-to-one name="parentStockLocation" ref="com.axelor.apps.stock.db.StockLocation" title="Parent stock location"/>
    <many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company" required="true"/>
    <many-to-one name="partner" ref="com.axelor.apps.base.db.Partner" title="Deported stock location"/>
    <integer name="typeSelect" title="Type" required="true" selection="stock.stock.location.type.select"/>
    <one-to-many name="stockLocationLineList" ref="com.axelor.apps.stock.db.StockLocationLine" mappedBy="stockLocation" title="Stock location lines"/>
    <one-to-many name="detailsStockLocationLineList" ref="com.axelor.apps.stock.db.StockLocationLine" mappedBy="detailsStockLocation" title="Details stock location lines"/>
    <many-to-one name="address" ref="com.axelor.apps.base.db.Address" title="Address" />
    <boolean name="includeOutOfStock" title="Include out of stocks products" default="false"/>
	<decimal name="stockLocationValue" title="Stock location value" transient="true"/>
  <boolean name="excludeValorisation" title="Exclude valorisation" default="false"/>
    <many-to-many name="stockLocationList" ref="com.axelor.apps.stock.db.StockLocation" title="Stock locations"/>
    <many-to-one name="picture" ref="com.axelor.meta.db.MetaFile" title="Photo" index="false"/>

    <finder-method name="findByCompany" using="company"/>
    <finder-method name="findByPartner" using="partner"/>
    
     <extra-code><![CDATA[
	
	   	// TYPE SELECT
		public static final int TYPE_INTERNAL = 1;
		public static final int TYPE_EXTERNAL = 2;
		public static final int TYPE_VIRTUAL = 3;
    
        // PRINT TYPE SELECT
        public static final int PRINT_TYPE_LOCATION_FINANCIAL_DATA = 1;
        public static final int PRINT_TYPE_STOCK_LOCATION_CONTENT = 2;

    public static final int TYPE_COMPLIANT = 2;
		public static final int TYPE_NOT_COMPLIANT = 3;
		public static final int TYPE_QUARANTINE = 4;

	
	]]></extra-code>
	
  </entity>
</domain-models>
