ERPnext V 15 Opening stock entry error

App Versions

{
	"erpnext": "15.26.1",
	"frappe": "15.29.0"
}

Route

Form/Stock Reconciliation/MAT-RECO-2024-00004

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 115, 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 1768, 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/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py", line 813, in submit
    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/stock/doctype/stock_reconciliation/stock_reconciliation.py", line 103, in on_submit
    self.make_bundle_using_old_serial_batch_fields()
  File "apps/erpnext/erpnext/controllers/stock_controller.py", line 219, in make_bundle_using_old_serial_batch_fields
    self.create_serial_batch_bundle(bundle_details, row)
  File "apps/erpnext/erpnext/controllers/stock_controller.py", line 401, in create_serial_batch_bundle
    sn_doc = SerialBatchCreation(bundle_details).make_serial_and_batch_bundle()
  File "apps/erpnext/erpnext/stock/serial_batch_bundle.py", line 878, in make_serial_and_batch_bundle
    self.set_auto_serial_batch_entries_for_inward()
  File "apps/erpnext/erpnext/stock/serial_batch_bundle.py", line 957, in set_auto_serial_batch_entries_for_inward
    self.make_serial_no_if_not_exists()
  File "apps/erpnext/erpnext/stock/serial_batch_bundle.py", line 977, in make_serial_no_if_not_exists
    self.make_serial_nos(non_exists_serial_nos)
  File "apps/erpnext/erpnext/stock/serial_batch_bundle.py", line 1021, in make_serial_nos
    frappe.db.bulk_insert("Serial No", fields=fields, values=set(serial_nos_details))
  File "apps/frappe/frappe/database/database.py", line 1343, in bulk_insert
    query.insert(*value_chunk).run()
  File "apps/frappe/frappe/query_builder/utils.py", line 87, in execute_query
    result = frappe.db.sql(query, params, *args, **kwargs)  # nosemgrep
  File "apps/frappe/frappe/database/database.py", line 234, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, "Duplicate entry '3' for key 'PRIMARY'")

Request Data

