This commit is contained in:
seb
2026-10-17 23:31:37 +02:00
parent ab42a3ffb4
commit 688fa4f3fd
19 changed files with 475 additions and 18 deletions

View File

@@ -11,6 +11,7 @@ import {
recordParentDeactivatedHistory,
} from '../articlehistory/record.js';
import makeRunner from '../runner.js';
import { removeArticleWarehouseSummary } from '../articlewarehousesummary/syncSummary.js';
export default function toggleParent(provider) {
const resolve = resolveArticleBySku(provider);
@@ -96,6 +97,7 @@ export default function toggleParent(provider) {
await runner.query('DELETE FROM price WHERE article_id = @articleId', { articleId });
await runner.query('UPDATE article SET track_stock = 0 WHERE id = @articleId', { articleId });
await removeArticleWarehouseSummary(runner, { articleId });
// If article is a child, verify attribute is not used by parent or any parent up the chain
let currentParentId = currentArt?.parentarticle_id;