fix(Item): delete item with associated items entries.

This commit is contained in:
a.bouhuolia
2021-03-06 12:34:05 +02:00
parent 0f5b34f125
commit 32e5695950
3 changed files with 16 additions and 13 deletions

View File

@@ -581,8 +581,7 @@ export default class ItemsService implements IItemsService {
const ids = Array.isArray(itemId) ? itemId : [itemId];
const foundItemEntries = await ItemEntry.query()
.whereIn('item_id', ids)
.whereIn('reference_type', ['SaleInvoice', 'Bill']);
.whereIn('item_id', ids);
if (foundItemEntries.length > 0) {
throw new ServiceError(