{
	"type": "POST",
	"args": {
		"doc": "{\"name\":\"MAT-RECO-2024-00003\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":0,\"naming_series\":\"MAT-RECO-.YYYY.-\",\"company\":\"ABC COMPUTERS (PVT) LTD\",\"purpose\":\"Opening Stock\",\"posting_date\":\"2024-08-01\",\"posting_time\":\"12:47:09\",\"set_posting_time\":1,\"scan_mode\":0,\"expense_account\":\"Temporary Opening - ABC\",\"difference_amount\":1647623.21,\"cost_center\":\"Main - ABC\",\"doctype\":\"Stock Reconciliation\",\"items\":[{\"name\":\"ehunki55bi\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":1,\"item_code\":\"IMWCS-190-KO-CX\",\"item_name\":\"Bamboo Solo\",\"item_group\":\"WACOM\",\"warehouse\":\"Stores - ABC\",\"qty\":2,\"valuation_rate\":3282.56,\"amount\":6565.12,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"2\",\"amount_difference\":6565.12,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun5hd2q6\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":2,\"item_code\":\"IMWCS-320A/KO-CX\",\"item_name\":\" OSAKI PEN\",\"item_group\":\"WACOM\",\"warehouse\":\"Stores - ABC\",\"qty\":5,\"valuation_rate\":4217.23,\"amount\":21086.15,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"5\",\"amount_difference\":21086.15,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunfcjuj5\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":3,\"item_code\":\"IMWDTU-1141B/KOWACOMPENDISPLAY\",\"item_name\":\"Wacom DTU-1141B/KO Pen Display\",\"item_group\":\"WACOM\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":104000,\"amount\":104000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"serial_no\":\"xxxx\",\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":104000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun1ooieh\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":4,\"item_code\":\"IMWLP-160E-BAMBOO PEN\",\"item_name\":\"Bamboo Pen\",\"item_group\":\"WACOM\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":1546.97,\"amount\":1546.97,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":1546.97,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunakebv8\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":5,\"item_code\":\"KBPORLINKGK1002MWIREDKEYBOARD\",\"item_name\":\"Prolink GK1002M USB Keyboard \",\"item_group\":\"Key Board & Mouse\",\"warehouse\":\"Stores - ABC\",\"qty\":10,\"valuation_rate\":1750,\"amount\":17500,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"10\",\"amount_difference\":17500,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunsnorvb\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":6,\"item_code\":\"MB ASUS MB\",\"item_name\":\"Mother board Asus P5G4IT\",\"item_group\":\"motherbords\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":8000,\"amount\":8000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":8000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunhji6qq\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":7,\"item_code\":\"MM 4GB DDR111NB\",\"item_name\":\"Kingston 4GB DDR 111 NB Ram\",\"item_group\":\"Notebook Memory's\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":4250,\"amount\":4250,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":4250,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunt4spi4\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":8,\"item_code\":\"MM1GBDDR1ADADTADESKTOP\",\"item_name\":\"Adata 1GB DDR1 Desktop Ram\",\"item_group\":\"Notebook Memory's\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":5750,\"amount\":5750,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":5750,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun8l8t6r\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":9,\"item_code\":\"MM740617083700\",\"item_name\":\"Kingstom 1GB DDR3 memory\",\"item_group\":\"Desktop memories\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":3000,\"amount\":3000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":3000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunm6749f\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":10,\"item_code\":\"MM740617134230\",\"item_name\":\"kingston 2GB DDR3 DT Ram\",\"item_group\":\"Desktop memories\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":2988.99,\"amount\":2988.99,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":2988.99,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunburt21\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":11,\"item_code\":\"MSMICROM101USBMOUSE\",\"item_name\":\"Micro pack M101 USB mouse\",\"item_group\":\"Key Board & Mouse\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":750,\"amount\":750,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"serial_no\":\"xxx\",\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":750,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunb16thd\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":12,\"item_code\":\"MSPMOUSEPAD\",\"item_name\":\"Mouse Pad\",\"item_group\":\"Computer Accessories\",\"warehouse\":\"Stores - ABC\",\"qty\":5,\"valuation_rate\":2150,\"amount\":10750,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"5\",\"amount_difference\":10750,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehuntl6rks\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":13,\"item_code\":\"MSPROLINKPMC1007MS\",\"item_name\":\"Prolink PMC1007 USB Mouse\",\"item_group\":\"Key Board & Mouse\",\"warehouse\":\"Stores - ABC\",\"qty\":3,\"valuation_rate\":680,\"amount\":2040,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"3\",\"amount_difference\":2040,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehune1618j\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":14,\"item_code\":\"MSWLPROLINKPMW5008/5009WLMS\",\"item_name\":\"Prolink PMW5008/5009Wireless Mouse \",\"item_group\":\"Key Board & Mouse\",\"warehouse\":\"Stores - ABC\",\"qty\":50,\"valuation_rate\":1850,\"amount\":92500,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"serial_no\":\"1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12\\n13\\n14\\n15\\n16\\n17\\n18\\n19\\n20\\n21\\n22\\n23\\n24\\n25\\n26\\n27\\n28\\n29\\n30\\n3\\n1\\n32\\n33\\n34\\n35\\n36\\n37\\n38\\n39\\n40\\n41\\n42\\n43\\n44\\n45\\n46\\n47\\n48\\n49\\n50\",\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"50\",\"amount_difference\":92500,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehund9tb2s\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":15,\"item_code\":\"NBADAPTORFORNOTEBOOK\",\"item_name\":\"Notebook power adaptor\",\"item_group\":\"Note book Charges\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":5333.33,\"amount\":5333.33,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":5333.33,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun31tm05\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":16,\"item_code\":\"NBADDELLISPR14-3567NB+AD\",\"item_name\":\"Dell Inspiron 14- 3567 Notebook Adapter with Power cable \",\"item_group\":\"Note Book and Accessories\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":6450,\"amount\":6450,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":6450,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun86m7q5\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":17,\"item_code\":\"NBADHPPAV15-\",\"item_name\":\"Hp Pavilion 15 Notebook Adapter + Cable\",\"item_group\":\"Notebook Accessories & parts\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":6450,\"amount\":6450,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":6450,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun161087\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":18,\"item_code\":\"NBAS4738-382G32\",\"item_name\":\"Aser Note book\",\"item_group\":\"Branded Note book\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":3500,\"amount\":3500,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":3500,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunaiq4ka\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":19,\"item_code\":\"NBBTACERTMP258-M-394LBT\",\"item_name\":\"Acer TMP258-M-394L Notebook Battery\",\"item_group\":\"Notebook Battery\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":8000,\"amount\":8000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":8000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun1beidv\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":20,\"item_code\":\"NBBTDELL3542\",\"item_name\":\"Dell Inspiron  3542 Notebook Battery\",\"item_group\":\"Notebook Battery\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":6500,\"amount\":6500,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":6500,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun39p0bn\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":21,\"item_code\":\"NBKBHP450-G4\",\"item_name\":\"Hp Probook 450-G4 Keyboard \",\"item_group\":\"Notebook Keyboard\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":7000,\"amount\":7000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":7000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunkvp090\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":22,\"item_code\":\"NBKEYBOARD\",\"item_name\":\"Notebook Keyboard\",\"item_group\":\"Notebook Keyboard\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":3237.5,\"amount\":3237.5,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":3237.5,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunkc7u7v\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":23,\"item_code\":\"PBPOWERLOGY45WNBPB\",\"item_name\":\"Powerlogy 45W-3000Amh Notebook Powerbank\",\"item_group\":\"power supply\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":29900,\"amount\":29900,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":29900,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunf22kch\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":24,\"item_code\":\"PC INTEL DUAL CORE 3.6GHZ\",\"item_name\":\"Intel 3.0Mhz Dual Core Processor \",\"item_group\":\"Processors\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":7897.17,\"amount\":7897.17,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":7897.17,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun0nlt2p\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":25,\"item_code\":\"SH 4PORT\",\"item_name\":\"4port switch\",\"item_group\":\"Network Switches\",\"warehouse\":\"Stores - ABC\",\"qty\":2,\"valuation_rate\":10300,\"amount\":20600,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"2\",\"amount_difference\":20600,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunfopmlj\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":26,\"item_code\":\"STY STYLUS SMART- DAGI Pen\",\"item_name\":\"STY Stylus Smart DAGi Pen\",\"item_group\":\"All Item Groups\",\"warehouse\":\"Stores - ABC\",\"qty\":5,\"valuation_rate\":2500,\"amount\":12500,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"5\",\"amount_difference\":12500,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun1m92dc\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":27,\"item_code\":\"SWMEDIAPACK\",\"item_name\":\"Win 8.1 Media Pack\",\"item_group\":\"Software's\",\"warehouse\":\"Stores - ABC\",\"qty\":7,\"valuation_rate\":1338.02,\"amount\":9366.14,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"7\",\"amount_difference\":9366.14,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunb1fphb\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":28,\"item_code\":\"SWMS Office Pro Plus 2019 DVD\",\"item_name\":\"MS Office Pro Plus 2019 DVD\",\"item_group\":\"Software's\",\"warehouse\":\"Stores - ABC\",\"qty\":3,\"valuation_rate\":45000,\"amount\":135000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"3\",\"amount_difference\":135000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunlrl6tu\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":29,\"item_code\":\"SWMSHOME&BUSINESS\",\"item_name\":\"Office Home & Business\",\"item_group\":\"Software's\",\"warehouse\":\"Stores - ABC\",\"qty\":10,\"valuation_rate\":37500,\"amount\":375000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"10\",\"amount_difference\":375000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunvp7pru\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":30,\"item_code\":\"SWMcAfeeSingleUser\",\"item_name\":\"McAfee Single User \",\"item_group\":\"Software's\",\"warehouse\":\"Stores - ABC\",\"qty\":1022,\"valuation_rate\":633.72,\"amount\":647661.84,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1022\",\"amount_difference\":647661.84,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunrjqpso\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":31,\"item_code\":\"SWWINDOWS10PRO\",\"item_name\":\"Windows 10 Professional\",\"item_group\":\"Software's\",\"warehouse\":\"Stores - ABC\",\"qty\":1,\"valuation_rate\":15500,\"amount\":15500,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"1\",\"amount_difference\":15500,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehunbtesll\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":32,\"item_code\":\"TB COVER FOR SAMSUNG\",\"item_name\":\"Cover for Samsung\",\"item_group\":\"Notebook Backpack / Carring case\",\"warehouse\":\"Stores - ABC\",\"qty\":10,\"valuation_rate\":2800,\"amount\":28000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"10\",\"amount_difference\":28000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"},{\"name\":\"ehun57ba8h\",\"owner\":\"sanjeewa@abc.lk\",\"creation\":\"2024-08-27 13:28:38.657371\",\"modified\":\"2024-08-27 14:02:53.486129\",\"modified_by\":\"sanjeewa@abc.lk\",\"docstatus\":0,\"idx\":33,\"item_code\":\"TNHP136ATN\",\"item_name\":\"HP 136A Black Original LaserJet Toner Cartridge\",\"item_group\":\"toner\",\"warehouse\":\"Stores - ABC\",\"qty\":2,\"valuation_rate\":19500,\"amount\":39000,\"allow_zero_valuation_rate\":0,\"use_serial_batch_fields\":0,\"current_qty\":0,\"current_amount\":0,\"current_valuation_rate\":0,\"quantity_difference\":\"2\",\"amount_difference\":39000,\"parent\":\"MAT-RECO-2024-00003\",\"parentfield\":\"items\",\"parenttype\":\"Stock Reconciliation\",\"doctype\":\"Stock Reconciliation Item\"}],\"__onload\":{\"make_payment_via_journal_entry\":0},\"__last_sync_on\":\"2024-08-28T01:53:37.757Z\"}",
		"action": "Submit"
	},
	"btn": {
		"jQuery3700213055199803641181": {
			"events": {
				"click": [
					{
						"type": "click",
						"origType": "click",
						"guid": 4043,
						"namespace": ""
					}
				]
			}
		}
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.save.savedocs",
	"request_id": null
}

Response Data

{
	"exception": "pymysql.err.IntegrityError: (1062, \"Duplicate entry '3' for key 'PRIMARY'\")",
	"exc_type": "IntegrityError",
	"_exc_source": "erpnext (app)"
}

your version 15 is old, so please upgrade your version, because we tested it in the latest version. Everything is working fine. No problems were encountered in the latest version 15.

1 Like