Territory-Hierarchie (Land → Bundesland/Kanton) auf CRM Lead befüllen #3
Loading…
Add table
Add a link
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?
Kontext
Beim Testen von
feature/lead-origin-noteaufgefallen:CRM Leadhat einterritory-Feld (Link aufCRM Territory), das wir bisher nicht befüllen.Recherche
CRM Territoryist ein Baum-Doctype (is_tree: 1,nsm_parent_field: parent_crm_territory), Autonamefield:territory_name, aktuell komplett leer in der DB.pass-Controller) — mehrere Wurzelknoten (mehrere Länder nebeneinander) sind mit Frappes generischem Nested-Set-Framework unproblematisch.Entscheidung (abgestimmt)
Automatisch zweistufig anlegen:
ensure_territory(country_name, region_name)incrm_lead_sync.py, analog zuensure_lead_source():is_group=1, kein Parent) falls nicht vorhanden.is_group=0,parent_crm_territory=<Land>) falls nicht vorhanden.BY→Bayern) →REGION_NAMES-Tabelle aus dem alten Mautic-Projekt (GitLab/wsc_py_leadscraper/import_leads.py) für DE/AT/CH nachcrm_lead_sync.pyübernehmen (oder eigenes Modulregion_names.py, falls zu groß).build_lead_fields()bekommt ein neues Feld"territory": region_name.COUNTRY_NAMES_DE(Konsistenz zucustom_country).Verifikation
territory-Feld im CRM-Frontend auf dem Lead sichtbar/korrektFachlicher Ursprung: #1