KeyError: 'Section Break'

We are trying to migrate from V11 to V13 and have encountered this error when trying to save a new Stock Entry. Has anyone come across it before?

Traceback (most recent call last):
File “apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “apps/frappe/frappe/model/document.py”, line 287, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 309, in _save
return self.insert()
File “apps/frappe/frappe/model/document.py”, line 241, in insert
self._validate()
File “apps/frappe/frappe/model/document.py”, line 501, in _validate
self._validate_length()
File “apps/frappe/frappe/model/base_document.py”, line 720, in _validate_length
column_type = type_map[df.fieldtype][0] or None
KeyError: ‘Section Break’

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 68, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 31, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 68, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1214, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “apps/frappe/frappe/model/document.py”, line 287, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 309, in _save
return self.insert()
File “apps/frappe/frappe/model/document.py”, line 241, in insert
self._validate()
File “apps/frappe/frappe/model/document.py”, line 501, in _validate
self._validate_length()
File “apps/frappe/frappe/model/base_document.py”, line 720, in _validate_length
column_type = type_map[df.fieldtype][0] or None
KeyError: ‘Section Break’

This is the data that we were trying to save at the time of the error.

“args”: {
“doc”: “{"name":"new-stock-entry-2",
"owner":"@.com",
"creation":null,
"modified":null,
"modified_by":null,
"parent":null,
"parentfield":null,
"parenttype":null,
"idx":0,
"docstatus":0,
"title":null,
"naming_series":"MAT-STE-.YYYY.-",
"stock_entry_type":"Material Transfer for Manufacture",
"outgoing_stock_entry":null,
"purpose":"Material Transfer for Manufacture",
"add_to_transit":0,
"work_order":"WO-00191",
"purchase_order":null,
"delivery_note_no":null,
"sales_invoice_no":null,
"pick_list":null,
"purchase_receipt_no":null,
"company":"*** Manufacturing Ltd",
"posting_date":"2022-02-05",
"posting_time":"14:10:20.190386",
"stock_requisition_id":null,
"set_posting_time":1,
"inspection_required":0,
"from_bom":1,
"apply_putaway_rule":0,
"bom_no":"BOM-C-10645-001",
"fg_completed_qty":31,
"use_multi_level_bom":1,
"from_warehouse":null,
"source_warehouse_address":null,
"source_address_display":null,
"to_warehouse":"******* R&D Workshop - ",
"target_warehouse_address":null,
"target_address_display":null,
"scan_barcode":null,
"total_incoming_value":0.14,
"total_outgoing_value":0.14,
"value_difference":0,
"total_additional_costs":0,
"supplier":null,
"supplier_name":null,
"supplier_address":null,
"address_display":null,
"project":null,
"select_print_heading":null,
"letter_head":"
",
"is_opening":"No",
"remarks":null,
"per_transferred":0,
"total_amount":0.14,
"job_card":null,
"amended_from":null,
"credit_note":null,
"pch_operative1":null,
"inspected_by":null,
"stamping_present":0,
"rfid_tag_installed":0,
"rfid_tag_tested":0,
"ukca_ce_label_checked":0,
"id_checked":0,
"_inspection_date":"2022-02-21",
"assembly_sheet_completed":0,
"fat_checked":0,
"doc_pack_completed":0,
"tools_removed":0,
"protective_packing":0,
"drift_operation_performed":0,
"drift_serial_no":null,
"drift_diameter":null,
"drift_length":null,
"is_return":0,
"doctype":"Stock Entry",
"items":[{"name":"new-stock-entry-detail-2",
"owner":null,
"creation":null,
"modified":null,
"modified_by":null,
"parent":"new-stock-entry-2",
"parentfield":"items",
"parenttype":"Stock Entry",
"idx":1,
"docstatus":0,
"barcode":null,
"s_warehouse":"******* Raw Material Stock - ",
"t_warehouse":"
**** R&D Workshop - ***",
"item_code":"EMS-002-4500-1000",
"rfid_tag_id":null,
"item_name":"AISI 4140 Ksi Type Steel",
"revision_number":"0",
"is_finished_item":0,
"is_scrap_item":0,
"is_process_loss":0,
"quality_inspection":null,
"subcontracted_item":null,
"description":"

AISI 4140 Ksi Type Steel

EMS-002 4.5\" OD
1000mm pieces
",
"item_group":null,
"image":null,
"qty":1,
"transfer_qty":1,
"retain_sample":0,
"uom":"Millimeter",
"stock_uom":"Millimeter",
"conversion_factor":1,
"sample_quantity":0,
"basic_rate":0.14,
"additional_cost":0,
"valuation_rate":0.14,
"allow_zero_valuation_rate":0,
"set_basic_rate_manually":0,
"basic_amount":0.14,
"amount":0.14,
"serial_no":null,
"batch_no":"73",
"expense_account":"Stock Adjustment - ***",
"pch_source_location":null,
"pch_rarb_location_src":null,
"cost_center":"Main - ***",
"pch_target_warehosue":null,
"pch_rarb_location_trg":null,
"project":null,
"actual_qty":16160,
"transferred_qty":0,
"bom_no":null,
"allow_alternative_item":1,
"material_request":null,
"material_request_item":null,
"original_item":null,
"against_stock_entry":null,
"ste_detail":null,
"po_detail":null,
"putaway_rule":null,
"reference_purchase_receipt":null,
"job_card_item":null,
"doctype":"Stock Entry Detail",
"__islocal":1}],
"additional_costs":,
"__islocal":1,
"__unsaved":1,
"__last_sync_on":"2022-02-21T14:10:20.415Z",
"customer_address":null,
"customer_name":null,
"customer":null}”,
“action”: “Save”
},

We found the problem was caused by a conflict in field names in the DocType description. We had a custom Section Break called pick_list and there is new Pick List DocType, a link to it was also called pick_list. We renamed the Section Break and everything went back to normal.

Lesson learned: Always be verbose when picking field names.