diff --git a/modules/claim/back/models/claim.json b/modules/claim/back/models/claim.json index cd5b767e4..4b26720e5 100644 --- a/modules/claim/back/models/claim.json +++ b/modules/claim/back/models/claim.json @@ -82,6 +82,11 @@ "type": "hasMany", "model": "ClaimDms", "foreignKey": "claimFk" + }, + "lines": { + "type": "hasMany", + "model": "ClaimBeginning", + "foreignKey": "claimFk" } } } diff --git a/modules/entry/back/models/buy.json b/modules/entry/back/models/buy.json index 8e36d0eef..de2ddffd6 100644 --- a/modules/entry/back/models/buy.json +++ b/modules/entry/back/models/buy.json @@ -3,7 +3,8 @@ "base": "Loggable", "log": { "model": "EntryLog", - "relation": "entry" + "relation": "entry", + "grabUser": true }, "options": { "mysql": { @@ -70,4 +71,4 @@ "foreignKey": "packageFk" } } -} \ No newline at end of file +} diff --git a/modules/entry/back/models/entry.json b/modules/entry/back/models/entry.json index 6c5e1b7d3..5aa175758 100644 --- a/modules/entry/back/models/entry.json +++ b/modules/entry/back/models/entry.json @@ -2,7 +2,8 @@ "name": "Entry", "base": "Loggable", "log": { - "model":"EntryLog" + "model":"EntryLog", + "grabUser": true }, "options": { "mysql": { diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 10300f7a1..d6b3c27ad 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -3,7 +3,8 @@ "base": "Loggable", "log": { "model": "ItemLog", - "showField": "id" + "showField": "id", + "grabUser": true }, "options": { "mysql": { @@ -220,4 +221,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/route/back/models/route.json b/modules/route/back/models/route.json index 12b9785db..3b12f4ee6 100644 --- a/modules/route/back/models/route.json +++ b/modules/route/back/models/route.json @@ -2,7 +2,8 @@ "name": "Route", "base": "Loggable", "log": { - "model":"RouteLog" + "model":"RouteLog", + "grabUser": true }, "options": { "mysql": { diff --git a/modules/ticket/back/methods/ticket/new.js b/modules/ticket/back/methods/ticket/new.js index 597ece3e5..a5d04bc4c 100644 --- a/modules/ticket/back/methods/ticket/new.js +++ b/modules/ticket/back/methods/ticket/new.js @@ -127,19 +127,6 @@ module.exports = Self => { ], myOptions); const ticket = await models.Ticket.findById(result[1][0].newTicketId, null, myOptions); - const cleanInstance = JSON.parse(JSON.stringify(ticket)); - - const logRecord = { - originFk: cleanInstance.id, - userFk: myUserId, - action: 'insert', - changedModel: 'Ticket', - changedModelId: cleanInstance.id, - oldInstance: {}, - newInstance: cleanInstance - }; - - await models.TicketLog.create(logRecord, myOptions); if (tx) await tx.commit(); diff --git a/modules/ticket/back/models/sale.json b/modules/ticket/back/models/sale.json index 669b05be6..7b8cf501b 100644 --- a/modules/ticket/back/models/sale.json +++ b/modules/ticket/back/models/sale.json @@ -4,7 +4,8 @@ "log": { "model": "TicketLog", "relation": "ticket", - "showField": "concept" + "showField": "concept", + "grabUser": true }, "options": { "mysql": { diff --git a/modules/ticket/back/models/ticket.json b/modules/ticket/back/models/ticket.json index 1cf2642a5..dabda838a 100644 --- a/modules/ticket/back/models/ticket.json +++ b/modules/ticket/back/models/ticket.json @@ -3,7 +3,8 @@ "base": "Loggable", "log": { "model":"TicketLog", - "showField": "id" + "showField": "id", + "grabUser": true }, "options": { "mysql": { diff --git a/modules/travel/back/models/travel.json b/modules/travel/back/models/travel.json index c20b7b0bf..7dd9f5bba 100644 --- a/modules/travel/back/models/travel.json +++ b/modules/travel/back/models/travel.json @@ -3,7 +3,8 @@ "base": "Loggable", "log": { "model":"TravelLog", - "showField": "ref" + "showField": "ref", + "grabUser": true }, "options": { "mysql": {