First commit waiting for Budget Alert
This commit is contained in:
19
modules/axelor-open-suite/axelor-qvm/build.gradle
Normal file
19
modules/axelor-open-suite/axelor-qvm/build.gradle
Normal file
@ -0,0 +1,19 @@
|
||||
apply plugin: "com.axelor.app-module"
|
||||
|
||||
apply from: "../version.gradle"
|
||||
|
||||
apply {
|
||||
version = openSuiteVersion
|
||||
}
|
||||
|
||||
axelor {
|
||||
title "Axelor QVM"
|
||||
description "Axelor QVM"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(":modules:axelor-production")
|
||||
compile project(":modules:axelor-base")
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.apps.qvm.module;
|
||||
|
||||
import com.axelor.app.AxelorModule;
|
||||
import com.axelor.apps.qvm.service.QvmOperationService;
|
||||
import com.axelor.apps.qvm.service.QvmOperationServiceImpl;
|
||||
|
||||
public class QvmModule extends AxelorModule {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(QvmOperationService.class).to(QvmOperationServiceImpl.class);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.apps.qvm.service;
|
||||
|
||||
import com.axelor.apps.base.db.Company;
|
||||
import com.axelor.apps.qvm.db.QvmOperation;
|
||||
import com.axelor.exception.AxelorException;
|
||||
import com.google.inject.persist.Transactional;
|
||||
|
||||
public interface QvmOperationService {
|
||||
|
||||
@Transactional
|
||||
public QvmOperation createCalibrationSeq(Company company) throws AxelorException;
|
||||
|
||||
@Transactional
|
||||
public QvmOperation createQualificationSeq(Company company) throws AxelorException;
|
||||
|
||||
@Transactional
|
||||
public QvmOperation createOperationSeq(Company company) throws AxelorException;
|
||||
|
||||
@Transactional
|
||||
public QvmOperation setMachine(QvmOperation operation) throws AxelorException;
|
||||
|
||||
@Transactional
|
||||
public QvmOperation createNextOperation(QvmOperation operation, Long userId)
|
||||
throws AxelorException;
|
||||
}
|
||||
@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.apps.qvm.service;
|
||||
|
||||
import com.axelor.apps.base.db.Company;
|
||||
import com.axelor.apps.base.db.repo.SequenceRepository;
|
||||
import com.axelor.apps.base.service.administration.SequenceService;
|
||||
import com.axelor.apps.qvm.db.QvmOperation;
|
||||
import com.axelor.apps.qvm.db.repo.QvmOperationRepository;
|
||||
import com.axelor.exception.AxelorException;
|
||||
import com.axelor.exception.db.repo.TraceBackRepository;
|
||||
import com.axelor.i18n.I18n;
|
||||
import com.axelor.inject.Beans;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.persist.Transactional;
|
||||
|
||||
public class QvmOperationServiceImpl implements QvmOperationService {
|
||||
|
||||
@Inject protected SequenceService sequenceService;
|
||||
|
||||
@Transactional
|
||||
public QvmOperation createCalibrationSeq(Company company) throws AxelorException {
|
||||
|
||||
QvmOperation calibration = new QvmOperation();
|
||||
calibration.setSerialNumber(this.getCalibrationSequence(company));
|
||||
|
||||
return calibration;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public QvmOperation createQualificationSeq(Company company) throws AxelorException {
|
||||
|
||||
QvmOperation qualification = new QvmOperation();
|
||||
qualification.setSerialNumber(this.getQualificationSequence(company));
|
||||
|
||||
return qualification;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public QvmOperation createOperationSeq(Company company) throws AxelorException {
|
||||
|
||||
QvmOperation operation = new QvmOperation();
|
||||
operation.setSerialNumber(this.getOperationSequence(company));
|
||||
|
||||
return operation;
|
||||
}
|
||||
|
||||
public String getCalibrationSequence(Company company) throws AxelorException {
|
||||
String seq = sequenceService.getSequenceNumber(SequenceRepository.CALIB_SEQ, company);
|
||||
if (seq == null) {
|
||||
throw new AxelorException(
|
||||
company,
|
||||
TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,
|
||||
I18n.get("Calibration Sequence is not defined"),
|
||||
company.getName());
|
||||
}
|
||||
return seq;
|
||||
}
|
||||
|
||||
public String getQualificationSequence(Company company) throws AxelorException {
|
||||
String seq = sequenceService.getSequenceNumber(SequenceRepository.QUAL_SEQ, company);
|
||||
if (seq == null) {
|
||||
throw new AxelorException(
|
||||
company,
|
||||
TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,
|
||||
I18n.get("Qualification Sequence is not defined"),
|
||||
company.getName());
|
||||
}
|
||||
return seq;
|
||||
}
|
||||
|
||||
public String getOperationSequence(Company company) throws AxelorException {
|
||||
String seq = sequenceService.getSequenceNumber(SequenceRepository.OP_SEQ, company);
|
||||
if (seq == null) {
|
||||
throw new AxelorException(
|
||||
company,
|
||||
TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,
|
||||
I18n.get("Operation Sequence is not defined"),
|
||||
company.getName());
|
||||
}
|
||||
return seq;
|
||||
}
|
||||
|
||||
public QvmOperation setMachine(QvmOperation calibration) throws AxelorException {
|
||||
if (calibration.getMachineName() != null) {
|
||||
System.out.println("calibration.getMachineName : " + calibration.getMachineName());
|
||||
}
|
||||
return calibration;
|
||||
}
|
||||
|
||||
public QvmOperation createNextOperation(QvmOperation operation, Long userId) {
|
||||
QvmOperation nextOperation = Beans.get(QvmOperationRepository.class).copy(operation, true);
|
||||
if (operation != null) {
|
||||
try {
|
||||
nextOperation.setStatusSelect(1);
|
||||
nextOperation.setOperationOrigin(operation.getSerialNumber());
|
||||
nextOperation.setCreationType(2);
|
||||
nextOperation.setPastOperationDate(operation.getOperationDate());
|
||||
nextOperation.setOperationDate(operation.getOperationDueDate());
|
||||
if (operation.getOperationFrequency() == 1) {
|
||||
nextOperation.setOperationDueDate(operation.getOperationDueDate().plusYears(1));
|
||||
nextOperation.setCountdown(364);
|
||||
}
|
||||
if (operation.getOperationFrequency() == 2) {
|
||||
nextOperation.setOperationDueDate(operation.getOperationDueDate().plusMonths(1));
|
||||
nextOperation.setCountdown(31);
|
||||
}
|
||||
if (operation.getOperationFrequency() == 3) {
|
||||
nextOperation.setOperationDueDate(operation.getOperationDueDate().plusMonths(6));
|
||||
nextOperation.setCountdown(183);
|
||||
}
|
||||
System.out.println(
|
||||
"operation.getOperationFrequency : " + operation.getOperationFrequency());
|
||||
nextOperation.setSerialNumber(null);
|
||||
nextOperation.setCreationType(2);
|
||||
} catch (Exception exception) {
|
||||
System.out.println(exception);
|
||||
}
|
||||
}
|
||||
// Beans.get(QvmOperationRepository.class).save(nextOperation);
|
||||
return nextOperation;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.axelor.apps.qvm.translation;
|
||||
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
public interface ITranslation {
|
||||
|
||||
public static final String OPERATION = /*$$(*/ "Operation"; /*)*/
|
||||
}
|
||||
@ -0,0 +1,168 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.apps.qvm.web;
|
||||
|
||||
import com.axelor.apps.qvm.db.QvmOperation;
|
||||
import com.axelor.apps.qvm.db.repo.QvmOperationRepository;
|
||||
import com.axelor.apps.qvm.service.QvmOperationService;
|
||||
import com.axelor.apps.qvm.translation.ITranslation;
|
||||
import com.axelor.auth.AuthUtils;
|
||||
import com.axelor.auth.db.User;
|
||||
import com.axelor.exception.AxelorException;
|
||||
import com.axelor.exception.service.TraceBackService;
|
||||
import com.axelor.i18n.I18n;
|
||||
import com.axelor.inject.Beans;
|
||||
import com.axelor.meta.schema.actions.ActionView;
|
||||
import com.axelor.rpc.ActionRequest;
|
||||
import com.axelor.rpc.ActionResponse;
|
||||
import com.axelor.rpc.Context;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EntityTransaction;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class QvmOperationController {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public void setSequenceOperation(ActionRequest request, ActionResponse response) {
|
||||
try {
|
||||
QvmOperation calibration = request.getContext().asType(QvmOperation.class);
|
||||
|
||||
if (calibration != null && calibration.getCompany() != null) {
|
||||
response.setValue(
|
||||
"serialNumber",
|
||||
Beans.get(QvmOperationService.class)
|
||||
.createOperationSeq(calibration.getCompany())
|
||||
.getSerialNumber());
|
||||
} else {
|
||||
System.out.println("Operation or company est null");
|
||||
System.out.println("Operation : " + calibration);
|
||||
System.out.println("Company : " + calibration.getCompany());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TraceBackService.trace(response, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSequenceCalibration(ActionRequest request, ActionResponse response) {
|
||||
try {
|
||||
QvmOperation calibration = request.getContext().asType(QvmOperation.class);
|
||||
|
||||
if (calibration != null && calibration.getCompany() != null) {
|
||||
response.setValue(
|
||||
"serialNumber",
|
||||
Beans.get(QvmOperationService.class)
|
||||
.createCalibrationSeq(calibration.getCompany())
|
||||
.getSerialNumber());
|
||||
} else {
|
||||
System.out.println("Operation or company est null");
|
||||
System.out.println("Operation : " + calibration);
|
||||
System.out.println("Company : " + calibration.getCompany());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TraceBackService.trace(response, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSequenceQualification(ActionRequest request, ActionResponse response) {
|
||||
try {
|
||||
QvmOperation calibration = request.getContext().asType(QvmOperation.class);
|
||||
|
||||
if (calibration != null && calibration.getCompany() != null) {
|
||||
response.setValue(
|
||||
"serialNumber",
|
||||
Beans.get(QvmOperationService.class)
|
||||
.createQualificationSeq(calibration.getCompany())
|
||||
.getSerialNumber());
|
||||
} else {
|
||||
System.out.println("Operation or company est null");
|
||||
System.out.println("Operation : " + calibration);
|
||||
System.out.println("Company : " + calibration.getCompany());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TraceBackService.trace(response, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setMachineInfo(ActionRequest request, ActionResponse response)
|
||||
throws AxelorException {
|
||||
QvmOperation calibration = request.getContext().asType(QvmOperation.class);
|
||||
QvmOperation newOperation = Beans.get(QvmOperationService.class).setMachine(calibration);
|
||||
}
|
||||
|
||||
public void generateQvmOperation(ActionRequest request, ActionResponse response) {
|
||||
try {
|
||||
User user = AuthUtils.getUser();
|
||||
Context context = request.getContext();
|
||||
Long id = (Long) request.getContext().get("id");
|
||||
QvmOperation operation = Beans.get(QvmOperationRepository.class).find(id);
|
||||
if (operation == null) {
|
||||
response.setError("Operation not found.");
|
||||
return;
|
||||
}
|
||||
operation = Beans.get(QvmOperationRepository.class).find(operation.getId());
|
||||
|
||||
// printOperationInformation(operation);
|
||||
QvmOperation nextOperation =
|
||||
Beans.get(QvmOperationService.class).createNextOperation(operation, user.getId());
|
||||
|
||||
// printOperationInformation(nextOperation);
|
||||
if (nextOperation != null) {
|
||||
try {
|
||||
// Beans.get(QvmOperationRepository.class).save(nextOperation);
|
||||
saveQvmOperation(nextOperation);
|
||||
} catch (Exception e) {
|
||||
TraceBackService.trace(response, e);
|
||||
}
|
||||
response.setView(
|
||||
ActionView.define(I18n.get(ITranslation.OPERATION))
|
||||
.model(QvmOperation.class.getName())
|
||||
.add("grid", "operation-grid")
|
||||
.add("form", "operation-form")
|
||||
.param("forceEdit", "true")
|
||||
.context("_showRecord", nextOperation.getId())
|
||||
.map());
|
||||
response.setCanClose(true);
|
||||
} else {
|
||||
response.setError("Failed to create the next operation.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TraceBackService.trace(response, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveQvmOperation(QvmOperation operation) {
|
||||
EntityManager entityManager = Beans.get(EntityManager.class);
|
||||
EntityTransaction transaction = entityManager.getTransaction();
|
||||
|
||||
System.out.println("Is transaction active? " + transaction.isActive());
|
||||
|
||||
try {
|
||||
transaction.begin();
|
||||
entityManager.persist(operation);
|
||||
transaction.commit();
|
||||
} catch (Exception e) {
|
||||
if (transaction != null && transaction.isActive()) {
|
||||
transaction.rollback();
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
<?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.QvmOperation" mappedBy="machineName" title="Operations" />
|
||||
<many-to-one name="machineLocation" ref="com.axelor.apps.qvm.db.QvmMachineLocation" title="Machine Location"/>
|
||||
<string name="model" title="Model"/>
|
||||
<string name="machineId" title="ID"/>
|
||||
<integer name="typeSelect" title="Type Select" default="0"/>
|
||||
<integer name="machineOperationType" selection="operation.machine.type.status.select" default="1"/>
|
||||
<string name="note" title="Note"/>
|
||||
<string name="fullName" namecolumn="true">
|
||||
<![CDATA[
|
||||
return machineId+" "+name;
|
||||
]]>
|
||||
</string>
|
||||
</entity>
|
||||
</domain-models>
|
||||
@ -0,0 +1,18 @@
|
||||
<?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="QvmMachineLocation">
|
||||
<string name="name" title="Location" required="true"/>
|
||||
<!-- <many-to-one name="parent" ref="com.axelor.apps.qvm.db.QvmMachineLocation" title="parent"/> -->
|
||||
<one-to-many name="machineList" ref="com.axelor.apps.production.db.Machine" mappedBy="machineLocation" title="Machine List" />
|
||||
<integer name="orderByState"/>
|
||||
<!-- <integer name="stockUnity" selection="operation.parent.location.select" default="0"/> -->
|
||||
<integer name="qvmParentLocation" selection="operation.parent.location.select" default="0"/>
|
||||
<integer name="typeSelect" title="Type Select" default="0"/>
|
||||
</entity>
|
||||
|
||||
</domain-models>
|
||||
@ -0,0 +1,79 @@
|
||||
<?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>
|
||||
@ -0,0 +1,27 @@
|
||||
<?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="QvmOperationType">
|
||||
<string name="fullName" namecolumn="true">
|
||||
<![CDATA[
|
||||
|
||||
if(fullName == null){
|
||||
return name+" "+stockUnity;
|
||||
}else{
|
||||
return fullName;
|
||||
}
|
||||
]]>
|
||||
</string>
|
||||
<string name="name" title="Qvm Operation Type" required="true"/>
|
||||
<!--<many-to-one name="parent" ref="com.axelor.apps.qvm.db.MachineLocation" title="parent"/>-->
|
||||
<integer name="stockUnity" selection="operation.parent.location.select" default="0"/>
|
||||
<integer name="orderByState"/>
|
||||
<one-to-many name="operationList" ref="com.axelor.apps.qvm.db.QvmOperation" mappedBy="operationType" title="Operations" />
|
||||
<integer name="typeSelect"/>
|
||||
</entity>
|
||||
|
||||
</domain-models>
|
||||
@ -0,0 +1,21 @@
|
||||
<?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="Sequence" lang="java">
|
||||
|
||||
<extra-code><![CDATA[
|
||||
|
||||
//SEQUENCE SELECT
|
||||
public static final String CALIB_SEQ = "calibrationSeq";
|
||||
public static final String QUAL_SEQ = "qualificationSeq";
|
||||
public static final String OP_SEQ = "operationSeq";
|
||||
|
||||
]]></extra-code>
|
||||
|
||||
</entity>
|
||||
|
||||
</domain-models>
|
||||
@ -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>
|
||||
@ -0,0 +1,36 @@
|
||||
<?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-location-grid-qvm" title="Equipement Location" model="com.axelor.apps.qvm.db.QvmMachineLocation">
|
||||
<field name="name"/>
|
||||
<field name="parent"/>
|
||||
<field name="stockUnity"/>
|
||||
</grid>
|
||||
|
||||
<form name="machine-location-form-qvm" title="Equipement Location" model="com.axelor.apps.qvm.db.QvmMachineLocation" >
|
||||
<panel name="mainPanel">
|
||||
<field name="name" colSpan="4"/>
|
||||
<field name="parent" colSpan="4" onChange="save,action-record-machine_location-default-location-record"/>
|
||||
<field name="stockUnity" colSpan="4"/>
|
||||
<field name="machineList" grid-view="machine-grid-qvm" form-view="machine-form-qvm" colSpan="12"/>
|
||||
</panel>
|
||||
</form>
|
||||
|
||||
<kanban name="machine-location-kanban-view" title="Machine Location" model="com.axelor.apps.qvm.db.QvmMachineLocation" columnBy="stockUnity" sequenceBy="orderByState" draggable="false" limit="30">
|
||||
<field name="name"/>
|
||||
<field name="parent"/>
|
||||
<template><![CDATA[
|
||||
<h4>{{name}}</h4>]]>
|
||||
</template>
|
||||
</kanban>
|
||||
|
||||
<action-view name="machine.location.qvm" model="com.axelor.apps.qvm.db.QvmMachineLocation" title="Equipement Location">
|
||||
<view name="machine-location-grid-qvm" type="grid"/>
|
||||
<view name="machine-location-form-qvm" type="form"/>
|
||||
<view name="machine-location-kanban-view" type="kanban"/>
|
||||
</action-view>
|
||||
|
||||
|
||||
</object-views>
|
||||
@ -0,0 +1,354 @@
|
||||
<?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">
|
||||
<!-- Operation -->
|
||||
<form name="operation-form" title="Operations" onNew="action-record-operation-default-record" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<toolbar>
|
||||
<button name="printBtn" title="Print" readonlyIf="!id" icon="fa-print" onClick="action-production-request-method-print"/>
|
||||
</toolbar>
|
||||
<panel name="statusSelectPanel" colSpan="12">
|
||||
<field name="statusSelect" title="Status" selection="operation.status.select" showTitle="false" readonly="true" colSpan="12" widget="nav-select"/>
|
||||
<field name="serialNumber" title="Serial Number" colSpan="12" readonly="true"/>
|
||||
<field name="operationType" title="Operation Type" grid-view="operation-type-grid" form-view="operation-type-form" onChange="action-record-operation-default-type-record"/>
|
||||
<field name="purchaseRequest" title="Purchase Request" grid-view="purchase-request-grid" form-view="purchase-request-form" domain="self.familleProduit = 149 and self.statusSelect != 7 and self.statusSelect != 8"/>
|
||||
</panel>
|
||||
<panel name="detailPanel" sidebar="true">
|
||||
<button name="draftBtn" title="Draft" showIf="statusSelect == 5" css="btn-info" icon="fa-edit" onClick="save,action-operation-request-set-status-draft, save"/>
|
||||
<button name="requestBtn" title="Request" showIf="statusSelect == 1" icon="fa-bullhorn" onClick="action-operation-set-seq-group,action-operation-request-set-status-request,save"/>
|
||||
<button name="acceptBtn" title="Accept" showIf="statusSelect == 2" icon="fa-check" css="btn-success" onClick="save,action-operation-request-set-status-accept,save"/>
|
||||
<button name="refuseBtn" title="Refuse" showIf="statusSelect == 2 " css="btn-warning" icon="fa-times" onClick="save,action-operation-request-set-status-refuse,save"/>
|
||||
<button name="cancelBtn" title="Cancel" showIf="statusSelect == 1 || statusSelect == 2 || statusSelect == 3 || statusSelect == 4" css="btn-danger" icon="fa-times-circle" onClick="save,action-operation-request-set-status-cancel,save"/>
|
||||
</panel>
|
||||
<panel name="machine" >
|
||||
<field name="machineName" title="Name" grid-view="machine-grid-qvm" form-view="machine-form-qvm" onChange="action-record-machine-operation-default" domain="self.typeSelect != 0" colSpan="6"/>
|
||||
<spacer colSpan="6" />
|
||||
<field name="machineId" title="Id" colSpan="4"/>
|
||||
<field name="machineBrand" title="Brand" colSpan="4"/>
|
||||
<field name="machineModel" title="Model" colSpan="4"/>
|
||||
<field name="machineSerialNumber" title="Serial Number" colSpan="4"/>
|
||||
<field name="machineLocation" title="Location" colSpan="4"/>
|
||||
<field name="machineLocationParent" title="Location Parent" colSpan="4"/>
|
||||
</panel>
|
||||
<panel>
|
||||
<field name="fullRange" title="Full Range"/>
|
||||
<field name="operationRange" title="Operation Range"/>
|
||||
<field name="leastCount" title="Least Count"/>
|
||||
<field name="operationFrequency" title="Operation Frequency"/>
|
||||
<field name="pastOperationDate" title="Past Operation Date"/>
|
||||
<field name="operationDate" title="Operation Date"/>
|
||||
<field name="operationDueDate" title="Operation Due Date"/>
|
||||
<field name="countdown" title="Countdown"/>
|
||||
<field name="reportCertifiacteNumber" title="Report / Certifiacte Number"/>
|
||||
<field name="externalInternal" title="Internal" onChange = "internal-external-validation-title-changer" widget="boolean-switch"/>
|
||||
</panel>
|
||||
<panel sidebar="true" title="Suivi" canCollapse="true" collapseIf="true">
|
||||
<field name="createdOn"/>
|
||||
<field name="createdBy"/>
|
||||
<field name="updatedOn"/>
|
||||
<field name="updatedBy"/>
|
||||
</panel>
|
||||
<panel-mail>
|
||||
<mail-messages limit="4" />
|
||||
<mail-followers />
|
||||
</panel-mail>
|
||||
</form>
|
||||
|
||||
<grid name="operation-grid" title="Operations" model="com.axelor.apps.qvm.db.QvmOperation" edit-icon="true">
|
||||
<hilite background="success" if="$moment(operationDueDate).diff(todayDate,'days') < 0"/>
|
||||
<hilite background="primary" if="$moment(operationDueDate).diff(todayDate,'days') == 0"/>
|
||||
<hilite background="danger" if="$moment(operationDueDate).diff(todayDate,'days') < 10 && $moment(operationDueDate).diff(todayDate,'days') > 0"/>
|
||||
<hilite background="warning" if="$moment(operationDueDate).diff(todayDate,'days') < 30 && $moment(operationDueDate).diff(todayDate,'days') > 10"/>
|
||||
<hilite background="info" if="$moment(operationDueDate).diff(todayDate,'days') < 40 && $moment(operationDueDate).diff(todayDate,'days') > 30"/>
|
||||
|
||||
<field name="serialNumber" title="Serial Number"/>
|
||||
<field name="statusSelect" title="Status">
|
||||
<hilite color="primary" if="statusSelect == 2"/>
|
||||
<hilite color="success" if="statusSelect == 3"/>
|
||||
<hilite color="warning" if="statusSelect == 4"/>
|
||||
<hilite color="danger" if="statusSelect == 5"/>
|
||||
</field>
|
||||
<field name="operationType" title="Operation Type"/>
|
||||
<field name="typeSelect" title="Type"/>
|
||||
<field name="purchaseRequest" title="Purchase Request"/>
|
||||
<field name="machineName" title="Name"/>
|
||||
<field name="machineId" title="Id"/>
|
||||
<field name="machineBrand" title="Brand"/>
|
||||
<field name="machineModel" title="Model"/>
|
||||
<field name="machineSerialNumber" title="Serial Number"/>
|
||||
<field name="machineLocation" title="Location"/>
|
||||
<field name="machineLocationParent" title="Location Parent"/>
|
||||
<field name="fullRange" title="Full Range"/>
|
||||
<field name="operationRange" title="Operation Range"/>
|
||||
<field name="leastCount" title="Least Count"/>
|
||||
<field name="operationFrequency" title="Operation Frequency"/>
|
||||
<field name="pastOperationDate" title="Past Operation Date"/>
|
||||
<field name="operationDate" title="Operation Date"/>
|
||||
<field name="operationDueDate" title="Operation Due Date"/>
|
||||
<field name="countdown" title="Countdown"/>
|
||||
<field name="reportCertifiacteNumber" title="Report / Certifiacte Number"/>
|
||||
<field name="externalInternal" title="Internal"/>
|
||||
</grid>
|
||||
|
||||
<!-- Calibration -->
|
||||
<form name="calibration-form" title="Calibrations" onNew="action-record-operation-default-record" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<toolbar>
|
||||
<button name="printBtn" title="Print" readonlyIf="!id" icon="fa-print" onClick="action-production-request-method-print"/>
|
||||
</toolbar>
|
||||
<panel name="statusSelectPanel" colSpan="12">
|
||||
<field name="statusSelect" title="Status" selection="operation.status.select" showTitle="false" readonly="true" colSpan="12" widget="nav-select"/>
|
||||
<field name="serialNumber" title="Serial Number" colSpan="12" readonly="true"/>
|
||||
<field name="operationType" domain="self.typeSelect = 2" title="Operation Type" grid-view="operation-type-grid" form-view="operation-type-form" onChange="action-record-operation-default-type-record"/>
|
||||
<field name="purchaseRequest" title="Purchase Request" grid-view="purchase-request-grid" form-view="purchase-request-form" domain="self.familleProduit = 149 and self.statusSelect != 7 and self.statusSelect != 8"/>
|
||||
</panel>
|
||||
<panel name="detailPanel" sidebar="true">
|
||||
<button name="draftBtn" title="Draft" showIf="statusSelect == 5" css="btn-info" icon="fa-edit" onClick="save,action-operation-request-set-status-draft, save"/>
|
||||
<button name="requestBtn" title="Request" showIf="statusSelect == 1" icon="fa-bullhorn" onClick="action-operation-set-seq-group,action-operation-request-set-status-request,save"/>
|
||||
<button name="acceptBtn" title="Accept" showIf="statusSelect == 2" icon="fa-check" css="btn-success" onClick="save,action-operation-request-set-status-accept,save"/>
|
||||
<button name="refuseBtn" title="Refuse" showIf="statusSelect == 2 " css="btn-warning" icon="fa-times" onClick="save,action-operation-request-set-status-refuse,save"/>
|
||||
<button name="cancelBtn" title="Cancel" showIf="statusSelect == 1 || statusSelect == 2 || statusSelect == 3 || statusSelect == 4" css="btn-danger" icon="fa-times-circle" onClick="save,action-operation-request-set-status-cancel,save"/>
|
||||
</panel>
|
||||
<panel name="machine" >
|
||||
<field name="machineName" title="Name" grid-view="machine-grid-qvm" form-view="machine-form-qvm" onChange="action-record-machine-operation-default" domain="self.typeSelect != 0" colSpan="6"/>
|
||||
<spacer colSpan="6" />
|
||||
<field name="machineId" title="Id" colSpan="4"/>
|
||||
<field name="machineBrand" title="Brand" colSpan="4"/>
|
||||
<field name="machineModel" title="Model" colSpan="4"/>
|
||||
<field name="machineSerialNumber" title="Serial Number" colSpan="4"/>
|
||||
<field name="machineLocation" title="Location" colSpan="4"/>
|
||||
<field name="machineLocationParent" title="Location Parent" colSpan="4"/>
|
||||
</panel>
|
||||
<panel>
|
||||
<field name="fullRange" title="Full Range"/>
|
||||
<field name="operationRange" title="Calibration Range"/>
|
||||
<field name="leastCount" title="Least Count"/>
|
||||
<field name="operationFrequency" title="Calibration Frequency"/>
|
||||
<field name="pastOperationDate" title="Past Calibration Date"/>
|
||||
<field name="operationDate" title="Calibration Date"/>
|
||||
<field name="operationDueDate" title="Calibration Due Date"/>
|
||||
<field name="countdown" title="Countdown"/>
|
||||
<field name="reportCertifiacteNumber" title="Report / Certifiacte Number"/>
|
||||
<field name="externalInternal" title="Internal" onChange = "internal-external-validation-title-changer" widget="boolean-switch"/>
|
||||
</panel>
|
||||
<panel sidebar="true" title="Suivi" canCollapse="true" collapseIf="true">
|
||||
<field name="createdOn"/>
|
||||
<field name="createdBy"/>
|
||||
<field name="updatedOn"/>
|
||||
<field name="updatedBy"/>
|
||||
</panel>
|
||||
<panel-mail>
|
||||
<mail-messages limit="4" />
|
||||
<mail-followers />
|
||||
</panel-mail>
|
||||
</form>
|
||||
|
||||
<grid name="calibration-grid" title="Calibrations" model="com.axelor.apps.qvm.db.QvmOperation" edit-icon="true">
|
||||
<hilite background="success" if="$moment(operationDueDate).diff(todayDate,'days') < 0"/>
|
||||
<hilite background="primary" if="$moment(operationDueDate).diff(todayDate,'days') == 0"/>
|
||||
<hilite background="danger" if="$moment(operationDueDate).diff(todayDate,'days') < 10 && $moment(operationDueDate).diff(todayDate,'days') > 0"/>
|
||||
<hilite background="warning" if="$moment(operationDueDate).diff(todayDate,'days') < 30 && $moment(operationDueDate).diff(todayDate,'days') > 10"/>
|
||||
<hilite background="info" if="$moment(operationDueDate).diff(todayDate,'days') < 40 && $moment(operationDueDate).diff(todayDate,'days') > 30"/>
|
||||
|
||||
<field name="serialNumber" title="Serial Number"/>
|
||||
<field name="statusSelect" title="Status">
|
||||
<hilite color="primary" if="statusSelect == 2"/>
|
||||
<hilite color="success" if="statusSelect == 3"/>
|
||||
<hilite color="warning" if="statusSelect == 4"/>
|
||||
<hilite color="danger" if="statusSelect == 5"/>
|
||||
</field>
|
||||
<field name="operationType" title="Calibration Type"/>
|
||||
<field name="typeSelect" title="Type"/>
|
||||
<field name="purchaseRequest" title="Purchase Request"/>
|
||||
<field name="machineName" title="Name"/>
|
||||
<field name="machineId" title="Id"/>
|
||||
<field name="machineBrand" title="Brand"/>
|
||||
<field name="machineModel" title="Model"/>
|
||||
<field name="machineSerialNumber" title="Serial Number"/>
|
||||
<field name="machineLocation" title="Location"/>
|
||||
<field name="machineLocationParent" title="Location Parent"/>
|
||||
<field name="fullRange" title="Full Range"/>
|
||||
<field name="operationRange" title="Calibration Range"/>
|
||||
<field name="leastCount" title="Least Count"/>
|
||||
<field name="operationFrequency" title="Calibration Frequency"/>
|
||||
<field name="pastOperationDate" title="Past Calibration Date"/>
|
||||
<field name="operationDate" title="Calibration Date"/>
|
||||
<field name="operationDueDate" title="Calibration Due Date"/>
|
||||
<field name="countdown" title="Countdown"/>
|
||||
<field name="reportCertifiacteNumber" title="Report / Certifiacte Number"/>
|
||||
<field name="externalInternal" title="Internal"/>
|
||||
</grid>
|
||||
|
||||
<!-- Qualification -->
|
||||
<form name="qualification-form" title="Qualifications" onNew="action-record-operation-default-record" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<toolbar>
|
||||
<button name="printBtn" title="Print" readonlyIf="!id" icon="fa-print" onClick="action-production-request-method-print"/>
|
||||
</toolbar>
|
||||
<panel name="statusSelectPanel" colSpan="12">
|
||||
<field name="statusSelect" title="Status" selection="operation.status.select" showTitle="false" readonly="true" colSpan="12" widget="nav-select"/>
|
||||
<field name="serialNumber" title="Serial Number" colSpan="12" readonly="true"/>
|
||||
<field name="operationType" domain="self.typeSelect = 2" title="Operation Type" grid-view="operation-type-grid" form-view="operation-type-form" onChange="action-record-operation-default-type-record"/>
|
||||
<field name="purchaseRequest" title="Purchase Request" grid-view="purchase-request-grid" form-view="purchase-request-form" domain="self.familleProduit = 149 and self.statusSelect != 7 and self.statusSelect != 8"/>
|
||||
</panel>
|
||||
<panel name="detailPanel" sidebar="true">
|
||||
<button name="draftBtn" title="Draft" showIf="statusSelect == 5" css="btn-info" icon="fa-edit" onClick="save,action-operation-request-set-status-draft, save"/>
|
||||
<button name="requestBtn" title="Request" showIf="statusSelect == 1" icon="fa-bullhorn" onClick="action-operation-set-seq-group,action-operation-request-set-status-request,save"/>
|
||||
<button name="acceptBtn" title="Accept" showIf="statusSelect == 2" icon="fa-check" css="btn-success" onClick="save,action-operation-request-set-status-accept,save"/>
|
||||
<button name="refuseBtn" title="Refuse" showIf="statusSelect == 2 " css="btn-warning" icon="fa-times" onClick="save,action-operation-request-set-status-refuse,save"/>
|
||||
<button name="cancelBtn" title="Cancel" showIf="statusSelect == 1 || statusSelect == 2 || statusSelect == 3 || statusSelect == 4" css="btn-danger" icon="fa-times-circle" onClick="save,action-operation-request-set-status-cancel,save"/>
|
||||
</panel>
|
||||
<panel name="machine" >
|
||||
<field name="machineName" title="Name" grid-view="machine-grid-qvm" form-view="machine-form-qvm" onChange="action-record-machine-operation-default" domain="self.typeSelect != 0" colSpan="6"/>
|
||||
<spacer colSpan="6" />
|
||||
<field name="machineId" title="Id" colSpan="4"/>
|
||||
<field name="machineBrand" title="Brand" colSpan="4"/>
|
||||
<field name="machineModel" title="Model" colSpan="4"/>
|
||||
<field name="machineSerialNumber" title="Serial Number" colSpan="4"/>
|
||||
<field name="machineLocation" title="Location" colSpan="4"/>
|
||||
<field name="machineLocationParent" title="Location Parent" colSpan="4"/>
|
||||
</panel>
|
||||
<panel>
|
||||
<field name="fullRange" title="Full Range"/>
|
||||
<field name="operationRange" title="Qualification Range"/>
|
||||
<field name="leastCount" title="Least Count"/>
|
||||
<field name="operationFrequency" title="Qualification Frequency"/>
|
||||
<field name="pastOperationDate" title="Past Qualification Date"/>
|
||||
<field name="operationDate" title="Qualification Date"/>
|
||||
<field name="operationDueDate" title="Qualification Due Date"/>
|
||||
<field name="countdown" title="Countdown"/>
|
||||
<field name="reportCertifiacteNumber" title="Report / Certifiacte Number"/>
|
||||
<field name="externalInternal" title="Internal" onChange = "internal-external-validation-title-changer" widget="boolean-switch"/>
|
||||
</panel>
|
||||
<panel sidebar="true" title="Suivi" canCollapse="true" collapseIf="true">
|
||||
<field name="createdOn"/>
|
||||
<field name="createdBy"/>
|
||||
<field name="updatedOn"/>
|
||||
<field name="updatedBy"/>
|
||||
</panel>
|
||||
<panel-mail>
|
||||
<mail-messages limit="4" />
|
||||
<mail-followers />
|
||||
</panel-mail>
|
||||
</form>
|
||||
|
||||
<grid name="qualification-grid" title="Qualifications" model="com.axelor.apps.qvm.db.QvmOperation" edit-icon="true">
|
||||
<hilite background="success" if="$moment(operationDueDate).diff(todayDate,'days') < 0"/>
|
||||
<hilite background="primary" if="$moment(operationDueDate).diff(todayDate,'days') == 0"/>
|
||||
<hilite background="danger" if="$moment(operationDueDate).diff(todayDate,'days') < 10 && $moment(operationDueDate).diff(todayDate,'days') > 0"/>
|
||||
<hilite background="warning" if="$moment(operationDueDate).diff(todayDate,'days') < 30 && $moment(operationDueDate).diff(todayDate,'days') > 10"/>
|
||||
<hilite background="info" if="$moment(operationDueDate).diff(todayDate,'days') < 40 && $moment(operationDueDate).diff(todayDate,'days') > 30"/>
|
||||
|
||||
<field name="serialNumber" title="Serial Number"/>
|
||||
<field name="statusSelect" title="Status">
|
||||
<hilite color="primary" if="statusSelect == 2"/>
|
||||
<hilite color="success" if="statusSelect == 3"/>
|
||||
<hilite color="warning" if="statusSelect == 4"/>
|
||||
<hilite color="danger" if="statusSelect == 5"/>
|
||||
</field>
|
||||
<field name="operationType" title="Qualification Type"/>
|
||||
<field name="typeSelect" title="Type"/>
|
||||
<field name="purchaseRequest" title="Purchase Request"/>
|
||||
<field name="machineName" title="Name"/>
|
||||
<field name="machineId" title="Id"/>
|
||||
<field name="machineBrand" title="Brand"/>
|
||||
<field name="machineModel" title="Model"/>
|
||||
<field name="machineSerialNumber" title="Serial Number"/>
|
||||
<field name="machineLocation" title="Location"/>
|
||||
<field name="machineLocationParent" title="Location Parent"/>
|
||||
<field name="fullRange" title="Full Range"/>
|
||||
<field name="operationRange" title="Qualification Range"/>
|
||||
<field name="leastCount" title="Least Count"/>
|
||||
<field name="operationFrequency" title="Qualification Frequency"/>
|
||||
<field name="pastOperationDate" title="Past Qualification Date"/>
|
||||
<field name="operationDate" title="Qualification Date"/>
|
||||
<field name="operationDueDate" title="Qualification Due Date"/>
|
||||
<field name="countdown" title="Countdown"/>
|
||||
<field name="reportCertifiacteNumber" title="Report / Certifiacte Number"/>
|
||||
<field name="externalInternal" title="Internal"/>
|
||||
</grid>
|
||||
|
||||
<!-- Actions -->
|
||||
<action-record name="action-record-machine-operation-default" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<field name="machineId" expr="eval:machineName.machineId" if="machineName != null"/>
|
||||
<field name="machineBrand" expr="eval:machineName.brand" if="machineName != null"/>
|
||||
<field name="machineModel" expr="eval:machineName.model" if="machineName != null"/>
|
||||
<field name="machineSerialNumber" expr="eval:machineName.serialNumber" if="machineName != null"/>
|
||||
<field name="machineLocation" expr="eval:machineName.machineLocation" if="machineName != null"/>
|
||||
<field name="machineLocationParent" expr="eval:machineName.machineLocation.parent" if="machineName != null"/>
|
||||
<field name="stockUnity" expr="eval:machineName.machineLocation.parent.stockUnity" if="machineName != null"/>
|
||||
</action-record>
|
||||
|
||||
<action-record name="action-record-operation-default-record" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<field name="company" expr="eval:__user__.activeCompany" if="__user__.activeCompany != null"/>
|
||||
<field name="company" expr="eval:__repo__(Company).all().fetchOne()" if="__user__.activeCompany == null && __repo__(Company).all().fetch().size == 1"/>
|
||||
</action-record>
|
||||
|
||||
<action-record name="action-operation-request-set-status-accept" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<field name="statusSelect" expr="eval:3"/>
|
||||
</action-record>
|
||||
<action-record name="action-operation-request-set-status-cancel" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<field name="statusSelect" expr="eval:5"/>
|
||||
</action-record>
|
||||
<action-record name="action-operation-request-set-status-draft" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<field name="statusSelect" expr="eval:1"/>
|
||||
</action-record>
|
||||
<action-record name="action-operation-request-set-status-refuse" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<field name="statusSelect" expr="eval:4"/>
|
||||
</action-record>
|
||||
<action-record name="action-operation-request-set-status-request" model="com.axelor.apps.qvm.db.QvmOperation">
|
||||
<field name="statusSelect" expr="eval:2"/>
|
||||
</action-record>
|
||||
|
||||
<action-attrs name="internal-external-operation-title-changer">
|
||||
<attribute if="externalInternal == false" name="title" expr="External :" for="externalInternal"/>
|
||||
<attribute if="externalInternal == true" name="title" expr="Internal :" for="externalInternal"/>
|
||||
</action-attrs>
|
||||
|
||||
<action-view name="operation.action.view" model="com.axelor.apps.qvm.db.QvmOperation" title="Operations">
|
||||
<view name="operation-grid" type="grid"/>
|
||||
<view name="operation-kanban-view" type="kanban"/>
|
||||
<view name="operation-form" type="form"/>
|
||||
</action-view>
|
||||
|
||||
<action-view name="operation.operation.action.view" model="com.axelor.apps.qvm.db.QvmOperation" title="Calibrations">
|
||||
<view name="operation-grid" type="grid"/>
|
||||
<view name="operation-kanban-view" type="kanban"/>
|
||||
<view name="operation-form" type="form"/>
|
||||
<domain>self.typeSelect = :_ts</domain>
|
||||
<context name="_ts" expr="eval: 1"/>
|
||||
</action-view>
|
||||
|
||||
<action-view name="qualification.operation.action.view" model="com.axelor.apps.qvm.db.QvmOperation" title="Qualifications">
|
||||
<view name="operation-grid" type="grid"/>
|
||||
<view name="operation-kanban-view" type="kanban"/>
|
||||
<view name="operation-form" type="form"/>
|
||||
<domain>self.typeSelect = :_ts</domain>
|
||||
<context name="_ts" expr="eval: 2"/>
|
||||
</action-view>
|
||||
|
||||
<action-view name="operation.action.view.related" model="com.axelor.apps.qvm.db.QvmOperation" title="Operations">
|
||||
<view name="operation-grid" type="grid"/>
|
||||
<view name="operation-form" type="form"/>
|
||||
<domain>self.operationType = :_id</domain>
|
||||
<context name="_id" expr="eval: id"/>
|
||||
</action-view>
|
||||
|
||||
<action-group name="action-operation-set-seq-group">
|
||||
<action name="action-calibration-set-seq"/>
|
||||
<action name="action-qualification-set-seq"/>
|
||||
<action name="action-operation-set-seq"/>
|
||||
</action-group>
|
||||
|
||||
<action-method name="action-calibration-set-seq">
|
||||
<!--<call method="setSequence" class="com.axelor.apps.qvm.web.CalibrationController"/>-->
|
||||
<call if="typeSelect == 1" method="setSequenceCalibration" class="com.axelor.qvm.web.OperationController"/>
|
||||
</action-method>
|
||||
|
||||
<action-method name="action-qualification-set-seq">
|
||||
<call if="typeSelect == 2" method="setSequenceQualification" class="com.axelor.qvm.web.OperationController"/>
|
||||
</action-method>
|
||||
|
||||
<action-method name="action-operation-set-seq">
|
||||
<call if="typeSelect == 3" method="setSequenceOperation" class="com.axelor.qvm.web.OperationController"/>
|
||||
</action-method>
|
||||
|
||||
</object-views>
|
||||
@ -0,0 +1,33 @@
|
||||
<?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">
|
||||
|
||||
<form name="operation-type-form" title="Operations Type" model="com.axelor.apps.qvm.db.QvmOperationType" width="large">
|
||||
<panel name="Overview" colspan="12">
|
||||
<field name="name"/>
|
||||
<field name="stockUnity"/>
|
||||
</panel>
|
||||
<panel-dashlet name="operationList" title="Operations" action="operation.action.view.related" colSpan="12"/>
|
||||
</form>
|
||||
|
||||
<grid name="operation-type-grid" title="Operations types" model="com.axelor.apps.qvm.db.QvmOperationType" edit-icon="true">
|
||||
<field name="name"/>
|
||||
<field name="stockUnity"/>
|
||||
</grid>
|
||||
|
||||
<kanban name="operation-type-kanban-view" title="Operations Type" model="com.axelor.apps.qvm.db.QvmOperationType" columnBy="stockUnity" sequenceBy="stockUnity" draggable="false" limit="30">
|
||||
<field name="name"/>
|
||||
<field name="stockUnity"/>
|
||||
<template><![CDATA[
|
||||
<h4>{{name}}</h4>]]>
|
||||
</template>
|
||||
</kanban>
|
||||
|
||||
<action-view name="operation.type.action.view" model="com.axelor.apps.qvm.db.QvmOperationType" title="Operations Type">
|
||||
<view name="operation-type-grid" type="grid"/>
|
||||
<view name="operation-type-kanban-view" type="kanban"/>
|
||||
<view name="operation-type-form" type="form"/>
|
||||
</action-view>
|
||||
|
||||
</object-views>
|
||||
@ -0,0 +1,45 @@
|
||||
<?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">
|
||||
|
||||
|
||||
<selection name="operation.status.select">
|
||||
<option value="1">Draft</option>
|
||||
<option value="2">Requested</option>
|
||||
<option value="3">Accepted</option>
|
||||
<option value="4">Refused</option>
|
||||
<option value="5">Canceled</option>
|
||||
</selection>
|
||||
|
||||
<selection name="operation.type.status.select">
|
||||
<option value="1">Calibration</option>
|
||||
<option value="2">Qualification</option>
|
||||
<option value="3">Other</option>
|
||||
</selection>
|
||||
|
||||
<selection name="operation.parent.location.select">
|
||||
<option value="1">U1</option>
|
||||
<option value="2">U2</option>
|
||||
<option value="3">U3.1</option>
|
||||
<option value="4">U3.2</option>
|
||||
<option value="5">U4</option>
|
||||
<option value="6">U5</option>
|
||||
<option value="7">U6</option>
|
||||
<option value="8">QC 1</option>
|
||||
<option value="9">QC 2</option>
|
||||
<option value="10">QVM</option>
|
||||
<option value="11">OSD</option>
|
||||
</selection>
|
||||
|
||||
<selection name="operation.machine.type.status.select">
|
||||
<option value="1">Equipement</option>
|
||||
<option value="2">Instrument</option>
|
||||
</selection>
|
||||
|
||||
<selection name="operation.creation.type.select">
|
||||
<option value="1">Created</option>
|
||||
<option value="2">Generated</option>
|
||||
</selection>
|
||||
|
||||
</object-views>
|
||||
Reference in New Issue
Block a user