I created a quotation using Frappe CRM, and after that, I want to use the ‘Create’ button in the quotation to create a sales order, but I am encountering this error. This issue only occurs with quotations created in Frappe CRM; when I create a normal quotation in ERPNext and then create a sales order, it works perfectly.
error log file
Title
'NoneType' object has no attribute 'get'
method
Error
Traceback with variables (most recent call last):
File "apps/frappe/frappe/app.py", line 114, in application
response = frappe.api.handle(request)
request = <Request 'https://sitename/api/method/frappe.model.mapper.make_mapped_doc' [POST]>
response = None
rollback = True
e = AttributeError("'NoneType' object has no attribute 'get'")
File "apps/frappe/frappe/api/__init__.py", line 49, in handle
data = endpoint(**arguments)
request = <Request 'https://sitename/api/method/frappe.model.mapper.make_mapped_doc' [POST]>
endpoint = <function handle_rpc_call at 0x7f08f7eec0d0>
arguments = {'method': 'frappe.model.mapper.make_mapped_doc'}
File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
method = 'frappe.model.mapper.make_mapped_doc'
frappe = <module 'frappe' from 'apps/frappe/frappe/__init__.py'>
File "apps/frappe/frappe/handler.py", line 49, in handle
data = execute_cmd(cmd)
cmd = 'frappe.model.mapper.make_mapped_doc'
data = None
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
cmd = 'frappe.model.mapper.make_mapped_doc'
from_async = False
server_script = None
method = <function make_mapped_doc at 0x7f08f5dca7a0>
File "apps/frappe/frappe/__init__.py", line 1775, in call
return fn(*args, **newargs)
fn = <function make_mapped_doc at 0x7f08f5dca7a0>
args = ()
kwargs = {'method': 'erpnext.selling.doctype.quotation.quotation.make_sales_order', 'source_name': 'SAL-QTN-2024-00003', 'args': '', 'selected_children': '{}', 'cmd': 'frappe.model.mapper.make_mapped_doc'}
newargs = {'method': 'erpnext.selling.doctype.quotation.quotation.make_sales_order', 'source_name': 'SAL-QTN-2024-00003', 'args': '', 'selected_children': '{}'}
File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
args = ()
kwargs = {'method': 'erpnext.selling.doctype.quotation.quotation.make_sales_order', 'source_name': 'SAL-QTN-2024-00003', 'args': '', 'selected_children': '{}'}
apply_condition = <function whitelist.<locals>.innerfn.<locals>.<lambda> at 0x7f08f5dca710>
func = <function make_mapped_doc at 0x7f08f5dca680>
File "apps/frappe/frappe/model/mapper.py", line 36, in make_mapped_doc
return method(source_name)
method = <function make_sales_order at 0x7f08f0dcd240>
source_name = 'SAL-QTN-2024-00003'
selected_children = {}
args = ''
File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
args = ['SAL-QTN-2024-00003']
kwargs = {}
apply_condition = <function whitelist.<locals>.innerfn.<locals>.<lambda> at 0x7f08f0dcc280>
func = <function make_sales_order at 0x7f08f0dcd000>
File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 351, in make_sales_order
return _make_sales_order(source_name, target_doc)
source_name = 'SAL-QTN-2024-00003'
target_doc = None
quotation = {'transaction_date': datetime.date(2024, 9, 30), 'valid_till': datetime.date(2024, 10, 30)}
File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 422, in _make_sales_order
doclist = get_mapped_doc(
source_name = 'SAL-QTN-2024-00003'
target_doc = None
set_missing_values = <function _make_sales_order.<locals>.set_missing_values at 0x7f08f5b612d0>
update_item = <function _make_sales_order.<locals>.update_item at 0x7f08f5b63250>
can_map_row = <function _make_sales_order.<locals>.can_map_row at 0x7f08f0c43d90>
customer = None
ignore_permissions = False
ordered_items = {}
selected_rows = []
File "apps/frappe/frappe/model/mapper.py", line 155, in get_mapped_doc
postprocess(source_doc, target_doc)
from_doctype = 'Quotation'
from_docname = 'SAL-QTN-2024-00003'
table_maps = {'Quotation': {'doctype': 'Sales Order', 'validation': {'docstatus': ['=', 1]}}, 'Quotation Item': {'doctype': 'Sales Order Item', 'field_map': {'parent': 'prevdoc_docname', 'name': 'quotation_item'}, 'postprocess': <function _make_sales_order.<locals>.update_item at 0x7f08f5b63250>, 'condition': <function _make_sales_order.<locals>.can_map_row at 0x7f08f0c43d90>}, 'Sales Taxes and Charges': {'doctype': 'Sales Taxes and Charges', 'add_if_empty': True}, 'Sales Team': {'doctype': 'Sales Team', 'add_if_empty': True}, 'Payment Schedule': {'doctype': 'Payment Schedule', 'add_if_empty': True}}
target_doc = <SalesOrder: unsaved>
postprocess = <function _make_sales_order.<locals>.set_missing_values at 0x7f08f5b612d0>
ignore_permissions = False
ignore_child_tables = False
cached = False
apply_strict_user_permissions = 0
source_doc = <Quotation: SAL-QTN-2024-00003 docstatus=1>
row_exists_for_parentfield = {'items': False, 'taxes': False, 'payment_schedule': False}
df = <Table MultiSelectDocField: competitors parent=Quotation>
source_child_doctype = 'Competitor Detail'
table_map = None
target_df = None
target_child_doctype = 'Payment Schedule'
target_parentfield = 'payment_schedule'
source_d = <PaymentSchedule: jafpub7i29 docstatus=1 parent=SAL-QTN-2024-00003>
File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 380, in set_missing_values
for d in customer.get("sales_team") or []:
source = <Quotation: SAL-QTN-2024-00003 docstatus=1>
target = <SalesOrder: unsaved>
customer = None
ignore_permissions = False
builtins.AttributeError: 'NoneType' object has no attribute 'get'