First commit waiting for Budget Alert

This commit is contained in:
2025-09-04 13:37:35 +01:00
commit 2d681f27f5
4563 changed files with 1061534 additions and 0 deletions

View File

@ -0,0 +1,285 @@
/*
* 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.exception;
import com.axelor.db.EntityHelper;
import com.axelor.db.Model;
/** Exception specific to Axelor. */
public class AxelorException extends Exception {
private static final long serialVersionUID = 1028105628735355226L;
private final int category;
private final Class<? extends Model> refClass;
private final Long refId;
/** Default constructor */
@Deprecated
public AxelorException() {
this.refClass = null;
this.refId = 0L;
this.category = 0;
}
/**
* Create an exception with his message and his type.
*
* @param message The exception message
* @param category
* <ul>
* <li>1: Missing field
* <li>2: No unique key
* <li>3: No value
* <li>4: configuration error
* <li>5: CATEGORY_INCONSISTENCY
* </ul>
*/
@Deprecated
public AxelorException(String message, int category, Object... messageArgs) {
this(category, String.format(message, messageArgs));
}
/**
* Create an exception with a category and a message.
*
* @param category
* @param message
* @param messageArgs
*/
public AxelorException(int category, String message, Object... messageArgs) {
this(category, String.format(message, messageArgs));
}
public AxelorException(int category, String message) {
super(message);
this.refClass = null;
this.refId = 0L;
this.category = category;
}
/**
* Create an exception with his cause and his type.
*
* @param cause The exception cause
* @param category
* <ul>
* <li>1: Missing field
* <li>2: No unique key
* <li>3: No value
* <li>4: configuration error
* <li>5: CATEGORY_INCONSISTENCY
* </ul>
*
* @see Throwable
*/
public AxelorException(Throwable cause, int category) {
super(cause);
this.refClass = null;
this.refId = 0L;
this.category = category;
}
/**
* Create an exception with his message, his cause and his type.
*
* @param message The exception message
* @param cause The exception cause
* @param category The exception category
* <ul>
* <li>1: Missing field
* <li>2: No unique key
* <li>3: No value
* <li>4: configuration error
* <li>5: CATEGORY_INCONSISTENCY
* </ul>
*
* @see Throwable
*/
@Deprecated
public AxelorException(String message, Throwable cause, int category, Object... messageArgs) {
this(cause, category, String.format(message, messageArgs));
}
/**
* Create an exception with a cause, a category, and a message.
*
* @param cause
* @param category
* @param message
* @param messageArgs
*/
public AxelorException(Throwable cause, int category, String message, Object... messageArgs) {
this(cause, category, String.format(message, messageArgs));
}
public AxelorException(Throwable cause, int category, String message) {
super(message, cause);
this.refClass = null;
this.refId = 0L;
this.category = category;
}
/**
* Create an exception with a reference class, a category, and a message.
*
* @param refClass
* @param category
* @param message
* @param messageArgs
*/
public AxelorException(
Class<? extends Model> refClass, int category, String message, Object... messageArgs) {
this(refClass, category, String.format(message, messageArgs));
}
public AxelorException(Class<? extends Model> refClass, int category, String message) {
super(message);
this.refClass = refClass;
this.refId = 0L;
this.category = category;
}
/**
* Create an exception with a cause, a reference class, and a category.
*
* @param cause
* @param refClass
* @param category
*/
public AxelorException(Throwable cause, Class<? extends Model> refClass, int category) {
super(cause);
this.refClass = refClass;
this.refId = 0L;
this.category = category;
}
/**
* Create an exception with a cause, a reference class, a category, and a message.
*
* @param cause
* @param refClass
* @param category
* @param message
* @param messageArgs
*/
public AxelorException(
Throwable cause,
Class<? extends Model> refClass,
int category,
String message,
Object... messageArgs) {
this(cause, refClass, category, String.format(message, messageArgs));
}
public AxelorException(
Throwable cause, Class<? extends Model> refClass, int category, String message) {
super(message, cause);
this.refClass = refClass;
this.refId = 0L;
this.category = category;
}
/**
* Create an exception with a reference, a category, and a message.
*
* @param ref
* @param category
* @param message
* @param messageArgs
*/
public AxelorException(Model ref, int category, String message, Object... messageArgs) {
this(ref, category, String.format(message, messageArgs));
}
public AxelorException(Model ref, int category, String message) {
super(message);
this.refClass = EntityHelper.getEntityClass(ref);
this.refId = ref.getId();
this.category = category;
}
/**
* Create an exception with a cause, a reference, and a category.
*
* @param cause
* @param ref
* @param category
*/
public AxelorException(Throwable cause, Model ref, int category) {
super(cause);
this.refClass = EntityHelper.getEntityClass(ref);
this.refId = ref.getId();
this.category = category;
}
/**
* Create an exception with a cause, a reference, a category, and a message.
*
* @param cause
* @param ref
* @param category
* @param message
* @param messageArgs
*/
public AxelorException(
Throwable cause, Model ref, int category, String message, Object... messageArgs) {
this(cause, ref, category, String.format(message, messageArgs));
}
public AxelorException(Throwable cause, Model ref, int category, String message) {
super(message, cause);
this.refClass = EntityHelper.getEntityClass(ref);
this.refId = ref.getId();
this.category = category;
}
/**
* Get the category of exception
*
* @return
* <ul>
* <li>1: Missing field
* <li>2: No unique key
* <li>3: No value
* <li>4: configuration error
* <li>5: CATEGORY_INCONSISTENCY
* </ul>
*/
public int getCategory() {
return category;
}
/**
* Get reference class.
*
* @return
*/
public Class<? extends Model> getRefClass() {
return refClass;
}
/**
* Get reference ID.
*
* @return
*/
public Long getRefId() {
return refId;
}
}

