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

  <entity name="UnitConversion" lang="java" cacheable="true">

    <many-to-one name="startUnit" ref="Unit" title="From Unit" required="true"/>
    <many-to-one name="endUnit" ref="Unit" title="To Unit" required="true"/>
    <decimal name="coef" title="Coeff." required="true" precision="30" scale="12"/>
    <integer name="typeSelect" title="Type" selection="unit.conversion.type.select" default="1"/>
    <string name="formula" title="Formula"/>
  
    <string name="name" search="startUnit,endUnit" title="Name">
    	<![CDATA[
    		return startUnit.getName() + " => " + endUnit.getName();
    	]]>
   	</string>
   		
   	<extra-code>
   		<![CDATA[
    		public static final int TYPE_COEFF = 1;
			public static final int TYPE_FORMULA = 2;;
    	]]>
   	</extra-code>
  
  </entity>

</domain-models>
