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

    <entity name="QvmOperation">

        <string name="serialNumber" />
        <many-to-one name="operationType" ref="com.axelor.apps.qvm.db.QvmOperationType"  required="true"/>

        <many-to-one name="machineName" ref="com.axelor.apps.production.db.Machine" required="true"/>
        <string name="machineId"/>
        <string name="machineBrand"/>
        <string name="machineModel"/>
        <string name="machineSerialNumber"/>
        <many-to-one name="machineLocalisation" ref="com.axelor.apps.qvm.db.QvmMachineLocation"/>
        <many-to-one name="machineLocalisationParent" ref="com.axelor.apps.qvm.db.QvmMachineLocation"/>
        <integer name="stockUnity" selection="operation.parent.location.select" default="0"/>

        <string name="fullRange"/>
        <string name="operationRange"/>
        <decimal name="leastCount"/>

        <integer name="operationFrequency" selection="operation.frequency.select"/>
        <date name="pastOperationDate"/>

        <date name="operationDate"/>
        <date name="operationDueDate"/>
        <integer name="countdown"/>
        <string name="reportCertifiacteNumber"/>
        <boolean name="externalInternal" default="true"/>

        <integer name="statusSelect" selection="operation.status.select" default="1"/>
        <many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company" hidden="true"/>
        <integer name="typeSelect" title="Type Select" selection = "operation.type.status.select" default="0"/>

        <integer name="orderByState"/>
        <many-to-one name="purchaseRequest" ref="com.axelor.apps.purchase.db.PurchaseRequest" />
        <integer name="parentLocation" selection="operation.parent.location.select" default="0"/>

        <string name="operationOrigin"/>
        <integer name="creationType" selection="operation.creation.type.select"/>
        <track>
            <field name="createdOn"/>
            <field name="createdBy"/>
            <field name="updatedOn"/>
            <field name="updatedBy"/>
            <field name="serialNumber"/>
            <field name="operationType"/>
            <field name="machineName"/>
            <field name="machineId"/>
            <field name="machineBrand"/>
            <field name="machineModel"/>
            <field name="machineSerialNumber"/>
            <field name="machineLocalisation" />
            <field name="machineLocalisationParent"/>
            <field name="stockUnity"/>
            <field name="fullRange"/>
            <field name="operationRange"/>
            <field name="leastCount"/>
            <field name="operationFrequency"/>
            <field name="pastOperationDate"/>
            <field name="operationDate"/>
            <field name="operationDueDate"/>
            <field name="countdown"/>
            <field name="reportCertifiacteNumber"/>
            <field name="externalInternal"/>
            <field name="statusSelect"/>
            <field name="company"/>
            <field name="typeSelect"/>
            <field name="orderByState"/>
            <field name="purchaseRequest"/>
            <field name="parentLocation"/>
        </track>
    </entity>

</domain-models>
