Cannot delete or cancel because Company is linked with Global Defaults

Hello,

What i can do if i want to delete one company which is already there in global defaults and set another company as global default company.

Hi @pm23,

Remove the Company from the Global Default.
Then reload (Ctrl + Shift + R) and try to delete it.

Thank You!

@NCP still same

Please share the console log when you delete the company.

@NCP

can you share the full console log (f12) and paste here.

And is it version 15 or develop version? @pm23

@NCP

localStorage cleared
assets.js:27 Cleared App Cache.
assets.js:70 localStorage cleared
desk.js:115 Using this console may allow attackers to impersonate you and steal your information. Do not enter or paste code that you do not understand.
:9000/socket.io/?EIO=4&transport=polling&t=OwUamlk:1

   Failed to load resource: net::ERR_CONNECTION_TIMED_OUT

:9000/socket.io/?EIO=4&transport=polling&t=OwUartk:1

   Failed to load resource: net::ERR_CONNECTION_TIMED_OUT

:9000/socket.io/?EIO=4&transport=polling&t=OwUasii:1

   Failed to load resource: net::ERR_CONNECTION_TIMED_OUT

:9000/socket.io/?EIO=4&transport=polling&t=OwUaxhZ:1

   Failed to load resource: net::ERR_CONNECTION_TIMED_OUT

moment.js:287 Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to Moment.js | Guides for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: true, _useUTC: true, _l: undefined, _i: undefined, _f: undefined, _strict: undefined, _locale: [object Object]
Error
at Function.createFromInputFallback (https://erpdemo.sdctechs.in/assets/frappe/dist/js/libs.bundle.LLRFRX7M.js:11268:92)
at configFromString (https://erpdemo.sdctechs.in/assets/frappe/dist/js/libs.bundle.LLRFRX7M.js:12805:19)
at configFromInput (https://erpdemo.sdctechs.in/assets/frappe/dist/js/libs.bundle.LLRFRX7M.js:13098:13)
at prepareConfig (https://erpdemo.sdctechs.in/assets/frappe/dist/js/libs.bundle.LLRFRX7M.js:13084:13)
at createFromConfig (https://erpdemo.sdctechs.in/assets/frappe/dist/js/libs.bundle.LLRFRX7M.js:13059:46)
at createLocalOrUTC (https://erpdemo.sdctechs.in/assets/frappe/dist/js/libs.bundle.LLRFRX7M.js:13131:18)
at createUTC (https://erpdemo.sdctechs.in/assets/frappe/dist/js/libs.bundle.LLRFRX7M.js:11113:18)
at Function.y [as tz] (https://erpdemo.sdctechs.in/assets/frappe/dist/js/libs.bundle.LLRFRX7M.js:15082:127)
at Object.convert_to_user_tz (https://erpdemo.sdctechs.in/assets/frappe/dist/js/desk.bundle.2V2Z2INW.js:41066:27)
at prettyDate (https://erpdemo.sdctechs.in/assets/frappe/dist/js/desk.bundle.2V2Z2INW.js:40914:30)
warn @ moment.js:287
Show 1 more frame
Show less
/app/global-defaults/Global%20Defaults:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
draw.js:40 Error: attribute width: A negative value is not valid. (“-10”)
j @ draw.js:40
Show 1 more frame
Show less
animation.js:89 Error: attribute width: A negative value is not valid. (“-10”)
pt @ animation.js:89
Show 1 more frame
Show less
/api/method/frappe.client.delete:1

   Failed to load resource: the server responded with a status of 417 (EXPECTATION FAILED)

request.js:473 Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 110, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/init.py”, line 49, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api/v1.py”, line 36, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 49, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1684, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/utils/typing_validations.py”, line 31, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/client.py”, line 275, in delete
delete_doc(doctype, name)
File “apps/frappe/frappe/client.py”, line 506, in delete_doc
frappe.delete_doc(doctype, name, ignore_missing=False)
File “apps/frappe/frappe/init.py”, line 1326, in delete_doc
return frappe.model.delete_doc.delete_doc(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/delete_doc.py”, line 118, in delete_doc
check_if_doc_is_linked(doc)
File “apps/frappe/frappe/model/delete_doc.py”, line 270, in check_if_doc_is_linked
raise_link_exists_exception(doc, link_dt, link_dt)
File “apps/frappe/frappe/model/delete_doc.py”, line 366, in raise_link_exists_exception
frappe.throw(
File “apps/frappe/frappe/init.py”, line 578, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 550, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 501, in _raise_exception
raise exc
frappe.exceptions.LinkExistsError: Cannot delete or cancel because Company Tapovan Impex Pvt. Ltd. (Demo) is linked with Global Defaults

(anonymous) @ request.js:473

Hi @pm23,

We tested in the latest version 15 but we haven’t found the issue.

Please stop the bench or restart the bench. and migrate the site and try to delete it.

Thank You!

@NCP Still same. Let it be I will drop that site.

Thanks

:sweat_smile: @pm23

Last suggestion, please update the bench and check it. (update the version)