Unable to add new item in stock

Hi,
Recently I have upgraded erpnext version-14 to 15. After that I’m unable to add an item in stock. Getting below error when trying to add (save) new item in stock. It was working on erpnext version14 without any issues.

“TypeError: ‘str’ object does not support item assignment”

ERPNext: v15.10.8 (version-15)

Frappe Framework: v15.11.0 (version-15)

Frappe HR: v16.0.0-dev (develop)

Amazon S3 Backup: v0.0.1 (master)

@rambeats Can you Please share a full error message or a screen shot?

Please see attached error screenshot

App Versions

{
	"erpnext": "15.10.8",
	"frappe": "15.11.0",
	"hrms": "16.0.0-dev",
	"s3_backup": "0.0.1"
}

Route

Form/Item/new-item-ebsksduwxi

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 1682, 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/client.py", line 226, in save
    doc = frappe.get_doc(doc)
  File "apps/frappe/frappe/__init__.py", line 1265, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 82, in get_doc
    return controller(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 132, in __init__
    super().__init__(kwargs)
  File "apps/frappe/frappe/model/base_document.py", line 134, in __init__
    self.update(d)
  File "apps/frappe/frappe/model/base_document.py", line 184, in update
    self.set(key, value, as_value=ignore_children)
  File "apps/frappe/frappe/model/base_document.py", line 236, in set
    self.extend(key, value)
  File "apps/frappe/frappe/model/base_document.py", line 294, in extend
    self.append(key, v)
  File "apps/frappe/frappe/model/base_document.py", line 262, in append
    ret_value = self._init_child(value, key)
  File "apps/frappe/frappe/model/base_document.py", line 307, in _init_child
    value["doctype"] = doctype
TypeError: 'str' object does not support item assignment

Request Data

{
	"type": "POST",
	"args": {
		"doc": "{\"docstatus\":0,\"doctype\":\"Item\",\"name\":\"new-item-ebsksduwxi\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"erp@xxxx.com",\"naming_series\":\"STO-ITEM-.YYYY.-\",\"stock_uom\":\"Nos\",\"disabled\":0,\"allow_alternative_item\":0,\"is_stock_item\":1,\"has_variants\":0,\"include_item_in_manufacturing\":1,\"is_fixed_asset\":0,\"auto_create_assets\":0,\"is_grouped_asset\":0,\"end_of_life\":\"2099-12-31\",\"default_material_request_type\":\"Purchase\",\"valuation_method\":\"\",\"allow_negative_stock\":0,\"barcodes\":[],\"reorder_levels\":[],\"uoms\":[],\"has_batch_no\":0,\"create_new_batch\":0,\"has_expiry_date\":0,\"retain_sample\":0,\"has_serial_no\":0,\"variant_based_on\":\"Item Attribute\",\"attributes\":\"No Applicable\",\"enable_deferred_expense\":0,\"enable_deferred_revenue\":0,\"item_defaults\":[],\"min_order_qty\":0,\"is_purchase_item\":1,\"is_customer_provided_item\":0,\"delivered_by_supplier\":0,\"supplier_items\":[],\"country_of_origin\":\"India\",\"grant_commission\":1,\"is_sales_item\":1,\"customer_items\":[],\"taxes\":[],\"inspection_required_before_purchase\":0,\"inspection_required_before_delivery\":0,\"is_sub_contracted_item\":0,\"__run_link_triggers\":1,\"item_code\":\"tra\",\"item_group\":\"Consumable\"}"
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.client.save",
	"request_id": null
}

Response Data

{
	"exception": "TypeError: 'str' object does not support item assignment",
	"exc_type": "TypeError"
}

Hi @rambeats,

Please again migrate the site and check it.

And if you want to use the stable version, switch develop branch to version 15 branch for HRMS.

Thank You!

Migrated site again. But no luck. Same error.

I have also upgraded hrms to stable version

Hi @rambeats,

any type of code added in that doctype / Item doctype?

because we checked in the latest version of ERPNext so we haven’t found any type of issue.

Thank You!

Hi,
I did not change anything on the doctype. New item addition was working in erpnext-14. But after upgrade we have this issue.

Can you please give me the file location of item doctype?