ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Unable to change Company Name

bug

#1

Hi, I’m trying to update our company name by doing:
1- Company List
2- Open the Company
3- Menu -> Rename
4- ‘Some Cie Name’ -> Rename

But I’m getting this error:

Traceback (most recent call last):
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 1019, in call
    return fn(*args, **newargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 47, in rename_doc
    update_link_field_values(link_fields, old, new, doctype)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 205, in update_link_field_values
    single_doc.save(ignore_permissions=True)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 260, in save
    return self._save(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 313, in _save
    self.run_post_save_methods()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 905, in run_post_save_methods
    self.run_method("on_update")
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/erpnext/erpnext/setup/doctype/global_defaults/global_defaults.py", line 30, in on_update
    frappe.db.set_default(key, self.get(keydict[key], ''))
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py", line 780, in set_default
    frappe.defaults.set_default(key, val, parent, parenttype)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/defaults.py", line 134, in set_default
    add_default(key, value, parent)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/defaults.py", line 147, in add_default
    d.insert(ignore_permissions=True)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 211, in insert
    self._set_defaults()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 593, in _set_defaults
    new_doc = frappe.new_doc(self.doctype, as_dict=True)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 655, in new_doc
    return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 20, in get_new_doc
    frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 41, in make_new_doc
    set_user_and_static_default_values(doc)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/create_new.py", line 51, in set_user_and_static_default_values
    user_permissions = get_user_permissions()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/user_permission/user_permission.py", line 73, in get_user_permissions
    decendants = frappe.db.get_descendants(perm.allow, perm.for_value)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py", line 970, in get_descendants
    lft, rgt = self.get_value(doctype, name, ('lft', 'rgt'))
TypeError: 'NoneType' object is not iterable

Does anyone have a clue on what is hapening here?


#2

Hi.

This is a permission issue. Assuming your on latest Erpnext (v11.1.10), try logging in administrator and try again.

I have just changed the name and it works.

Thanks.


#3

I’m logged as Admin, but the versions are :
ERPNext: v11.1.3 (staging)
Frappe Framework: v11.1.3 (staging)


#4

Is there a reason your on staging and not on master?