proper test for merge fix for organization_id setting

This commit is contained in:
2026-05-13 15:38:42 -04:00
parent c7372891d8
commit 40e08cbf09
10 changed files with 1105 additions and 12 deletions

17
fix_merger2.py Normal file
View File

@ -0,0 +1,17 @@
import json
with open("fixtures/merger.json", "r") as f:
data = json.load(f)
db = data[0]["database"]
# Add organization_id to fields and grouped_fields.entity of order, order_line, person
for t in db["types"]:
if t["name"] in ["order", "order_line", "person"]:
if "organization_id" not in t["fields"]:
t["fields"].append("organization_id")
if "organization_id" not in t["grouped_fields"]["entity"]:
t["grouped_fields"]["entity"].append("organization_id")
with open("fixtures/merger.json", "w") as f:
json.dump(data, f, indent=2)