View File

@ -0,0 +1,38 @@
/*
* 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.exception;
import com.axelor.rpc.ActionResponse;
import java.util.function.BiConsumer;
public enum ResponseMessageType {
INFORMATION(ActionResponse::setFlash),
WARNING(ActionResponse::setAlert),
ERROR(ActionResponse::setError),
NOTIFICATION(ActionResponse::setNotify);
private BiConsumer<ActionResponse, String> messageMethod;
ResponseMessageType(BiConsumer<ActionResponse, String> messageMethod) {
this.messageMethod = messageMethod;
}
public void setMessage(ActionResponse response, String message) {
messageMethod.accept(response, message);
}
}

View File

@ -0,0 +1,241 @@
/*
* 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.exception.service;
import com.axelor.auth.AuthUtils;
import com.axelor.db.JPA;
import com.axelor.exception.AxelorException;
import com.axelor.exception.ResponseMessageType;
import com.axelor.exception.db.TraceBack;
import com.axelor.exception.db.repo.TraceBackRepository;
import com.axelor.inject.Beans;
import com.axelor.rpc.ActionResponse;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.invoke.MethodHandles;
import java.time.ZonedDateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Classe implémentant l'ensemble des services pouvant être utiles dans la gestion des exceptions
* Axelor.
*/
public class TraceBackService {
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
// TYPE SELECT
protected static final int TYPE_TECHNICAL = 0;
protected static final int TYPE_FUNCTIONAL = 1;
/**
* Créer un log des exceptions en tant qu'anomalie.
*
* @param e L'exception générée.
* @param categorySelect <code>0 = Champ manquant</code> <code>1 = Clef non unique</code> <code>
* 2 = Aucune valeur retournée</code> <code>3 = Problème de configuration</code>
*/
private static TraceBack _create(
Throwable e, String origin, int typeSelect, int categorySelect, long batchId) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
TraceBack traceBack = new TraceBack();
traceBack.setException(e.toString());
traceBack.setDate(ZonedDateTime.now());
traceBack.setError(
e.getStackTrace() != null && e.getStackTrace().length > 0
? e.getStackTrace()[0].toString()
: e.getMessage());
traceBack.setOrigin(origin);
traceBack.setTypeSelect(typeSelect);
traceBack.setCategorySelect(categorySelect);
traceBack.setBatchId(batchId);
if (AuthUtils.getSubject() != null) {
traceBack.setInternalUser(AuthUtils.getUser());
}
if (e.getCause() != null) {
traceBack.setCause(e.getCause().toString());
}
if (e.getMessage() != null) {
traceBack.setMessage(e.getMessage());
}
traceBack.setTrace(sw.toString());
Beans.get(TraceBackRepository.class).persist(traceBack);
return traceBack;
}
private static TraceBack _create(Throwable e, String origin, int categorySelect, long batchId) {
return _create(e, origin, TYPE_TECHNICAL, categorySelect, batchId);
}
private static TraceBack _create(AxelorException e, String origin, long batchId) {
TraceBack traceBack = _create(e, origin, TYPE_FUNCTIONAL, e.getCategory(), batchId);
if (e.getRefClass() != null) {
traceBack.setRef(e.getRefClass().getName());
traceBack.setRefId(e.getRefId());
}
return traceBack;
}
/**
* Affiche à l'écran par l'intermédiaire d'une popup le message d'une exception.
*
* @param response
* @param e L'exception cible.
*/
private static void _response(
ActionResponse response, Throwable e, ResponseMessageType responseMessageType) {
String message = e.getMessage() != null ? e.getMessage() : e.toString();
responseMessageType.setMessage(response, message);
}
/**
* Tracer une exception dans Traceback correspondant à un bug.
*
* @param e L'exception cible.
*/
public static void trace(final Throwable e, final String origin) {
JPA.runInTransaction(
() -> {
if (e instanceof AxelorException) {
LOG.trace(_create((AxelorException) e, origin, 0).getTrace());
} else {
LOG.error(_create(e, origin, 0, 0).getTrace());
}
});
}
/**
* Tracer une exception dans Traceback correspondant à un bug.
*
* @param e L'exception cible.
*/
public static void trace(final AxelorException e, final String origin, final long batchId) {
JPA.runInTransaction(() -> LOG.trace(_create(e, origin, batchId).getTrace()));
}
/**
* Tracer une exception dans Traceback correspondant à un bug.
*
* @param e L'exception cible.
*/
public static void trace(final Throwable e, final String origin, final long batchId) {
JPA.runInTransaction(() -> LOG.error(_create(e, origin, 0, batchId).getTrace()));
}
/**
* Tracer une exception dans Traceback correspondant à un bug.
*
* @param e L'exception cible.
*/
public static void trace(Throwable e) {
trace(e, null);
}
/**
* Tracer une exception dans Traceback correspondant à une anomalie.
*
* @param e L'exception cible.
* @param categorySelect <code>0 = Champ manquant</code> <code>1 = Clef non unique</code> <code>
* 2 = Aucune valeur retournée</code> <code>3 = Problème de configuration</code>
*/
public static void trace(AxelorException e) {
trace(e, null);
}
/**
* Tracer une exception dans Traceback correspondant à un bug et affiche à l'écran par
* l'intermédiaire d'une popup le message de l'exception.
*
* @param response
* @param e L'exception cible.
*/
public static void trace(ActionResponse response, Throwable e, String origin) {
trace(e, origin);
_response(response, e, ResponseMessageType.INFORMATION);
}
/**
* Tracer une exception dans Traceback correspondant à un bug et affiche à l'écran par
* l'intermédiaire d'une popup le message de l'exception.
*
* @param response
* @param e L'exception cible.
*/
public static void trace(ActionResponse response, Throwable e) {
trace(response, e, (String) null);
}
/**
* Trace an exception into the traceback and show it to the client with the specified response
* message type.
*
* @param response
* @param e
* @param origin
* @param responseMessageType
*/
public static void trace(
ActionResponse response,
Throwable e,
String origin,
ResponseMessageType responseMessageType) {
trace(e, origin);
_response(response, e, responseMessageType);
}
/**
* Trace an exception into the traceback and show it to the client with the specified response
* message type.
*
* @param response
* @param e
* @param responseMessageType
*/
public static void trace(
ActionResponse response, Throwable e, ResponseMessageType responseMessageType) {
trace(response, e, null, responseMessageType);
}
/** @return "Axelor Exception" */
public String toString() {
return "Axelor Exception";
}
}

