diff --git a/db/changes/10162-fallas/00-acl.sql b/db/changes/10162-fallas/00-acl.sql
new file mode 100644
index 000000000..376788af1
--- /dev/null
+++ b/db/changes/10162-fallas/00-acl.sql
@@ -0,0 +1 @@
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('WorkerLog', '*', 'READ', 'ALLOW', 'ROLE', 'hr');
diff --git a/db/changes/10162-fallas/00-workerLog.sql b/db/changes/10162-fallas/00-workerLog.sql
new file mode 100644
index 000000000..730b60aa5
--- /dev/null
+++ b/db/changes/10162-fallas/00-workerLog.sql
@@ -0,0 +1,6 @@
+ALTER TABLE `vn`.`workerLog`
+ ADD COLUMN `changedModel` VARCHAR(45) NULL DEFAULT NULL AFTER `description`,
+ ADD COLUMN `oldInstance` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
+ ADD COLUMN `newInstance` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
+ ADD COLUMN `changedModelId` int(11) DEFAULT NULL,
+ ADD COLUMN `changedModelValue` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL;
\ No newline at end of file
diff --git a/modules/travel/back/models/travel.json b/modules/travel/back/models/travel.json
index 0eafe4010..aebf4e3cd 100644
--- a/modules/travel/back/models/travel.json
+++ b/modules/travel/back/models/travel.json
@@ -7,7 +7,7 @@
},
"options": {
"mysql": {
- "table": "travel"
+ "table": "travel"
}
},
"properties": {
diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json
index 884759bc9..e91e8b0fc 100644
--- a/modules/worker/back/model-config.json
+++ b/modules/worker/back/model-config.json
@@ -52,5 +52,11 @@
},
"Device": {
"dataSource": "vn"
+ },
+ "WorkerLog": {
+ "dataSource": "vn"
}
}
+
+
+
diff --git a/modules/worker/back/models/worker-log.json b/modules/worker/back/models/worker-log.json
new file mode 100644
index 000000000..f100f3486
--- /dev/null
+++ b/modules/worker/back/models/worker-log.json
@@ -0,0 +1,58 @@
+{
+ "name": "WorkerLog",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "workerLog"
+ }
+ },
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "Number",
+ "forceId": false
+ },
+ "originFk": {
+ "type": "Number",
+ "required": true
+ },
+ "userFk": {
+ "type": "Number"
+ },
+ "action": {
+ "type": "String",
+ "required": true
+ },
+ "changedModel": {
+ "type": "String"
+ },
+ "oldInstance": {
+ "type": "Object"
+ },
+ "newInstance": {
+ "type": "Object"
+ },
+ "creationDate": {
+ "type": "Date"
+ },
+ "changedModelId": {
+ "type": "String"
+ },
+ "changedModelValue": {
+ "type": "String"
+ },
+ "description": {
+ "type": "String"
+ }
+ },
+ "relations": {
+ "user": {
+ "type": "belongsTo",
+ "model": "Account",
+ "foreignKey": "userFk"
+ }
+ },
+ "scope": {
+ "order": ["creationDate DESC", "id DESC"]
+ }
+}
diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json
index 7456a3caa..6af7e8608 100644
--- a/modules/worker/back/models/worker.json
+++ b/modules/worker/back/models/worker.json
@@ -1,7 +1,11 @@
{
"name": "Worker",
"description": "Company employees",
- "base": "VnModel",
+ "base": "Loggable",
+ "log": {
+ "model":"WorkerLog",
+ "showField": "firstName"
+ },
"options": {
"mysql": {
"table": "worker"
diff --git a/modules/worker/front/basic-data/index.html b/modules/worker/front/basic-data/index.html
index 67439b350..bdc309c00 100644
--- a/modules/worker/front/basic-data/index.html
+++ b/modules/worker/front/basic-data/index.html
@@ -1,10 +1,9 @@
+