Unable to create a New Company

how to solve this?

Looks like the autogenerated Company abbreviation is the same as an existing company - could you please verify?

If you are Duplicating the Current Company. Maybe Warehouse Filed is Duplicated.

Nope I have no comapny created before…No duplication at all…
when ever i try to change name whatsoever, same error remains

Hi,
Can you share the console log error message for further clarification.

I think, same issue:

request.js:279

   POST http://mysite.com:8000/api/method/frappe.desk.form.save.savedocs 417 (EXPECTATION FAILED)

send @ jquery.js:9930
ajax @ jquery.js:9511
frappe.request.call @ request.js:279
frappe.call @ request.js:109
_call @ save.js:246
save @ save.js:23
frappe.ui.form.save @ save.js:273
(anonymous) @ form.js:820
Promise.then (async)
(anonymous) @ dom.js:262
frappe.run_serially @ dom.js:260
validate_and_save @ form.js:811
(anonymous) @ form.js:750
save @ form.js:747
Save @ toolbar.js:687
(anonymous) @ page.js:281
dispatch @ jquery.js:5135
elemData.handle @ jquery.js:4939
Show 4 more frames
Show less
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 1715, 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/desk/form/save.py”, line 39, in savedocs
doc.save()
File “apps/frappe/frappe/model/document.py”, line 334, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 356, in save
return self.insert()
File “apps/frappe/frappe/model/document.py”, line 310, in insert
self.run_post_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1118, in run_post_save_methods
self.run_method(“on_update”)
File “apps/frappe/frappe/model/document.py”, line 950, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1316, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1298, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/document.py”, line 947, in fn
return method_object(*args, **kwargs)
File “apps/erpnext/erpnext/setup/doctype/company/company.py”, line 224, in on_update
self.create_default_warehouses()
File “apps/erpnext/erpnext/setup/doctype/company/company.py”, line 283, in create_default_warehouses
warehouse.insert()
File “apps/frappe/frappe/model/document.py”, line 286, in insert
self.run_before_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1081, in run_before_save_methods
self.run_method(“validate”)
File “apps/frappe/frappe/model/document.py”, line 950, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1316, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1300, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File “apps/nbpos/nbpos/nbpos/hooks/warehouse.py”, line 8, in validate_hub_manager
frappe.throw(
(“Already been used in some another warehouse.”))
File “apps/frappe/frappe/init.py”, line 603, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 575, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 526, in _raise_exception
raise exc
frappe.exceptions.ValidationError: Already been used in some another warehouse.

(anonymous) @ request.js:473
frappe.request.cleanup @ request.js:471
(anonymous) @ request.js:325
fire @ jquery.js:3213
fireWith @ jquery.js:3343
done @ jquery.js:9619
(anonymous) @ jquery.js:9878
load (async)
send @ jquery.js:9897
ajax @ jquery.js:9511
frappe.request.call @ request.js:279
frappe.call @ request.js:109
_call @ save.js:246
save @ save.js:23
frappe.ui.form.save @ save.js:273
(anonymous) @ form.js:820
Promise.then (async)
(anonymous) @ dom.js:262
frappe.run_serially @ dom.js:260
validate_and_save @ form.js:811
(anonymous) @ form.js:750
save @ form.js:747
Save @ toolbar.js:687
(anonymous) @ page.js:281
dispatch @ jquery.js:5135
elemData.handle @ jquery.js:4939
Show 8 more frames
Show less

Please read this post.

import frappe
from frappe import _

def validate_hub_manager(doc, method):
warehouse = frappe.get_value(‘Warehouse’, {‘hub_manager’: doc.hub_manager}, ‘name’)
if warehouse:
frappe.throw(_(“Already been used in some another warehouse.”))

read this:

But I dont want to remove custom app

Then you have to set the conditions your according to the scenario in your own way.