View File

@ -0,0 +1,69 @@
/*
* 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.exception.web;
import com.axelor.common.Inflector;
import com.axelor.db.JPA;
import com.axelor.exception.db.TraceBack;
import com.axelor.i18n.I18n;
import com.axelor.meta.schema.actions.ActionView;
import com.axelor.meta.schema.actions.ActionView.ActionViewBuilder;
import com.axelor.rpc.ActionRequest;
import com.axelor.rpc.ActionResponse;
import com.google.common.base.Strings;
import com.google.inject.Singleton;
import java.lang.invoke.MethodHandles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Singleton
public class TraceBackController {
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
/**
* Show reference view.
*
* @param request
* @param response
*/
public void showReference(ActionRequest request, ActionResponse response) {
TraceBack traceBack = request.getContext().asType(TraceBack.class);
if (Strings.isNullOrEmpty(traceBack.getRef())) {
return;
}
Class<?> modelClass = JPA.model(traceBack.getRef());
final Inflector inflector = Inflector.getInstance();
String viewName = inflector.dasherize(modelClass.getSimpleName());
LOG.debug("Showing anomaly reference ::: {}", viewName);
ActionViewBuilder actionViewBuilder = ActionView.define(I18n.get("Reference"));
actionViewBuilder.model(traceBack.getRef());
if (traceBack.getRefId() != null) {
actionViewBuilder.context("_showRecord", traceBack.getRefId());
} else {
actionViewBuilder.add("grid", String.format("%s-grid", viewName));
}
actionViewBuilder.add("form", String.format("%s-form", viewName));
response.setView(actionViewBuilder.map());
}
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<csv-inputs xmlns="http://axelor.com/xml/ns/data-import"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://axelor.com/xml/ns/data-import http://axelor.com/xml/ns/data-import/data-import_5.2.xsd">
<input file="auth_role.csv" separator=";" type="com.axelor.auth.db.Role" search="self.name = :name"/>
<input file="auth_permission.csv" separator=";" type="com.axelor.auth.db.Permission" search="self.name = :name" call="com.axelor.csv.script.ImportPermission:importPermissionToRole">
<bind to="canRead" eval="can_read == 'x' ? 'true' : 'false'"/>
<bind to="canWrite" eval="can_write == 'x' ? 'true' : 'false'"/>
<bind to="canCreate" eval="can_create == 'x' ? 'true' : 'false'"/>
<bind to="canRemove" eval="can_remove == 'x' ? 'true' : 'false'"/>
<bind to="canExport" eval="can_export == 'x' ? 'true' : 'false'"/>
</input>
</csv-inputs>

View File

@ -0,0 +1,2 @@
"name";"object";"can_read";"can_write";"can_create";"can_remove";"can_export";"condition";"conditionParams";"roleName"
"perm.exception.all";"com.axelor.exception.db.*";"x";"x";"x";"x";"x";;;"Admin"
1 name object can_read can_write can_create can_remove can_export condition conditionParams roleName
2 perm.exception.all com.axelor.exception.db.* x x x x x Admin

View File

@ -0,0 +1,2 @@
"name";"description"
"Admin";
1 name description
2 Admin

View File

@ -0,0 +1,16 @@
<?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="exception" package="com.axelor.exception.db"/>
<entity name="ExceptionOrigin" lang="java">
<extra-code>
<![CDATA[
/**Origin select*/
]]>
</extra-code>
</entity>
</domain-models>

View File

