<?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="Blocking" lang="java">
  
    <many-to-many name="companySet" ref="com.axelor.apps.base.db.Company" title="Companies"/>
    <many-to-one name="partner" ref="com.axelor.apps.base.db.Partner" title="Partner"/>
    
	<integer name="blockingSelect" title="Blocking Type" selection="base.blocking.select" default="1"/>

    <date name="blockingToDate" title="Block until"/>
    <many-to-one name="blockingReason" ref="com.axelor.apps.base.db.StopReason" title="Blocking reason"/>
    <many-to-one name="blockingByUser" ref="com.axelor.auth.db.User" title="Blocking done by"/>

    <string name="name" title="Reference" search="partner">
        <![CDATA[return partner != null ? partner.getName() : "";]]>
    </string>

      <extra-code>
          <![CDATA[
              public static final Integer REMINDER_BLOCKING = 1;
              public static final Integer INVOICING_BLOCKING = 2;
              public static final Integer REIMBURSEMENT_BLOCKING = 3;

              public static final int PURCHASE_BLOCKING = 6;
          ]]>
      </extra-code>
    
  </entity>

</domain-models>
