refs #6184 saveCmr #1788
|
@ -33,6 +33,11 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
const dmsTypeCmr = await models.DmsType.findOne({
|
||||
where: {code: 'cmr'},
|
||||
fields: ['id']
|
||||
guillermo marked this conversation as resolved
Outdated
|
||||
}, myOptions);
|
||||
|
||||
for (const ticketId of tickets) {
|
||||
const ticket = await models.Ticket.findById(ticketId, myOptions);
|
||||
|
||||
|
@ -43,10 +48,7 @@ module.exports = Self => {
|
|||
relation: 'dms',
|
||||
fields: ['dmsFk'],
|
||||
scope: {
|
||||
relation: 'dmsType',
|
||||
scope: {
|
||||
where: {code: 'cmr'}
|
||||
}
|
||||
where: {dmsTypeFk: dmsTypeCmr.id}
|
||||
}
|
||||
}
|
||||
}, myOptions);
|
||||
|
|
Loading…
Reference in New Issue
Este el cree cada vegada pero es el mateix id per a tots. Pujal fora del for
El nom jo posaría dmsTypeCmr