@ -0,0 +1,56 @@
<?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="exception" package="com.axelor.exception.db"/>
<entity sequential="true" name="TraceBack" lang="java">
<string title="Anomaly" name="exception" required="true" large="true"/>
<integer title="Type" name="typeSelect" selection="trace.back.type.select"/>
<integer title="Category" name="categorySelect" selection="trace.back.category.select"/>
<string name="origin" selection="trace.back.origin.select" title="Origin" />
<datetime title="Date" tz="true" name="date" required="true" column="date_val"/>
<many-to-one ref="com.axelor.auth.db.User" title="User" name="internalUser"/>
<string title="Error" name="error" large="true"/>
<string title="Cause" name="cause" large="true"/>
<string title="Message" name="message" large="true"/>
<string title="Trace" name="trace" large="true"/>
<long name="batchId" title="Batch" />
<string name="ref" title="Reference" />
<long name="refId" title="Reference ID" nullable="true" />
<string search="id,date" name="name" namecolumn="true">
return this.id + " : " + this.date;
</string>
<extra-code><![CDATA[
// TYPE SELECT
/**
* @deprecated With current implementation of TraceBackService, all exceptions of type
* AxelorException are flagged as functional exceptions. However there are many cases of
* misuses of AxelorException due to confusion between TYPE and CATEGORY.
*/
@Deprecated
public static final int TYPE_TECHNICAL = 0;
/**
* @deprecated With current implementation of TraceBackService, all exceptions of type
* AxelorException are flagged as functional exceptions. However there are many cases of
* misuses of AxelorException due to confusion between TYPE and CATEGORY.
*/
@Deprecated
public static final int TYPE_FUNCTIONNAL = 1;
// CATEGORY SELECT
public static final int CATEGORY_MISSING_FIELD = 1;
public static final int CATEGORY_NO_UNIQUE_KEY = 2;
public static final int CATEGORY_NO_VALUE = 3;
public static final int CATEGORY_CONFIGURATION_ERROR = 4;
public static final int CATEGORY_INCONSISTENCY = 5;
]]></extra-code>
</entity>
</domain-models>

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly",,,
"Batch",,,
"CRM",,,
"Category",,,
"Cause",,,
"Configuration problem",,,
"Date",,,
"Debt recovery",,,
"Direct debit",,,
"Doubtful customer",,,
"Error",,,
"Functional anomaly",,,
"ID",,,
"Inconsistency",,,
"Interbank payment order",,,
"Invoicing",,,
"Message",,,
"Missing field",,,
"Name",,,
"No Return Value",,,
"Non-unique key",,,
"Origin",,,
"Reference",,,
"Reference ID",,,
"Reimbursement",,,
"Reminder",,,
"Reported balance",,,
"Show the batch",,,
"Show the reference",,,
"Technical anomaly",,,
"Trace",,,
"TraceBack",,,
"Type",,,
"User",,,
1 key message comment context
2 Anomaly
3 Batch
4 CRM
5 Category
6 Cause
7 Configuration problem
8 Date
9 Debt recovery
10 Direct debit
11 Doubtful customer
12 Error
13 Functional anomaly
14 ID
15 Inconsistency
16 Interbank payment order
17 Invoicing
18 Message
19 Missing field
20 Name
21 No Return Value
22 Non-unique key
23 Origin
24 Reference
25 Reference ID
26 Reimbursement
27 Reminder
28 Reported balance
29 Show the batch
30 Show the reference
31 Technical anomaly
32 Trace
33 TraceBack
34 Type
35 User

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly","Anomalie",,
"Batch","Charge",,
"CRM","CRM",,
"Category","Kategorie",,
"Cause","Ursache",,
"Configuration problem","Konfigurationsproblem",,
"Date","Datum",,
"Debt recovery","Forderungseintreibung",,
"Direct debit","Lastschriftverfahren",,
"Doubtful customer","Zweifelhafter Kunde",,
"Error","Fehler",,
"Functional anomaly","Funktionelle Anomalie",,
"ID","ID",,
"Inconsistency","Inkonsistenz",,
"Interbank payment order","Interbank-Zahlungsauftrag",,
"Invoicing","Rechnungsstellung",,
"Message","Nachricht",,
"Missing field","Fehlende Felder",,
"Name","Name",,
"No Return Value","Kein Rückgabewert",,
"Non-unique key","Nicht eindeutiger Schlüssel",,
"Origin","Herkunft",,
"Reference","Referenz",,
"Reference ID","Referenz-ID",,
"Reimbursement","Erstattung",,
"Reminder","Erinnerung",,
"Reported balance",,,
"Show the batch","Anzeige der Charge",,
"Show the reference","Zeigen Sie die Referenz",,
"Technical anomaly","Technische Anomalie",,
"Trace","Trace",,
"TraceBack","TraceBack",,
"Type","Typ",,
"User","Benutzer",,
1 key message comment context
2 Anomaly Anomalie
3 Batch Charge
4 CRM CRM
5 Category Kategorie
6 Cause Ursache
7 Configuration problem Konfigurationsproblem
8 Date Datum
9 Debt recovery Forderungseintreibung
10 Direct debit Lastschriftverfahren
11 Doubtful customer Zweifelhafter Kunde
12 Error Fehler
13 Functional anomaly Funktionelle Anomalie
14 ID ID
15 Inconsistency Inkonsistenz
16 Interbank payment order Interbank-Zahlungsauftrag
17 Invoicing Rechnungsstellung
18 Message Nachricht
19 Missing field Fehlende Felder
20 Name Name
21 No Return Value Kein Rückgabewert
22 Non-unique key Nicht eindeutiger Schlüssel
23 Origin Herkunft
24 Reference Referenz
25 Reference ID Referenz-ID
26 Reimbursement Erstattung
27 Reminder Erinnerung
28 Reported balance
29 Show the batch Anzeige der Charge
30 Show the reference Zeigen Sie die Referenz
31 Technical anomaly Technische Anomalie
32 Trace Trace
33 TraceBack TraceBack
34 Type Typ
35 User Benutzer

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly",,,
"Batch",,,
"CRM",,,
"Category",,,
"Cause",,,
"Configuration problem",,,
"Date",,,
"Debt recovery",,,
"Direct debit",,,
"Doubtful customer",,,
"Error",,,
"Functional anomaly",,,
"ID",,,
"Inconsistency",,,
"Interbank payment order",,,
"Invoicing",,,
"Message",,,
"Missing field",,,
"Name",,,
"No Return Value",,,
"Non-unique key",,,
"Origin",,,
"Reference",,,
"Reference ID",,,
"Reimbursement",,,
"Reminder",,,
"Reported balance",,,
"Show the batch",,,
"Show the reference",,,
"Technical anomaly",,,
"Trace",,,
"TraceBack",,,
"Type",,,
"User",,,
1 key message comment context
2 Anomaly
3 Batch
4 CRM
5 Category
6 Cause
7 Configuration problem
8 Date
9 Debt recovery
10 Direct debit
11 Doubtful customer
12 Error
13 Functional anomaly
14 ID
15 Inconsistency
16 Interbank payment order
17 Invoicing
18 Message
19 Missing field
20 Name
21 No Return Value
22 Non-unique key
23 Origin
24 Reference
25 Reference ID
26 Reimbursement
27 Reminder
28 Reported balance
29 Show the batch
30 Show the reference
31 Technical anomaly
32 Trace
33 TraceBack
34 Type
35 User

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly","Anomalía",,
"Batch","Lote",,
"CRM","CRM",,
"Category","Categoría",,
"Cause","Causa",,
"Configuration problem","Problema de configuración",,
"Date","Fecha",,
"Debt recovery","Recuperación de deudas",,
"Direct debit","Domiciliación bancaria",,
"Doubtful customer","Cliente dudoso",,
"Error","Error",,
"Functional anomaly","Anomalía funcional",,
"ID","CARNÉ DE IDENTIDAD",,
"Inconsistency","Inconsistencia",,
"Interbank payment order","Orden de pago interbancaria",,
"Invoicing","Facturación",,
"Message","Mensaje",,
"Missing field","Campo que falta",,
"Name","Nombre",,
"No Return Value","Sin valor de retorno",,
"Non-unique key","Tecla no unívoca",,
"Origin","Origen",,
"Reference","Referencia",,
"Reference ID","ID de referencia",,
"Reimbursement","Reembolso",,
"Reminder","Recordatorio",,
"Reported balance",,,
"Show the batch","Mostrar el lote",,
"Show the reference","Mostrar la referencia",,
"Technical anomaly","Anomalía técnica",,
"Trace","Rastros",,
"TraceBack","TraceBack",,
"Type","Tipo",,
"User","Usuario",,
1 key message comment context
2 Anomaly Anomalía
3 Batch Lote
4 CRM CRM
5 Category Categoría
6 Cause Causa
7 Configuration problem Problema de configuración
8 Date Fecha
9 Debt recovery Recuperación de deudas
10 Direct debit Domiciliación bancaria
11 Doubtful customer Cliente dudoso
12 Error Error
13 Functional anomaly Anomalía funcional
14 ID CARNÉ DE IDENTIDAD
15 Inconsistency Inconsistencia
16 Interbank payment order Orden de pago interbancaria
17 Invoicing Facturación
18 Message Mensaje
19 Missing field Campo que falta
20 Name Nombre
21 No Return Value Sin valor de retorno
22 Non-unique key Tecla no unívoca
23 Origin Origen
24 Reference Referencia
25 Reference ID ID de referencia
26 Reimbursement Reembolso
27 Reminder Recordatorio
28 Reported balance
29 Show the batch Mostrar el lote
30 Show the reference Mostrar la referencia
31 Technical anomaly Anomalía técnica
32 Trace Rastros
33 TraceBack TraceBack
34 Type Tipo
35 User Usuario

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly","Anomalie",,
"Batch","Batch",,
"CRM","CRM",,
"Category","Catégorie",,
"Cause","Cause",,
"Configuration problem","Problème de configuration",,
"Date","Date",,
"Debt recovery","Recouvrement",,
"Direct debit","Prélèvement",,
"Doubtful customer","Client douteux",,
"Error","Erreur",,
"Functional anomaly","Anomalie fonctionnelle",,
"ID",,,
"Inconsistency","Incohérence",,
"Interbank payment order","Ordre de paiement interbancaire",,
"Invoicing","Facturation",,
"Message","Message",,
"Missing field","Champ manquant",,
"Name","Nom",,
"No Return Value","Aucune valeur",,
"Non-unique key","Clé non unique",,
"Origin","Origine",,
"Reference","Référence",,
"Reference ID","ID référence",,
"Reimbursement","Remboursement",,
"Reminder","Relance",,
"Reported balance","A nouveaux",,
"Show the batch","Afficher le batch",,
"Show the reference","Afficher la référence",,
"Technical anomaly","Anomalie technique",,
"Trace","Trace",,
"TraceBack","TraceBacks",,
"Type","Type",,
"User","Utilisateur",,
1 key message comment context
2 Anomaly Anomalie
3 Batch Batch
4 CRM CRM
5 Category Catégorie
6 Cause Cause
7 Configuration problem Problème de configuration
8 Date Date
9 Debt recovery Recouvrement
10 Direct debit Prélèvement
11 Doubtful customer Client douteux
12 Error Erreur
13 Functional anomaly Anomalie fonctionnelle
14 ID
15 Inconsistency Incohérence
16 Interbank payment order Ordre de paiement interbancaire
17 Invoicing Facturation
18 Message Message
19 Missing field Champ manquant
20 Name Nom
21 No Return Value Aucune valeur
22 Non-unique key Clé non unique
23 Origin Origine
24 Reference Référence
25 Reference ID ID référence
26 Reimbursement Remboursement
27 Reminder Relance
28 Reported balance A nouveaux
29 Show the batch Afficher le batch
30 Show the reference Afficher la référence
31 Technical anomaly Anomalie technique
32 Trace Trace
33 TraceBack TraceBacks
34 Type Type
35 User Utilisateur

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly","Anomalia",,
"Batch","Lotto",,
"CRM","CRM",,
"Category","Categoria",,
"Cause","Causa",,
"Configuration problem","Problema di configurazione",,
"Date","Data",,
"Debt recovery","Recupero crediti",,
"Direct debit","Addebito diretto",,
"Doubtful customer","Cliente dubbioso",,
"Error","Errore",,
"Functional anomaly","Anomalia funzionale",,
"ID","ID",,
"Inconsistency","Incoerenza",,
"Interbank payment order","Ordine di pagamento interbancario",,
"Invoicing","Fatturazione",,
"Message","Messaggio",,
"Missing field","Campo mancante",,
"Name","Nome",,
"No Return Value","Nessun valore di ritorno",,
"Non-unique key","Chiave non univoca",,
"Origin","Origine",,
"Reference","Riferimento",,
"Reference ID","ID di riferimento",,
"Reimbursement","Rimborso",,
"Reminder","Promemoria",,
"Reported balance",,,
"Show the batch","Mostra il lotto",,
"Show the reference","Mostra il riferimento",,
"Technical anomaly","Anomalia tecnica",,
"Trace","Traccia",,
"TraceBack","TraceBack",,
"Type","Tipo",,
"User","Utente",,
1 key message comment context
2 Anomaly Anomalia
3 Batch Lotto
4 CRM CRM
5 Category Categoria
6 Cause Causa
7 Configuration problem Problema di configurazione
8 Date Data
9 Debt recovery Recupero crediti
10 Direct debit Addebito diretto
11 Doubtful customer Cliente dubbioso
12 Error Errore
13 Functional anomaly Anomalia funzionale
14 ID ID
15 Inconsistency Incoerenza
16 Interbank payment order Ordine di pagamento interbancario
17 Invoicing Fatturazione
18 Message Messaggio
19 Missing field Campo mancante
20 Name Nome
21 No Return Value Nessun valore di ritorno
22 Non-unique key Chiave non univoca
23 Origin Origine
24 Reference Riferimento
25 Reference ID ID di riferimento
26 Reimbursement Rimborso
27 Reminder Promemoria
28 Reported balance
29 Show the batch Mostra il lotto
30 Show the reference Mostra il riferimento
31 Technical anomaly Anomalia tecnica
32 Trace Traccia
33 TraceBack TraceBack
34 Type Tipo
35 User Utente

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly","Anomalie",,
"Batch","Batch",,
"CRM","CRM",,
"Category","Categorie",,
"Cause","Oorzaak",,
"Configuration problem","Configuratie probleem",,
"Date","Datum",,
"Debt recovery","Invordering van schulden",,
"Direct debit","Automatische incasso",,
"Doubtful customer","Twijfelachtige klant",,
"Error","Fout",,
"Functional anomaly","Functionele anomalie",,
"ID","ID",,
"Inconsistency","Inconsistentie",,
"Interbank payment order","Interbancaire betalingsopdracht",,
"Invoicing","Facturatie",,
"Message","Bericht",,
"Missing field","Ontbrekend veld",,
"Name","Naam",,
"No Return Value","Geen retourwaarde",,
"Non-unique key","Niet-unieke sleutel",,
"Origin","Oorsprong",,
"Reference","Referentie",,
"Reference ID","Referentie-ID",,
"Reimbursement","Vergoeding",,
"Reminder","Herinnering",,
"Reported balance",,,
"Show the batch","Toon de batch",,
"Show the reference","Toon de referentie",,
"Technical anomaly","Technische anomalie",,
"Trace","Sporen",,
"TraceBack","TraceBack",,
"Type","Type",,
"User","Gebruiker",,
1 key message comment context
2 Anomaly Anomalie
3 Batch Batch
4 CRM CRM
5 Category Categorie
6 Cause Oorzaak
7 Configuration problem Configuratie probleem
8 Date Datum
9 Debt recovery Invordering van schulden
10 Direct debit Automatische incasso
11 Doubtful customer Twijfelachtige klant
12 Error Fout
13 Functional anomaly Functionele anomalie
14 ID ID
15 Inconsistency Inconsistentie
16 Interbank payment order Interbancaire betalingsopdracht
17 Invoicing Facturatie
18 Message Bericht
19 Missing field Ontbrekend veld
20 Name Naam
21 No Return Value Geen retourwaarde
22 Non-unique key Niet-unieke sleutel
23 Origin Oorsprong
24 Reference Referentie
25 Reference ID Referentie-ID
26 Reimbursement Vergoeding
27 Reminder Herinnering
28 Reported balance
29 Show the batch Toon de batch
30 Show the reference Toon de referentie
31 Technical anomaly Technische anomalie
32 Trace Sporen
33 TraceBack TraceBack
34 Type Type
35 User Gebruiker

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly","Anomalia",,
"Batch","Partia",,
"CRM","CRM",,
"Category","Kategoria",,
"Cause","Przyczyna",,
"Configuration problem","Problem konfiguracji",,
"Date","Data",,
"Debt recovery","Odzyskiwanie długów",,
"Direct debit","Polecenie zapłaty",,
"Doubtful customer","Wątpliwy klient",,
"Error","Błąd",,
"Functional anomaly","Anomalia funkcjonalna",,
"ID","IDENTYFIKATOR",,
"Inconsistency","Niespójność",,
"Interbank payment order","Międzybankowe zlecenie płatnicze",,
"Invoicing","Fakturowanie",,
"Message","Wiadomość",,
"Missing field","Brakujące pole",,
"Name","Nazwa",,
"No Return Value","Nr Wartość zwrotu",,
"Non-unique key","Klucz niejednoznaczny",,
"Origin","Pochodzenie",,
"Reference","Odniesienie",,
"Reference ID","Identyfikator referencyjny",,
"Reimbursement","Zwrot kosztów",,
"Reminder","Przypomnienie",,
"Reported balance",,,
"Show the batch","Pokaż partię.",,
"Show the reference","Pokaż odniesienie",,
"Technical anomaly","Anomalia techniczna",,
"Trace","Ścieżka",,
"TraceBack","TraceBack",,
"Type","Typ",,
"User","Użytkownik",,
1 key message comment context
2 Anomaly Anomalia
3 Batch Partia
4 CRM CRM
5 Category Kategoria
6 Cause Przyczyna
7 Configuration problem Problem konfiguracji
8 Date Data
9 Debt recovery Odzyskiwanie długów
10 Direct debit Polecenie zapłaty
11 Doubtful customer Wątpliwy klient
12 Error Błąd
13 Functional anomaly Anomalia funkcjonalna
14 ID IDENTYFIKATOR
15 Inconsistency Niespójność
16 Interbank payment order Międzybankowe zlecenie płatnicze
17 Invoicing Fakturowanie
18 Message Wiadomość
19 Missing field Brakujące pole
20 Name Nazwa
21 No Return Value Nr Wartość zwrotu
22 Non-unique key Klucz niejednoznaczny
23 Origin Pochodzenie
24 Reference Odniesienie
25 Reference ID Identyfikator referencyjny
26 Reimbursement Zwrot kosztów
27 Reminder Przypomnienie
28 Reported balance
29 Show the batch Pokaż partię.
30 Show the reference Pokaż odniesienie
31 Technical anomaly Anomalia techniczna
32 Trace Ścieżka
33 TraceBack TraceBack
34 Type Typ
35 User Użytkownik

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly","Anomalia",,
"Batch","Lote",,
"CRM","CRM",,
"Category","Categoria: Categoria",,
"Cause","Causa",,
"Configuration problem","Problema de configuração",,
"Date","Data",,
"Debt recovery","Recuperação de dívidas",,
"Direct debit","Débito directo",,
"Doubtful customer","Cliente duvidoso",,
"Error","Erro",,
"Functional anomaly","Anomalia funcional",,
"ID","ID",,
"Inconsistency","Inconsistência",,
"Interbank payment order","Ordem de pagamento interbancária",,
"Invoicing","Facturação",,
"Message","Mensagem",,
"Missing field","Campo em falta",,
"Name","Nome e Sobrenome",,
"No Return Value","Sem valor de retorno",,
"Non-unique key","Chave não exclusiva",,
"Origin","Origem",,
"Reference","Referência",,
"Reference ID","ID de referência",,
"Reimbursement","Reembolso",,
"Reminder","Lembrete",,
"Reported balance",,,
"Show the batch","Mostrar o lote",,
"Show the reference","Mostrar a referência",,
"Technical anomaly","Anomalia técnica",,
"Trace","Rastrear",,
"TraceBack","TraceBack",,
"Type","Tipo de",,
"User","Usuário",,
1 key message comment context
2 Anomaly Anomalia
3 Batch Lote
4 CRM CRM
5 Category Categoria: Categoria
6 Cause Causa
7 Configuration problem Problema de configuração
8 Date Data
9 Debt recovery Recuperação de dívidas
10 Direct debit Débito directo
11 Doubtful customer Cliente duvidoso
12 Error Erro
13 Functional anomaly Anomalia funcional
14 ID ID
15 Inconsistency Inconsistência
16 Interbank payment order Ordem de pagamento interbancária
17 Invoicing Facturação
18 Message Mensagem
19 Missing field Campo em falta
20 Name Nome e Sobrenome
21 No Return Value Sem valor de retorno
22 Non-unique key Chave não exclusiva
23 Origin Origem
24 Reference Referência
25 Reference ID ID de referência
26 Reimbursement Reembolso
27 Reminder Lembrete
28 Reported balance
29 Show the batch Mostrar o lote
30 Show the reference Mostrar a referência
31 Technical anomaly Anomalia técnica
32 Trace Rastrear
33 TraceBack TraceBack
34 Type Tipo de
35 User Usuário

