diff --git a/modules/ticket/back/models/sale.js b/modules/ticket/back/models/sale.js index f7af4fc21..1b4d8e31c 100644 --- a/modules/ticket/back/models/sale.js +++ b/modules/ticket/back/models/sale.js @@ -68,7 +68,6 @@ module.exports = Self => { fields: ['family', 'minQuantity'], where: {id: itemId}, }, ctx.options); - if (item.family == 'EMB') return; if (await models.ACL.checkAccessAcl(ctx, 'Sale', 'isInPreparing', '*')) return; @@ -89,16 +88,7 @@ module.exports = Self => { if (await models.ACL.checkAccessAcl(ctx, 'Ticket', 'isRoleAdvanced', '*')) return; - // WIP: Check if is owner - const ticketCollection = await models.TicketCollection.findOne({ - include: {relation: 'collection', fields: ['workerFk']}, - where: {ticketFk: ticketId} - }, ctx.options); - - // if(!res) look in SaleGroup.(ask for Sergio to make fixtures for this case) - const isOwner = res.collection.workerFk === ctx.req.accessToken.userId; - - if (newQuantity < item.minQuantity && newQuantity != available && !isOwner) + if (newQuantity < item.minQuantity && newQuantity != available) throw new UserError('The amount cannot be less than the minimum'); if (ctx.isNewInstance || isReduction) return;