Erpnext Typeerror in sales invoice

“exception”: “TypeError: ‘<’ not supported between instances of ‘str’ and ‘int’”,

App Versions

{
	"agriculture": "0.0.1",
	"chat": "0.0.1",
	"education": "15.0.0",
	"erpnext": "15.19.2",
	"frappe": "15.20.0",
	"hrms": "15.16.0",
	"india_compliance": "15.7.1"
}

Route

Form/Sales Invoice/SI24B25/I/00011

Traceback

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 1718, 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 37, in savedocs
    doc.submit()
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1048, in submit
    return self._submit()
  File "apps/frappe/frappe/model/document.py", line 1031, in _submit
    return self.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 1131, in run_post_save_methods
    self.run_method("on_submit")
  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 1304, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 959, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py", line 442, in on_submit
    self.update_prevdoc_status()
  File "apps/erpnext/erpnext/controllers/status_updater.py", line 165, in update_prevdoc_status
    self.validate_qty()
  File "apps/erpnext/erpnext/controllers/status_updater.py", line 226, in validate_qty
    if hasattr(d, "qty") and d.qty < 0 and not self.get("is_return"):
TypeError: '<' not supported between instances of 'str' and 'int'

Request Data

{
	"type": "POST",
	"args": {
		"doc": "{\"name\":\"SI24B25/I/00011\",\"owner\":\"Administrator\",\"creation\":\"2024-04-19 17:26:55.154921\",\"modified\":\"2024-04-19 17:26:55.154921\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":0,\"title\":\"DIVINE TECHNOLOGIES\",\"custom_title_copy\":\"{customer_name}\",\"naming_series\":\"SI24B25/I./\",\"customer\":\"DIVINE TECHNOLOGIES\",\"customer_name\":\"DIVINE TECHNOLOGIES\",\"custom_sales_type\":\"B2B PRODUCT INDIA\",\"e_waybill_status\":\"\",\"company\":\"Softland India Ltd\",\"posting_date\":\"2024-04-19\",\"posting_time\":\"17:26:55.43259\",\"set_posting_time\":0,\"due_date\":\"2024-04-19\",\"custom_zone\":\"PN\",\"custom_region\":\"RA1\",\"custom_cluster\":\"CA1A\",\"is_pos\":0,\"is_consolidated\":0,\"is_return\":0,\"update_outstanding_for_self\":1,\"reason_for_issuing_document\":\"\",\"update_billed_amount_in_sales_order\":0,\"update_billed_amount_in_delivery_note\":1,\"is_debit_note\":0,\"is_reverse_charge\":0,\"is_export_with_gst\":0,\"custom_zonal_manager\":\"GEORGE MATHEW\",\"custom_regional_manager\":\"AMAL R\",\"custom_cluster_managers\":\"AMAL R\",\"currency\":\"INR\",\"conversion_rate\":1,\"selling_price_list\":\"Standard Selling\",\"price_list_currency\":\"INR\",\"plc_conversion_rate\":1,\"ignore_pricing_rule\":0,\"update_stock\":0,\"total_qty\":1,\"total_net_weight\":0,\"base_total\":12,\"base_net_total\":12,\"total\":12,\"net_total\":12,\"tax_category\":\"In-State\",\"taxes_and_charges\":\"Output GST In-state - SIL\",\"base_total_taxes_and_charges\":2.16,\"total_taxes_and_charges\":2.16,\"base_grand_total\":14.16,\"base_rounding_adjustment\":-0.16,\"base_rounded_total\":14,\"base_in_words\":\"\",\"grand_total\":14.16,\"rounding_adjustment\":-0.16,\"use_company_roundoff_cost_center\":0,\"rounded_total\":14,\"in_words\":\"\",\"total_advance\":0,\"outstanding_amount\":14,\"disable_rounded_total\":0,\"apply_discount_on\":\"Grand Total\",\"base_discount_amount\":0,\"is_cash_or_non_trade_discount\":0,\"additional_discount_percentage\":0,\"discount_amount\":0,\"other_charges_calculation\":\"<div class=\\\"tax-break-up\\\" style=\\\"overflow-x: auto;\\\">\\n\\t<table class=\\\"table table-bordered table-hover\\\">\\n\\t\\t<thead>\\n\\t\\t\\t<tr>\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t<th class=\\\"text-left\\\">HSN/SAC</th>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t<th class=\\\"text-right\\\">Taxable Amount</th>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t<th class=\\\"text-right\\\">SGST</th>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t<th class=\\\"text-right\\\">CGST</th>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t</tr>\\n\\t\\t</thead>\\n\\t\\t<tbody>\\n\\t\\t\\t\\n\\t\\t\\t\\t<tr>\\n\\t\\t\\t\\t\\t<td>90138010</td>\\n\\t\\t\\t\\t\\t<td class=\\\"text-right\\\">\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t₹ 12.00\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t</td>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t<td class=\\\"text-right\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t(9.0%)\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t₹ 1.08\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t</td>\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t<td class=\\\"text-right\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t(9.0%)\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t₹ 1.08\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t</td>\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t</tr>\\n\\t\\t\\t\\n\\t\\t</tbody>\\n\\t</table>\\n</div>\",\"gst_breakup_table\":\"<div class=\\\"tax-break-up\\\" style=\\\"overflow-x: auto\\\"><table class=\\\"table table-bordered table-hover\\\"><thead><tr><th class=\\\"text-left\\\">HSN/SAC</th><th class=\\\"text-right\\\">Taxable Amount</th><th class=\\\"text-right\\\">CGST</th><th class=\\\"text-right\\\">SGST</th></tr></thead><tbody><tr><td class=\\\"text-left\\\">90138010</td><td class=\\\"text-right\\\">₹ 12.00</td><td class=\\\"text-right\\\">(9.0%)&nbsp;₹ 1.08</td><td class=\\\"text-right\\\">(9.0%)&nbsp;₹ 1.08</td></tr></tbody></table></div>\",\"total_billing_hours\":0,\"total_billing_amount\":0,\"base_paid_amount\":0,\"paid_amount\":0,\"base_change_amount\":0,\"change_amount\":0,\"allocate_advances_automatically\":0,\"only_include_allocated_payments\":0,\"write_off_amount\":0,\"base_write_off_amount\":0,\"write_off_outstanding_amount_automatically\":0,\"redeem_loyalty_points\":0,\"loyalty_points\":0,\"loyalty_amount\":0,\"customer_address\":\"DIVINE TECHNOLOGIES\",\"address_display\":\"DIVINE TECHNOLOGIES 1ST FLOOR THAVAKKAL COMPLEX K.C.P XIII.1613C.7 TC ROAD, NEAR PT CHAKKO HOSPITAL IRITTY, KANNUR  PH: +919645490736<br>KANNUR<br>\\nKerala<br>670703<br>India<br>\\n\",\"billing_address_gstin\":\"32CPHPP9230H1ZT\",\"gst_category\":\"Registered Regular\",\"custom_pan\":\"CPHPP9230H\",\"place_of_supply\":\"32-Kerala\",\"contact_person\":\"DIVINE TECHNOLOGIES-DIVINE TECHNOLOGIES\",\"contact_display\":\"DIVINE TECHNOLOGIES\",\"contact_mobile\":\"0\",\"contact_email\":\"\",\"territory\":\"India\",\"shipping_address_name\":\"DIVINE TECHNOLOGIES\",\"shipping_address\":\"DIVINE TECHNOLOGIES 1ST FLOOR THAVAKKAL COMPLEX K.C.P XIII.1613C.7 TC ROAD, NEAR PT CHAKKO HOSPITAL IRITTY, KANNUR  PH: +919645490736<br>KANNUR<br>\\nKerala<br>670703<br>India<br>\\n\",\"company_address\":\"Softland India Ltd-Billing\",\"company_gstin\":\"32AADCS3676A1ZQ\",\"company_address_display\":\"Kinfra Small Industries Park, Menamkulam<br>St Xaviors College PO<br>Trivandrum<br>\\nKerala<br>695586<br>India<br>\\n\",\"ignore_default_payment_terms_template\":0,\"po_no\":\"\",\"debit_to\":\"Debtors - SIL\",\"party_account_currency\":\"INR\",\"is_opening\":\"No\",\"against_income_account\":\"Sales - SIL\",\"amount_eligible_for_commission\":12,\"commission_rate\":0,\"total_commission\":0,\"letter_head\":\"Sales Invoice\",\"group_same_items\":0,\"invoice_copy\":\"Original for Recipient\",\"language\":\"en\",\"distance\":0,\"mode_of_transport\":\"Road\",\"lr_date\":\"2024-04-19\",\"gst_vehicle_type\":\"Regular\",\"status\":\"Draft\",\"einvoice_status\":\"Not Applicable\",\"customer_group\":\"Individual\",\"is_internal_customer\":0,\"is_discounted\":0,\"remarks\":\"No Remarks\",\"repost_required\":0,\"doctype\":\"Sales Invoice\",\"sales_team\":[{\"name\":\"13f0b85d9d\",\"owner\":\"Administrator\",\"creation\":\"2024-04-19 17:26:55.154921\",\"modified\":\"2024-04-19 17:26:55.154921\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"sales_person\":\"Shamith\",\"allocated_percentage\":100,\"allocated_amount\":12,\"incentives\":0,\"parent\":\"SI24B25/I/00011\",\"parentfield\":\"sales_team\",\"parenttype\":\"Sales Invoice\",\"doctype\":\"Sales Team\"}],\"timesheets\":[],\"advances\":[],\"items\":[{\"name\":\"7d9bfeeb44\",\"owner\":\"Administrator\",\"creation\":\"2024-04-19 17:26:55.154921\",\"modified\":\"2024-04-19 17:26:55.154921\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"has_item_scanned\":0,\"item_code\":\"ITEM00002\",\"item_name\":\"LCD MODULE 02R\",\"description\":\"LCD MODULE 02R\",\"gst_hsn_code\":\"90138010\",\"item_group\":\"Products\",\"image\":\"\",\"qty\":1,\"stock_uom\":\"Nos\",\"uom\":\"Nos\",\"conversion_factor\":1,\"stock_qty\":1,\"price_list_rate\":12,\"base_price_list_rate\":12,\"margin_type\":\"\",\"margin_rate_or_amount\":0,\"rate_with_margin\":0,\"discount_percentage\":0,\"discount_amount\":0,\"base_rate_with_margin\":0,\"rate\":12,\"amount\":12,\"gst_treatment\":\"Taxable\",\"base_rate\":12,\"base_amount\":12,\"stock_uom_rate\":12,\"is_free_item\":0,\"grant_commission\":1,\"net_rate\":12,\"net_amount\":12,\"base_net_rate\":12,\"base_net_amount\":12,\"taxable_value\":12,\"igst_rate\":0,\"cgst_rate\":9,\"sgst_rate\":9,\"cess_rate\":0,\"cess_non_advol_rate\":0,\"igst_amount\":0,\"cgst_amount\":1.08,\"sgst_amount\":1.08,\"cess_amount\":0,\"cess_non_advol_amount\":0,\"delivered_by_supplier\":0,\"income_account\":\"Sales - SIL\",\"is_fixed_asset\":0,\"expense_account\":\"Cost of Goods Sold - SIL\",\"enable_deferred_revenue\":0,\"weight_per_unit\":0,\"total_weight\":0,\"warehouse\":\"Stores - SIL\",\"use_serial_batch_fields\":0,\"incoming_rate\":0,\"allow_zero_valuation_rate\":0,\"item_tax_rate\":\"{}\",\"actual_batch_qty\":0,\"actual_qty\":0,\"sales_order\":\"SO24B25/I/00048\",\"so_detail\":\"b2e1194632\",\"delivered_qty\":0,\"cost_center\":\"Main - SIL\",\"page_break\":0,\"parent\":\"SI24B25/I/00011\",\"parentfield\":\"items\",\"parenttype\":\"Sales Invoice\",\"doctype\":\"Sales Invoice Item\"}],\"pricing_rules\":[],\"payment_schedule\":[{\"name\":\"41889ced0c\",\"owner\":\"Administrator\",\"creation\":\"2024-04-19 17:26:56.088365\",\"modified\":\"2024-04-19 17:26:56.088365\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"due_date\":\"2024-04-19\",\"invoice_portion\":100,\"discount\":0,\"payment_amount\":14,\"outstanding\":14,\"paid_amount\":0,\"discounted_amount\":0,\"base_payment_amount\":14,\"parent\":\"SI24B25/I/00011\",\"parentfield\":\"payment_schedule\",\"parenttype\":\"Sales Invoice\",\"doctype\":\"Payment Schedule\"}],\"taxes\":[{\"name\":\"356101a4d1\",\"owner\":\"Administrator\",\"creation\":\"2024-04-19 17:26:55.154921\",\"modified\":\"2024-04-19 17:26:55.154921\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"charge_type\":\"On Net Total\",\"account_head\":\"Output Tax SGST - SIL\",\"description\":\"SGST\",\"included_in_print_rate\":0,\"included_in_paid_amount\":0,\"cost_center\":\"Main - SIL\",\"rate\":9,\"tax_amount\":1.08,\"total\":13.08,\"tax_amount_after_discount_amount\":1.08,\"base_tax_amount\":1.08,\"base_total\":13.08,\"base_tax_amount_after_discount_amount\":1.08,\"item_wise_tax_detail\":\"{\\\"ITEM00002\\\":[9,1.08]}\",\"dont_recompute_tax\":0,\"parent\":\"SI24B25/I/00011\",\"parentfield\":\"taxes\",\"parenttype\":\"Sales Invoice\",\"doctype\":\"Sales Taxes and Charges\"},{\"name\":\"e68c05c2e6\",\"owner\":\"Administrator\",\"creation\":\"2024-04-19 17:26:55.154921\",\"modified\":\"2024-04-19 17:26:55.154921\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":2,\"charge_type\":\"On Net Total\",\"account_head\":\"Output Tax CGST - SIL\",\"description\":\"CGST\",\"included_in_print_rate\":0,\"included_in_paid_amount\":0,\"cost_center\":\"Main - SIL\",\"rate\":9,\"tax_amount\":1.08,\"total\":14.16,\"tax_amount_after_discount_amount\":1.08,\"base_tax_amount\":1.08,\"base_total\":14.16,\"base_tax_amount_after_discount_amount\":1.08,\"item_wise_tax_detail\":\"{\\\"ITEM00002\\\":[9,1.08]}\",\"dont_recompute_tax\":0,\"parent\":\"SI24B25/I/00011\",\"parentfield\":\"taxes\",\"parenttype\":\"Sales Invoice\",\"doctype\":\"Sales Taxes and Charges\"}],\"payments\":[],\"packed_items\":[],\"custom_item_series\":[{\"name\":\"qazwsx00003\",\"owner\":\"Administrator\",\"creation\":\"2024-04-19 17:26:55.154921\",\"modified\":\"2024-04-19 17:26:55.154921\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":1,\"item_series\":\"LCD MODULE 02R\",\"naming_series\":\"qazwsx\",\"qty\":\"1\",\"parent\":\"SI24B25/I/00011\",\"parentfield\":\"custom_item_series\",\"parenttype\":\"Sales Invoice\",\"doctype\":\"Item Series No\"}],\"__onload\":{\"make_payment_via_journal_entry\":0},\"__last_sync_on\":\"2024-04-19T11:59:18.608Z\",\"_submitted_from_ui\":1}",
		"action": "Submit"
	},
	"btn": {
		"jQuery370055785817711663421": {
			"events": {
				"click": [
					{
						"type": "click",
						"origType": "click",
						"guid": 693,
						"namespace": ""
					}
				]
			}
		}
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.save.savedocs",
	"request_id": null
}

Response Data

{
	"exception": "TypeError: '<' not supported between instances of 'str' and 'int'",
	"exc_type": "TypeError",
	"_exc_source": "erpnext (app)"
}