Wheels — Merge
Merge wheel products into a primary product. Redirects all business references from secondary product(s) to the primary using Proc_MergeProduct, then deletes the secondaries.
Modes
- Duplicate mode (single
-p): Finds all products with the same part number. First match becomes primary, rest are merged into it. - Cross-part-number mode (multiple
-p): First-pis the primary (kept), remaining-pvalues are secondaries (merged and deleted). - All mode (
--all): Finds and merges all duplicate part numbers in the database.
Usage: efision -r <region> wheels merge [-p <pn>... | --all [--dry-run]] [--skip-vouchers]
| Flag | Short | Default | Description |
|---|---|---|---|
--part-number | -p | (none) | Part number(s). Single: merge duplicates. Multiple: first is primary, rest are secondaries. |
--all | false | Merge ALL duplicate part numbers in the database | |
--dry-run | false | Show duplicates without merging (only with --all) | |
--skip-vouchers | false | Skip updating VoucherItem accounting records |
What the Merge Does
- Updates all references to the secondary product across 18 business tables
- Optionally updates VoucherItem accounting memos (enabled by default)
- Deletes the secondary product records (CategoryProduct, ProductWheels, Product)
- All operations within a single database transaction
Examples
Merge duplicates (same part number):
efision -r demo wheels merge -p "W-18x8-BK"
Merge different part numbers:
efision -r demo wheels merge -p "W-18x8-BK-A" -p "W-18x8-BK-B" -p "W-18x8-BK-C"
Merge all duplicates (dry run):
efision -r demo wheels merge --all --dry-run
Skip voucher handling:
efision -r demo wheels merge -p "W-18x8-BK" --skip-vouchers