It looks like the recent refactoring requires custom fields to be handled per object.
The following code was added to "subscriptions.py" as well as "customers.py". It was overlooked on "items.py, item_prices.py, item_families.py, coupons.py, invoices.py, credit_notes.py". Can we add this code block to each object script:
def add_custom_fields(self, record: dict):
"""
Adds custom fields to the record.
"""
custom_fields = {}
for key in record.keys():
if "cf_" in key:
custom_fields[key] = record[key]
if custom_fields:
record["custom_fields"] = json.dumps(custom_fields)
return record
It looks like the recent refactoring requires custom fields to be handled per object.
The following code was added to "subscriptions.py" as well as "customers.py". It was overlooked on "items.py, item_prices.py, item_families.py, coupons.py, invoices.py, credit_notes.py". Can we add this code block to each object script: