add : Machine.xml view and domain

This commit is contained in:
zakaria.hachem
2024-11-05 09:03:27 +01:00
parent f1d1684f41
commit 29c2e8ed13
2 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<?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="production" package="com.axelor.apps.production.db"/>
<entity name="Machine">
<one-to-many name="operationList" ref="com.axelor.apps.qvm.db.Operation" mappedBy="machineName" title="Calibrations" />
<many-to-one name="machineLocation" ref="com.axelor.apps.qvm.db.MachineLocation" title="Machine Location" required="true"/>
<string name="model" title="Model"/>
<string name="machineId" title="ID"/>
<integer name="typeSelect" title="Type Select" default="0"/>
<integer name="machineOperationType" required="true" selection="operation.machine.type.status.select" default="1"/>
<string name="remarque" title="Remarque"/>
</entity>
</domain-models>

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<object-views xmlns="http://axelor.com/xml/ns/object-views"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_5.2.xsd">
<grid name="machine-grid-qvm" title="Instrument / Equipment" model="com.axelor.apps.production.db.Machine">
<field name="machineId" title="ID"/>
<field name="name"/>
<field name="brand"/>
<field name="model"/>
<field name="serialNumber"/>
<field name="machineLocation" title="Location" grid-view="machine-location-grid" form-view="machine-location-form"/>
<field name="machineLocation.parent" title="Location Parent" grid-view="machine-location-grid" form-view="machine-location-form"/>
<field name="machineLocation.stockUnity" title="Location Unity" grid-view="machine-location-grid" form-view="machine-location-form"/>
<field name="description" title="Description"/>
</grid>
<form name="machine-form-qvm" title="Instrument / Equipment" model="com.axelor.apps.production.db.Machine" width="large" onNew="set-qvm-machine-type"
onLoad="action-record-machine-set-operating-duration">
<panel name="informationsPanel" colSpan="9">
<field name="picture" showTitle="false" colSpan="12" widget="Image"/>
<field name="serialNumber" colSpan="4" placeholder="Serial Number"/>
<field name="name" required="true" colSpan="4" placeholder="Name"/>
<field name="machineOperationType" required="true" title="Type" colSpan="4" placeholder="Operation Type" onChange="machine-operation-type-panel-title-changer"/>
<!--<panel name="actionPanel" colSpan="6">
<button name="$operatingDurationBtn" title="Operating duration" colSpan="12" icon="fa-clock-o" widget="info-button"/>
</panel>-->
</panel>
<panel name="mainPanel" title="">
<field name="machineId" title="ID" colSpan="4"/>
<field name="brand" colSpan="4"/>
<field name="machineLocation" title="Location" colSpan="4" required="true"/>
<field name="startingDuration" colSpan="4" widget="duration" x-big="true" x-seconds="true"/>
<field name="setupDuration" colSpan="4" widget="duration" x-big="true" x-seconds="true"/>
<field name="endingDuration" colSpan="4" widget="duration" x-big="true" x-seconds="true"/>
<field name="weeklyPlanning" canNew="true"/>
<field name="description" colSpan="12"/>
</panel>
</form>
<action-view name="manufacturing.equipement.qvm" model="com.axelor.apps.production.db.Machine" title="Instrument / Equipment">
<view name="machine-grid-qvm" type="grid"/>
<view name="machine-form-qvm" type="form"/>
<domain>self.typeSelect = 1 or self.typeSelect = 2</domain>
</action-view>
<action-method name="action-operation-set-machine-info">
<call method="setMachineInfo" class="com.axelor.apps.qvm.web.QvmOperationController"/>
</action-method>
<action-record name="set-qvm-machine-type" model="com.axelor.apps.production.db.Machine">
<field name="statusSelect" expr="eval: 2"/>
</action-record>
</object-views>