Varianten-Mapping (Shopware Properties → ERPNext Item Variants) #14
Labels
No labels
API
Artikel
B2B
B2C
Bestandssync
Bestellungen
DACH
DocType
Dokumentation
Grundgerüst
Import
Kategorien
Kunden
Lager
Mapping
Mehrsprachigkeit
Performance
Preise
Push
Scheduler
Schweiz
Steuern
Storefront
Sync
Varianten
Verbindung
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Frappe-Projekte/ecommerce_integrations#14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Shopware-Produktvarianten auf ERPNext Item Variants mappen:
shopware6/api/product.pyImplemented by extending
ecommerce_integrations/shopware6/api/product.pyfrom #13 (as specified in the issue) with variant awareness, plus a newshopware_variant_idCustom Field onItem.Behavior change vs. #13:
list_products()now filters server-side to top-level parents (parentId == None) and embeds each parent's variant children via thechildrenassociation (withoptions.group). Products without variants are unaffected — still a single flat Item, same as #13.Research (Julian/Marcel): Both already use ERPNext's native variant mechanism (
has_variants/variant_of/attributes), no custom parallel structure — good confirmation for our approach. Both fetch children embedded on the same search call rather than a secondparentId-filtered request, which we adopted directly. Marcel's code comment (and our own live check against the real catalog) confirms a Shopware parent's ownoptionsis always empty — only children carry the group/value matrix. Julian's variant code reads only the parent'soptions, a latent bug we did not copy (ERPNext's own validation throws"Attribute table is mandatory"on an empty attributes table).Design decisions:
item_codedirectly (template and variant SKUs), plusshopware_variant_idas required by the issue — consistent with #13's dedup approach, diverging from both forks'Ecommerce Item-based linking.abbr = value[:10]truncation isn't collision-safe and broke on real data (two distinct values sharing the same first 10 characters). Replaced with a_generate_abbr()helper that disambiguates with a numeric suffix on collision — same idea already used for Item Group name collisions in #12.Live verification against the real catalog:
propertiesrelation (onlyoptions), no generic field mapper.See
Projekt.md→ Architecture Decisions for the full writeup.