View File

@ -0,0 +1,35 @@
"key","message","comment","context"
"Anomaly","Аномалия",,
"Batch","Пакет",,
"CRM","CRM",,
"Category","Категория",,
"Cause","Потому что",,
"Configuration problem","Проблема конфигурации",,
"Date","Дата",,
"Debt recovery","Взыскание задолженности",,
"Direct debit","Прямой дебет",,
"Doubtful customer","Сомнительный клиент",,
"Error","Ошибка",,
"Functional anomaly","Функциональная аномалия",,
"ID","УДОСТОВЕРЕНИЕ ЛИЧНОСТИ",,
"Inconsistency","несоответствие",,
"Interbank payment order","Межбанковское платежное поручение",,
"Invoicing","выставление счетов",,
"Message","Сообщение",,
"Missing field","Отсутствующее поле",,
"Name","Имя",,
"No Return Value","Нет возвратной стоимости",,
"Non-unique key","Не-уникальный ключ",,
"Origin","Происхождение",,
"Reference","Ссылка",,
"Reference ID","Ссылочный ID",,
"Reimbursement","Возмещение",,
"Reminder","Напоминание",,
"Reported balance",,,
"Show the batch","Показать партию",,
"Show the reference","Показать ссылку",,
"Technical anomaly","Техническая аномалия",,
"Trace","Трассировка",,
"TraceBack","TraceBack",,
"Type","Тип",,
"User","Пользователь",,
1 key message comment context
2 Anomaly Аномалия
3 Batch Пакет
4 CRM CRM
5 Category Категория
6 Cause Потому что
7 Configuration problem Проблема конфигурации
8 Date Дата
9 Debt recovery Взыскание задолженности
10 Direct debit Прямой дебет
11 Doubtful customer Сомнительный клиент
12 Error Ошибка
13 Functional anomaly Функциональная аномалия
14 ID УДОСТОВЕРЕНИЕ ЛИЧНОСТИ
15 Inconsistency несоответствие
16 Interbank payment order Межбанковское платежное поручение
17 Invoicing выставление счетов
18 Message Сообщение
19 Missing field Отсутствующее поле
20 Name Имя
21 No Return Value Нет возвратной стоимости
22 Non-unique key Не-уникальный ключ
23 Origin Происхождение
24 Reference Ссылка
25 Reference ID Ссылочный ID
26 Reimbursement Возмещение
27 Reminder Напоминание
28 Reported balance
29 Show the batch Показать партию
30 Show the reference Показать ссылку
31 Technical anomaly Техническая аномалия
32 Trace Трассировка
33 TraceBack TraceBack
34 Type Тип
35 User Пользователь

