From 90ddf1c0f0bd7e7bd8a932d3e21c0829cf60ff28 Mon Sep 17 00:00:00 2001 From: MOHAMMED NIYAS <76736615+niyazrazak@users.noreply.github.com> Date: Thu, 18 May 2023 10:23:58 +0530 Subject: [PATCH] fix: create sales order Getting error while clicking create sales order button from quotation Taceback (most recent call last): File "apps/frappe/frappe/app.py", line 66, in application response = frappe.api.handle() File "apps/frappe/frappe/api.py", line 54, in handle return frappe.handler.handle() File "apps/frappe/frappe/handler.py", line 45, in handle data = execute_cmd(cmd) File "apps/frappe/frappe/handler.py", line 83, in execute_cmd return frappe.call(method, **frappe.form_dict) File "apps/frappe/frappe/__init__.py", line 1607, in call return fn(*args, **newargs) File "apps/frappe/frappe/model/mapper.py", line 36, in make_mapped_doc return method(source_name) File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 263, in make_sales_order return _make_sales_order(source_name, target_doc) File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 333, in _make_sales_order doclist = get_mapped_doc( File "apps/frappe/frappe/model/mapper.py", line 144, in get_mapped_doc postprocess(source_doc, target_doc) File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 291, in set_missing_values for d in customer.get("sales_team"): TypeError: 'NoneType' object is not iterable --- erpnext/selling/doctype/quotation/quotation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 693fc92ce9..0cab21fa30 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -288,7 +288,7 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): ) # sales team - for d in customer.get("sales_team"): + for d in customer.get("sales_team", []): target.append( "sales_team", {