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

  <entity name="PurchaseOrder" lang="java">
  
  	<many-to-one name="invoice" ref="com.axelor.apps.account.db.Invoice" title="Invoice" readonly="true"/>
	<many-to-one name="paymentMode" ref="com.axelor.apps.account.db.PaymentMode" title="Payment mode"/>
    <many-to-one name="paymentCondition" ref="com.axelor.apps.account.db.PaymentCondition" title="Payment condition"/>
  	
    <decimal name="amountInvoiced" title="Amount invoiced W.T." readonly="true"/>
    
  	<many-to-one name="stockLocation" ref="com.axelor.apps.stock.db.StockLocation" title="Stock location"/>
  	
  	<one-to-many name="timetableList" ref="com.axelor.apps.supplychain.db.Timetable" title="Timetable" mappedBy="purchaseOrder"/>
	<date name="expectedRealisationDate" title="Expected realisation date"/>
	<boolean name="interco" title="Interco"/>
	<boolean name="createdByInterco" default="false"/>

	<!-- Supplier Rating -->
	<one-to-one name="supplierRating" title="Supplier Rating List" ref="com.axelor.apps.supplychain.db.SupplierRating" mappedBy="purchaseOrder"/>

	<many-to-one name="budget" ref="com.axelor.apps.account.db.Budget" title="Budget"/>
		<long name="generatedSaleOrderId"/>
	<many-to-one name="analyticAccount" ref="com.axelor.apps.account.db.AnalyticAccount" title="Analytic account"/>
	<many-to-one name="analyticAxis" ref="com.axelor.apps.account.db.AnalyticAxis" title="Analytic axis" />

  </entity>

</domain-models>
