Skip to content

Custom Fields Missing for (items,item_prices,item_families,coupons) ever since recent refactoring #121

@rickpaulfmg

Description

@rickpaulfmg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions