proper test for merge fix for organization_id setting
This commit is contained in:
17
fix_merger2.py
Normal file
17
fix_merger2.py
Normal 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)
|
||||
Reference in New Issue
Block a user