Migrated Data made the custom Doctypes in the new bench unedittable

I got an error while replicating my ongoing frappecloud site onto a local site.

frappe.exceptions.CannotChangeConstantError: Value cannot be changed for Created By

Here is what I did till this point,

  1. I downloaded my backup files (db, public,private) from my ongoing site hosted on frappecloud.
  2. Installed frappe’s container setup on a vm ubuntu(23.04).
  3. Built bench, frappe, erpnext, localsite using the ./development/installer.py
  4. ran bench --site sitename.localhost migrate with --db…{path} --private…{path} --public…{path}
    This ran successfully with no errors.
  5. Now when I access the desk mode of my localsite and try to edit a custom doctype I had built earlier on the cloud, It shows me the above error.
    I could create new doctypes, but some of my existing server scripts also errors out on several different reasons.

Is this a migartion issue? Am I missing some steps?

@Keyur_Paraskar , please turn on the developer mode by following:

bench --site site_name set-config developer_mode 1

@Nasir_Khan, Thanks for the prompt response! Setting the developer mode on fixed the issue with server scripts discrepencies. Although I still get the following error when trying to edit an existing custom doctype.

Hello,
I used to have very similar problem.

I used “dirty” workaround: go to frappe core code: frappe/frappe/model/document.py and delete this section (row 646 - 652):

Then I save the changes in custom doctype and then I put the above section back for “clear” core.
Next savings in custom dcts are ok.

If anyone has a better solution, I’d love to know it :wink:
Jirka

1 Like

@Jiri_Sir, Great workaround, thanks! :smile::+1: This should work for me right now.

Just a heads-up to someone implementing this: make minor changes to “all” custom doctypes while the code snippet is commented out.

It’s really “dirty” but it’s works!