View File

@ -0,0 +1,31 @@
<?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='trace.back.type.select'>
<option value='0'>Technical anomaly</option>
<option value='1'>Functional anomaly</option>
</selection>
<selection name='trace.back.category.select'>
<option value='1'>Missing field</option>
<option value='2'>Non-unique key</option>
<option value='3'>No Return Value</option>
<option value='4'>Configuration problem</option>
<option value='5'>Inconsistency</option>
</selection>
<selection name='trace.back.origin.select'>
<option value='invoice'>Invoicing</option>
<option value='reminder'>Reminder</option>
<option value='debtRecovery'>Debt recovery</option>
<option value='doubtfulCustomer'>Doubtful customer</option>
<option value='reimbursement'>Reimbursement</option>
<option value='directDebit'>Direct debit</option>
<option value="interbankPaymentOrder">Interbank payment order</option>
<option value="crm">CRM</option>
<option value="reportedBalance">Reported balance</option>
</selection>
</object-views>

View File

@ -0,0 +1,80 @@
<?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="trace-back-grid" title="TraceBack" model="com.axelor.exception.db.TraceBack" orderBy="-id">
<toolbar>
<button name="newBtn" title="" hidden="true"/>
<button name="editBtn" title="" hidden="true"/>
<button name="saveBtn" title="" hidden="true"/>
<button name="deleteBtn" title="" hidden="true"/>
<button name="copyBtn" title="" hidden="true"/>
<button name="cancelBtn" title="" hidden="true"/>
</toolbar>
<hilite color="danger" if="typeSelect == 0" />
<field name="id"/>
<field name="date"/>
<field name="internalUser"/>
<field name="origin" />
<field name="typeSelect"/>
<field name="categorySelect"/>
<field name="exception"/>
</grid>
<form name="trace-back-form" title="TraceBack" model="com.axelor.exception.db.TraceBack" onLoad="action-trace-back-load">
<toolbar>
<button name="newBtn" title="" hidden="true"/>
<button name="editBtn" title="" hidden="true"/>
<button name="saveBtn" title="" hidden="true"/>
<button name="deleteBtn" title="" hidden="true"/>
<button name="copyBtn" title="" hidden="true"/>
<button name="cancelBtn" title="" hidden="true"/>
</toolbar>
<panel name="mainPanel" sidebar="true">
<field name="date"/>
<field name="internalUser"/>
<field name="origin" />
<field name="typeSelect"/>
<field name="categorySelect"/>
</panel>
<panel name="referencePanel" title="Reference" showIf="ref" sidebar="true">
<field name="ref" colSpan="10" />
<field name="refId" title="ID" showIf="refId" colSpan="2" />
<button name="showReferenceBtn" title="Show the reference" icon="fa-share" css="btn-primary" onClick="action-traceback-show-reference" />
</panel>
<panel name="batchPanel" title="Batch" showIf="batchId" sidebar="true" if="__config__.app.isApp('base')">
<field name="batchId" colSpan="4" />
<button name="showBatchBtn" title="Show the batch" icon="fa-share" css="btn-primary" onClick="action-batch-show-batch" colSpan="8" />
</panel>
<panel name="exceptionGroupPanel" title="Anomaly" canCollapse="true">
<field name="exception" showTitle="false" colSpan="12"/>
</panel>
<panel name="errorGroupPanel" title="Error" canCollapse="true">
<field name="error" showTitle="false" colSpan="12"/>
</panel>
<panel name="causeGroupPanel" title="Cause" canCollapse="true">
<field name="cause" showTitle="false" colSpan="12"/>
</panel>
<panel name="messageGroupPanel" title="Message" canCollapse="true">
<field name="message" showTitle="false" colSpan="12"/>
</panel>
<panel name="traceGroupPanel" title="Trace" canCollapse="true">
<field name="trace" showTitle="false" colSpan="12"/>
</panel>
</form>
<action-attrs name="action-trace-back-load">
<attribute name="hidden" for="categorySelect" expr="eval: !categorySelect"/>
<attribute name="hidden" for="errorGroupPanel" expr="eval: !error"/>
<attribute name="hidden" for="causeGroupPanel" expr="eval: !cause"/>
<attribute name="hidden" for="messageGroupPanel" expr="eval: !message"/>
<attribute name="hidden" for="traceGroupPanel" expr="eval: !trace"/>
</action-attrs>
<action-method name="action-traceback-show-reference">
<call class="com.axelor.exception.web.TraceBackController"
method="showReference" />
</action-method>
</object-views>

View File

@ -0,0 +1,31 @@
/*
* 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.exception;
import com.axelor.auth.AuthModule;
import com.axelor.db.JpaModule;
import com.google.inject.AbstractModule;
public class TestModule extends AbstractModule {
@Override
protected void configure() {
install(new JpaModule("testUnit", true, true));
install(new AuthModule());
}
}

View File

@ -0,0 +1,35 @@
/*
* 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.exception.db;
import org.junit.Test;
public class TraceBackTest {
@Test
public void testPersist() {
System.out.println("Test");
String str = "test.test1.test2";
String tab[] = str.split("\\.");
System.out.println(tab.length);
System.out.println(tab[0]);
System.out.println(tab[1]);
System.out.println(tab[2]);
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="testUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/axelor-test" />
<property name="javax.persistence.jdbc.user" value="axelor" />
<property name="javax.persistence.jdbc.password" value="" />
<!--
value="create" to build a new database on each run;
value="update" to modify an existing database;
value="create-drop" means the same as "create" but also drops tables when Hibernate closes;
value="validate" makes no changes to the database
-->
<property name="hibernate.hbm2ddl.auto" value="update" />
<!--
<property name="hibernate.show_sql" value="true"/>
-->
</properties>
</persistence-unit>
</persistence>