From b84351e06068ac62b7949b568484a5b679e39162 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 20 Mar 2024 13:50:29 +0100 Subject: [PATCH] refs #6276 feat:newWarehouse --- modules/ticket/back/methods/sale-tracking/setPicked.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/ticket/back/methods/sale-tracking/setPicked.js b/modules/ticket/back/methods/sale-tracking/setPicked.js index 828f6eb7e..5eedcbf6c 100644 --- a/modules/ticket/back/methods/sale-tracking/setPicked.js +++ b/modules/ticket/back/methods/sale-tracking/setPicked.js @@ -89,16 +89,9 @@ module.exports = Self => { const {itemOriginalFk} = await models.Buy.findById(buyFk, {fields: ['itemOriginalFk']}, myOptions); if (itemOriginalFk) await models.SaleBuy.create({saleFk, buyFk}, myOptions); } catch (e) { - throw new UserError('The sale cannot be tracked'); + if (tx) await tx.commit(); } - - if (tx) await tx.commit(); } catch (e) { - if (e.message == 'The sale cannot be tracked') { - if (tx) tx.commit(); - throw e; - } - if (tx) await tx.rollback(); throw new UserError('The line could not be marked'); }