Cannot save Item DocType after making changes to field's No Copy value

Cannot save Item DocType after making changes to field’s No Copy value.

App Versions
{
“erpnext”: “6.6.4”,
“frappe”: “6.6.1”
}
Route
Form/DocType/Item

Error Report
Traceback (innermost last):
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 239, in save
self.run_before_save_methods()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 589, in run_before_save_methods
self.run_method(“validate”)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 551, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 706, in composer
return composed(self, method, *args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 689, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 545, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 44, in validate
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 357, in validate_fields
d.fieldname = d.fieldname.lower()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 335, in check_title_field
if not pattern:
AttributeError: ‘DocType’ object has no attribute ‘get_field’

Traceback (innermost last):
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/app.py”, line 70, in application
response = frappe.handler.handle()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/handler.py”, line 75, in handle
execute_cmd(cmd)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/handler.py”, line 109, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/init.py”, line 776, in call
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 239, in save
self.run_before_save_methods()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 589, in run_before_save_methods
self.run_method(“validate”)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 551, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 706, in composer
return composed(self, method, *args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 689, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 545, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 44, in validate
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 357, in validate_fields
d.fieldname = d.fieldname.lower()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 335, in check_title_field
if not pattern:
AttributeError: ‘DocType’ object has no attribute ‘get_field’

Trace seems weird, restart your bench. bench restart

Didn’t work…throwing an error on restart

/apps/erpnext/htdocs/frappe-bench$ bench restart
sudo: supervisorctl: command not found
Traceback (most recent call last):
File “/opt/bitnami/apps/erpnext/htdocs/venv/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/opt/bitnami/apps/erpnext/htdocs/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/bench-repo/bench/cli.py”, line 300, in restart
restart_supervisor_processes()
File “/opt/bitnami/apps/erpnext/htdocs/bench-repo/bench/utils.py”, line 303, in restart_supervisor_processes
exec_cmd(cmd, cwd=bench)
File “/opt/bitnami/apps/erpnext/htdocs/bench-repo/bench/utils.py”, line 104, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: sudo supervisorctl restart frappe:

If you are using development setup, just kill and restart the bench.

New Error …

“erpnext”: “6.7.7”,
“frappe”: “6.7.11”

Form/DocType/Item

Traceback (innermost last):
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 254, in save
self.run_post_save_methods()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 607, in run_post_save_methods
self.run_method(“on_update”)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 551, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 706, in composer
return composed(self, method, *args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 689, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 545, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 118, in on_update
self.export_doc()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 182, in export_doc
export_to_files(record_list=[[‘DocType’, self.name]])
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/modules/export_file.py”, line 22, in export_to_files
write_document_file(frappe.get_doc(record[0], record[1]), record_module, create_init=create_init)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/modules/export_file.py”, line 43, in write_document_file
with open(os.path.join(folder, fname +“.json”),‘w+’) as txtfile:
IOError: [Errno 13] Permission denied: u’/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.json’

I had also get similar errors when trying to create custom field vat tin in sales invoice… I had first tried on windows virtual machine and thought it might be error due to vm, so tried fresh install in ubuntu… I had just setup… no settings are changes just entered some values asked by wizard … earlier I had got some redis starting error while using bench start … but it was overcome by following suggesation by removing line < save “” > in redis configuration…

I also did bench restart as told by Rushab… but did not help … here are erros

Traceback (innermost last):
File “/home/sid/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in save
self.insert()
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 210, in insert
self.run_post_save_methods()
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 607, in run_post_save_methods
self.run_method(“on_update”)
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 551, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 706, in composer
return composed(self, method, *args, **kwargs)
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 689, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 545, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/sid/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py”, line 39, in on_update
validate_fields_for_doctype(self.dt)
File “/home/sid/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 230, in validate_fields_for_doctype
validate_fields(frappe.get_meta(doctype, cached=False))
File “/home/sid/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 393, in validate_fields
check_unique_and_text(d)
File “/home/sid/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 318, in check_unique_and_text
doctype=d.parent, fieldname=d.fieldname))
File “/home/sid/frappe-bench/apps/frappe/frappe/database.py”, line 146, in sql
self._cursor.execute(query)
File “/home/sid/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/sid/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1054, “Unknown column ‘vat_tin’ in ‘field list’”)

Traceback (innermost last):
File “/home/sid/frappe-bench/apps/frappe/frappe/app.py”, line 69, in application
response = frappe.handler.handle()
File “/home/sid/frappe-bench/apps/frappe/frappe/handler.py”, line 77, in handle
execute_cmd(cmd)
File “/home/sid/frappe-bench/apps/frappe/frappe/handler.py”, line 94, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/sid/frappe-bench/apps/frappe/frappe/init.py”, line 798, in call
return fn(*args, **newargs)
File “/home/sid/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in save
self.insert()
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 210, in insert
self.run_post_save_methods()
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 607, in run_post_save_methods
self.run_method(“on_update”)
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 551, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 706, in composer
return composed(self, method, *args, **kwargs)
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 689, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/sid/frappe-bench/apps/frappe/frappe/model/document.py”, line 545, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/sid/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py”, line 39, in on_update
validate_fields_for_doctype(self.dt)
File “/home/sid/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 230, in validate_fields_for_doctype
validate_fields(frappe.get_meta(doctype, cached=False))
File “/home/sid/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 393, in validate_fields
check_unique_and_text(d)
File “/home/sid/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 318, in check_unique_and_text
doctype=d.parent, fieldname=d.fieldname))
File “/home/sid/frappe-bench/apps/frappe/frappe/database.py”, line 146, in sql
self._cursor.execute(query)
File “/home/sid/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/sid/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1054, “Unknown column ‘vat_tin’ in ‘field list’”)

I tried same thing on my erpnext online account it works flowless and then I used bench update command … and it worked my problem solved… I was face ame error from couple of days… but now solved