Try ERPNext Buy Support Partners Foundation

OAuth Authorization Code: Fieldtype Text for Authorization Code cannot be unique

I tried to migrate custom fixtures to production and got following error:

frappe.core.doctype.doctype.doctype.NonUniqueError: OAuth Authorization Code: Fieldtype Text for Authorization Code cannot be unique

So what I did is:

  1. Assigned DocTypes that I changed fields in to my custom app
  2. Added this to hooks.py of my app
    fixtures = [
    # export all records from the Custom Field table
    “Custom Field”,
    “DocType”,
    ]
  3. Pushed and pulled apps repo
  4. Ran bench migrate
  5. Got frappe.core.doctype.doctype.doctype.NonUniqueError: OAuth Authorization Code: Fieldtype Text for Authorization Code cannot be unique

Filter the fixtures specific to the app that installs it.

Don’t export everything!

Example:

fixtures = [
    {
        "dt": "Custom Field",
        "filters": [
            [
                "name",
                "in",
                [
                    "Delivery Note Item-prefix_serials",
                    "Customer-prefix_customer_bin_id",
                    "Customer-prefix_customer_trade_license",
                    ...
                ],
            ],
        ]
    },
]