Frappe CRM Issue when enable the customer create on status change in Setting

When I enable the setting of frappe CRM,
when the deal status is won, the customer is created in erpnext, but I get an error or the customer is not created,

I am putting the screen shot below for better understanding.

Setting Image.

Error when we change the deal status

Status is changing but customer is not being created and error is coming.

If someone solved this issue please share the solution.

Thank You.

Can you share your sitename is it on frappecloud? Can I test?

site is not on frappecloud, it is on our personal server.

At least share the error log

You should consider using frappecloud, It is easier for us to verify and fix bugs, quick and easy version upgrades and there are many more advantages

Error from console.

request.js:473 Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 114, 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 1775, 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 337, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 390, in _save
self.run_post_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1128, in run_post_save_methods
self.run_method(“on_update”)
File “apps/frappe/frappe/model/document.py”, line 962, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1322, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1306, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File “apps/crm/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py”, line 199, in create_customer_in_erpnext
address = get_organization_address(doc.organization)
File “apps/crm/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py”, line 177, in get_organization_address
“name”: address.name,
AttributeError: ‘NoneType’ object has no attribute ‘name’

error from dialog in erpnext form

	### App Versions
	```
	{
		"crm": "1.23.4",
		"erpnext": "15.36.1",
		"frappe": "15.41.0",
		"helpdesk": "0.10.0",
		"india_compliance": "15.13.3",
		"print_designer": "1.4.2"
	}
	```
	### Route
	```
	Form/CRM Deal/CRM-DEAL-2024-00001
	```
	### Traceback
	```
	Traceback (most recent call last):
	  File "apps/frappe/frappe/app.py", line 114, 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 1775, 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 337, in save
	    return self._save(*args, **kwargs)
	  File "apps/frappe/frappe/model/document.py", line 390, in _save
	    self.run_post_save_methods()
	  File "apps/frappe/frappe/model/document.py", line 1128, in run_post_save_methods
	    self.run_method("on_update")
	  File "apps/frappe/frappe/model/document.py", line 962, in run_method
	    out = Document.hook(fn)(self, *args, **kwargs)
	  File "apps/frappe/frappe/model/document.py", line 1322, in composer
	    return composed(self, method, *args, **kwargs)
	  File "apps/frappe/frappe/model/document.py", line 1306, in runner
	    add_to_return_value(self, f(self, method, *args, **kwargs))
	  File "apps/crm/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py", line 199, in create_customer_in_erpnext
	    address = get_organization_address(doc.organization)
	  File "apps/crm/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py", line 177, in get_organization_address
	    "name": address.name,
	AttributeError: 'NoneType' object has no attribute 'name'
	
	```
	### Request Data
	```
	{
		"type": "POST",
		"args": {
			"doc": "{\"name\":\"CRM-DEAL-2024-00001\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 09:58:00.010903\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":2,\"naming_series\":\"CRM-DEAL-.YYYY.-\",\"organization\":\"asdf\",\"probability\":0,\"status\":\"Won\",\"deal_owner\":\"Administrator\",\"lead\":\"CRM-LEAD-2024-00001\",\"lead_name\":\"Mr Ash an\",\"website\":\"https://www.google.co.in/\",\"no_of_employees\":\"1-10\",\"territory\":\"\",\"currency\":\"INR\",\"annual_revenue\":60000,\"industry\":\"Software\",\"salutation\":\"Mr\",\"first_name\":\"Ash\",\"last_name\":\"an\",\"email\":\"as@gmail.com\",\"mobile_no\":\"0987654321\",\"phone\":\"\",\"gender\":\"Male\",\"sla_status\":\"\",\"communication_status\":\"Open\",\"doctype\":\"CRM Deal\",\"status_change_log\":[{\"name\":\"7b906sf1jl\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 09:58:00.019463\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"from\":\"Qualification\",\"to\":\"Ready to Close\",\"from_date\":\"2024-09-25 04:28:00.017435\",\"to_date\":\"2024-09-25 04:28:14.916360\",\"duration\":14.898925,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"7bdlm0i422\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 09:58:14.919778\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":2,\"from\":\"Ready to Close\",\"to\":\"Won\",\"from_date\":\"2024-09-25 04:28:14.916367\",\"to_date\":\"2024-09-25 04:35:57.392325\",\"duration\":462.475958,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"7fu5f9ptoi\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 10:05:57.397857\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":3,\"from\":\"Won\",\"to\":\"Ready to Close\",\"from_date\":\"2024-09-25 04:35:57.392332\",\"to_date\":\"2024-09-25 05:49:53.653945\",\"duration\":4436.261613,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"8r8ge5v20a\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 11:19:53.660553\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":4,\"from\":\"Ready to Close\",\"to\":\"Demo/Making\",\"from_date\":\"2024-09-25 05:49:53.653951\",\"to_date\":\"2024-09-25 05:50:51.987205\",\"duration\":58.333254,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"8rqnidkn37\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 11:20:51.990817\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":5,\"from\":\"Demo/Making\",\"to\":\"Ready to Close\",\"from_date\":\"2024-09-25 05:50:51.987212\",\"to_date\":\"2024-09-25 05:50:54.558023\",\"duration\":2.570811,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"8rrhli1hsu\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 11:20:54.561687\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":6,\"from\":\"Ready to Close\",\"to\":\"Qualification\",\"from_date\":\"2024-09-25 05:50:54.558030\",\"to_date\":\"2024-09-25 06:30:14.558877\",\"duration\":2360.000847,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"9it125p0gh\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 12:00:14.562812\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":7,\"from\":\"Qualification\",\"to\":\"Ready to Close\",\"from_date\":\"2024-09-25 06:30:14.558886\",\"to_date\":\"2024-09-25 06:30:20.357772\",\"duration\":5.798886,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"9iurhq87rf\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 12:00:20.361732\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":8,\"from\":\"Ready to Close\",\"to\":\"Won\",\"from_date\":\"2024-09-25 06:30:20.357779\",\"to_date\":\"2024-09-25 06:43:59.307019\",\"duration\":818.94924,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"9qupduglnc\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 12:13:59.311129\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":9,\"from\":\"Won\",\"to\":\"Ready to Close\",\"from_date\":\"2024-09-25 06:43:59.307025\",\"to_date\":\"2024-09-25 07:10:26.593715\",\"duration\":1587.28669,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"aaep97n28s\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 12:40:26.598616\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":10,\"from\":\"Ready to Close\",\"to\":\"Lost\",\"from_date\":\"2024-09-25 07:10:26.593722\",\"to_date\":\"2024-09-25 07:15:44.659733\",\"duration\":318.066011,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"adi6rgnt6r\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 12:45:44.664813\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":11,\"from\":\"Lost\",\"to\":\"Proposal/Quotation\",\"from_date\":\"2024-09-25 07:15:44.659740\",\"to_date\":\"2024-09-25 07:15:55.277303\",\"duration\":10.617563,\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"},{\"name\":\"adlg2qlh9g\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 12:45:55.282273\",\"modified\":\"2024-09-25 12:45:55.282273\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":12,\"from\":\"Proposal/Quotation\",\"to\":\"\",\"from_date\":\"2024-09-25 07:15:55.277309\",\"log_owner\":\"Administrator\",\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"status_change_log\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Status Change Log\"}],\"contacts\":[{\"name\":\"7b90c15aui\",\"owner\":\"Administrator\",\"creation\":\"2024-09-25 09:58:00.010903\",\"modified\":\"2024-09-25 12:45:55.262879\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"contact\":\"Ash an\",\"full_name\":\"Ash an\",\"email\":\"as@gmail.com\",\"gender\":\"Male\",\"mobile_no\":\"0987654321\",\"phone\":\"\",\"is_primary\":1,\"parent\":\"CRM-DEAL-2024-00001\",\"parentfield\":\"contacts\",\"parenttype\":\"CRM Deal\",\"doctype\":\"CRM Contacts\"}],\"__last_sync_on\":\"2024-09-25T07:47:33.756Z\",\"__unsaved\":1}",
			"action": "Save"
		},
		"btn": {
			"jQuery370025721656525713791": {
				"events": {
					"click": [
						{
							"type": "click",
							"origType": "click",
							"guid": 1352,
							"namespace": ""
						}
					]
				}
			}
		},
		"freeze": true,
		"headers": {},
		"error_handlers": {},
		"url": "/api/method/frappe.desk.form.save.savedocs",
		"request_id": null
	}
	```
	### Response Data
	```
	{
		"exception": "AttributeError: 'NoneType' object has no attribute 'name'",
		"exc_type": "AttributeError",
		"_exc_source": "crm (app)"
	}
	```

error from frappe crm ui

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 114, 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 1775, 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 188, in set_value
doc.save()
File “apps/frappe/frappe/model/document.py”, line 337, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 390, in _save
self.run_post_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1128, in run_post_save_methods
self.run_method(“on_update”)
File “apps/frappe/frappe/model/document.py”, line 962, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1322, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1306, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File “apps/crm/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py”, line 199, in create_customer_in_erpnext
address = get_organization_address(doc.organization)
File “apps/crm/crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py”, line 177, in get_organization_address
“name”: address.name,
AttributeError: ‘NoneType’ object has no attribute ‘name’

index-cac9d85b.js:262 Uncaught (in promise) Error: /api/method/frappe.client.set_value AttributeError
at Object.transformResponse (index-cac9d85b.js:262:1648)
at async Proxy.o (index-cac9d85b.js:260:3475)

let us know if more information you want from my side.

I have raised a fix, pull latest version v1.23.5