I did this but got error:
bench@user-VirtualBox:~/frappe-bench$ bench console
Apps in this namespace:
frappe, erpnext
In [1]: import frappe
In [2]: import frappe
...: frappe.reload_doc('website', 'doctype', 'Website Settings')
...: frappe.db.commit()
---------------------------------------------------------------------------
ProgrammingError Traceback (most recent call last)
~/frappe-bench/apps/frappe/frappe/commands/utils.py in <module>
1 import frappe
----> 2 frappe.reload_doc('website', 'doctype', 'Website Settings')
3 frappe.db.commit()
~/frappe-bench/apps/frappe/frappe/__init__.py in reload_doc(module, dt, dn, force, reset_permissions)
920
921 import frappe.modules
--> 922 return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
923
924 @whitelist()
~/frappe-bench/apps/frappe/frappe/modules/utils.py in reload_doc(module, dt, dn, force, reset_permissions)
173 def reload_doc(module, dt=None, dn=None, force=False, reset_permissions=False):
174 from frappe.modules.import_file import import_files
--> 175 return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
176
177 def export_doc(doctype, name, module=None):
~/frappe-bench/apps/frappe/frappe/modules/import_file.py in import_files(module, dt, dn, force, pre_process, reset_permissions)
28 return out
29 else:
---> 30 return import_file(module, dt, dn, force=force, pre_process=pre_process,
31 reset_permissions=reset_permissions)
32
~/frappe-bench/apps/frappe/frappe/modules/import_file.py in import_file(module, dt, dn, force, pre_process, reset_permissions)
34 """Sync a file from txt if modifed, return false if not updated"""
35 path = get_file_path(module, dt, dn)
---> 36 ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
37 return ret
38
~/frappe-bench/apps/frappe/frappe/modules/import_file.py in import_file_by_path(path, force, data_import, pre_process, ignore_version, reset_permissions, for_sync)
67
68 frappe.flags.in_import = True
---> 69 import_doc(doc, force=force, data_import=data_import, pre_process=pre_process,
70 ignore_version=ignore_version, reset_permissions=reset_permissions)
71 frappe.flags.in_import = False
~/frappe-bench/apps/frappe/frappe/modules/import_file.py in import_doc(docdict, force, data_import, pre_process, ignore_version, reset_permissions)
106 controller.prepare_for_import(docdict)
107
--> 108 doc = frappe.get_doc(docdict)
109
110 # Note on Tree DocTypes:
~/frappe-bench/apps/frappe/frappe/__init__.py in get_doc(*args, **kwargs)
848 """
849 import frappe.model.document
--> 850 doc = frappe.model.document.get_doc(*args, **kwargs)
851
852 # set in cache
~/frappe-bench/apps/frappe/frappe/model/document.py in get_doc(*args, **kwargs)
72 controller = get_controller(doctype)
73 if controller:
---> 74 return controller(*args, **kwargs)
75
76 raise ImportError(doctype)
~/frappe-bench/apps/frappe/frappe/model/document.py in __init__(self, *args, **kwargs)
119 if kwargs:
120 # init base document
--> 121 super(Document, self).__init__(kwargs)
122 self.init_valid_columns()
123
~/frappe-bench/apps/frappe/frappe/model/base_document.py in __init__(self, d)
80
81 def __init__(self, d):
---> 82 self.update(d)
83 self.dont_update_if_missing = []
84
~/frappe-bench/apps/frappe/frappe/model/base_document.py in update(self, d)
111
112 for key, value in iteritems(d):
--> 113 self.set(key, value)
114
115 return self
~/frappe-bench/apps/frappe/frappe/model/base_document.py in set(self, key, value, as_value)
158 if isinstance(value, list) and not as_value:
159 self.__dict__[key] = []
--> 160 self.extend(key, value)
161 else:
162 self.__dict__[key] = value
~/frappe-bench/apps/frappe/frappe/model/base_document.py in extend(self, key, value)
204 if isinstance(value, list):
205 for v in value:
--> 206 self.append(key, v)
207 else:
208 raise ValueError
~/frappe-bench/apps/frappe/frappe/model/base_document.py in append(self, key, value)
181 if not self.__dict__.get(key):
182 self.__dict__[key] = []
--> 183 value = self._init_child(value, key)
184 self.__dict__[key].append(value)
185
~/frappe-bench/apps/frappe/frappe/model/base_document.py in _init_child(self, value, key)
220 raise AttributeError(key)
221
--> 222 value = get_controller(value["doctype"])(value)
223 value.init_valid_columns()
224
~/frappe-bench/apps/frappe/frappe/model/document.py in __init__(self, *args, **kwargs)
120 # init base document
121 super(Document, self).__init__(kwargs)
--> 122 self.init_valid_columns()
123
124 else:
~/frappe-bench/apps/frappe/frappe/model/base_document.py in init_valid_columns(self)
284 self.__dict__[key] = 0
285
--> 286 for key in self.get_valid_columns():
287 if key not in self.__dict__:
288 self.__dict__[key] = None
~/frappe-bench/apps/frappe/frappe/model/base_document.py in get_valid_columns(self)
292 if self.doctype in DOCTYPES_FOR_DOCTYPE:
293 from frappe.model.meta import get_table_columns
--> 294 valid = get_table_columns(self.doctype)
295 else:
296 valid = self.meta.get_valid_columns()
~/frappe-bench/apps/frappe/frappe/model/meta.py in get_table_columns(doctype)
47
48 def get_table_columns(doctype):
---> 49 return frappe.db.get_table_columns(doctype)
50
51 def load_doctype_from_file(doctype):
~/frappe-bench/apps/frappe/frappe/database/database.py in get_table_columns(self, doctype)
894 columns = self.get_db_table_columns('tab' + doctype)
895 if not columns:
--> 896 raise self.TableMissingError('DocType', doctype)
897 return columns
898
ProgrammingError: ('DocType', 'DocType Action')
In [3]: frappe.reload_doc('website', 'doctype', 'Website Settings')
---------------------------------------------------------------------------
ProgrammingError Traceback (most recent call last)
~/frappe-bench/apps/frappe/frappe/commands/utils.py in <module>
----> 1 frappe.reload_doc('website', 'doctype', 'Website Settings')
~/frappe-bench/apps/frappe/frappe/__init__.py in reload_doc(module, dt, dn, force, reset_permissions)
920
921 import frappe.modules
--> 922 return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
923
924 @whitelist()
~/frappe-bench/apps/frappe/frappe/modules/utils.py in reload_doc(module, dt, dn, force, reset_permissions)
173 def reload_doc(module, dt=None, dn=None, force=False, reset_permissions=False):
174 from frappe.modules.import_file import import_files
--> 175 return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
176
177 def export_doc(doctype, name, module=None):
~/frappe-bench/apps/frappe/frappe/modules/import_file.py in import_files(module, dt, dn, force, pre_process, reset_permissions)
28 return out
29 else:
---> 30 return import_file(module, dt, dn, force=force, pre_process=pre_process,
31 reset_permissions=reset_permissions)
32
~/frappe-bench/apps/frappe/frappe/modules/import_file.py in import_file(module, dt, dn, force, pre_process, reset_permissions)
34 """Sync a file from txt if modifed, return false if not updated"""
35 path = get_file_path(module, dt, dn)
---> 36 ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
37 return ret
38
~/frappe-bench/apps/frappe/frappe/modules/import_file.py in import_file_by_path(path, force, data_import, pre_process, ignore_version, reset_permissions, for_sync)
67
68 frappe.flags.in_import = True
---> 69 import_doc(doc, force=force, data_import=data_import, pre_process=pre_process,
70 ignore_version=ignore_version, reset_permissions=reset_permissions)
71 frappe.flags.in_import = False
~/frappe-bench/apps/frappe/frappe/modules/import_file.py in import_doc(docdict, force, data_import, pre_process, ignore_version, reset_permissions)
106 controller.prepare_for_import(docdict)
107
--> 108 doc = frappe.get_doc(docdict)
109
110 # Note on Tree DocTypes:
~/frappe-bench/apps/frappe/frappe/__init__.py in get_doc(*args, **kwargs)
848 """
849 import frappe.model.document
--> 850 doc = frappe.model.document.get_doc(*args, **kwargs)
851
852 # set in cache
~/frappe-bench/apps/frappe/frappe/model/document.py in get_doc(*args, **kwargs)
72 controller = get_controller(doctype)
73 if controller:
---> 74 return controller(*args, **kwargs)
75
76 raise ImportError(doctype)
~/frappe-bench/apps/frappe/frappe/model/document.py in __init__(self, *args, **kwargs)
119 if kwargs:
120 # init base document
--> 121 super(Document, self).__init__(kwargs)
122 self.init_valid_columns()
123
~/frappe-bench/apps/frappe/frappe/model/base_document.py in __init__(self, d)
80
81 def __init__(self, d):
---> 82 self.update(d)
83 self.dont_update_if_missing = []
84
~/frappe-bench/apps/frappe/frappe/model/base_document.py in update(self, d)
111
112 for key, value in iteritems(d):
--> 113 self.set(key, value)
114
115 return self
~/frappe-bench/apps/frappe/frappe/model/base_document.py in set(self, key, value, as_value)
158 if isinstance(value, list) and not as_value:
159 self.__dict__[key] = []
--> 160 self.extend(key, value)
161 else:
162 self.__dict__[key] = value
~/frappe-bench/apps/frappe/frappe/model/base_document.py in extend(self, key, value)
204 if isinstance(value, list):
205 for v in value:
--> 206 self.append(key, v)
207 else:
208 raise ValueError
~/frappe-bench/apps/frappe/frappe/model/base_document.py in append(self, key, value)
181 if not self.__dict__.get(key):
182 self.__dict__[key] = []
--> 183 value = self._init_child(value, key)
184 self.__dict__[key].append(value)
185
~/frappe-bench/apps/frappe/frappe/model/base_document.py in _init_child(self, value, key)
220 raise AttributeError(key)
221
--> 222 value = get_controller(value["doctype"])(value)
223 value.init_valid_columns()
224
~/frappe-bench/apps/frappe/frappe/model/document.py in __init__(self, *args, **kwargs)
120 # init base document
121 super(Document, self).__init__(kwargs)
--> 122 self.init_valid_columns()
123
124 else:
~/frappe-bench/apps/frappe/frappe/model/base_document.py in init_valid_columns(self)
284 self.__dict__[key] = 0
285
--> 286 for key in self.get_valid_columns():
287 if key not in self.__dict__:
288 self.__dict__[key] = None
~/frappe-bench/apps/frappe/frappe/model/base_document.py in get_valid_columns(self)
292 if self.doctype in DOCTYPES_FOR_DOCTYPE:
293 from frappe.model.meta import get_table_columns
--> 294 valid = get_table_columns(self.doctype)
295 else:
296 valid = self.meta.get_valid_columns()
~/frappe-bench/apps/frappe/frappe/model/meta.py in get_table_columns(doctype)
47
48 def get_table_columns(doctype):
---> 49 return frappe.db.get_table_columns(doctype)
50
51 def load_doctype_from_file(doctype):
~/frappe-bench/apps/frappe/frappe/database/database.py in get_table_columns(self, doctype)
894 columns = self.get_db_table_columns('tab' + doctype)
895 if not columns:
--> 896 raise self.TableMissingError('DocType', doctype)
897 return columns
898
ProgrammingError: ('DocType', 'DocType Action')