Hi All,
i create a new Item but it showing this error please guide to me resolve it
Thanks in Advance
Hi All,
i create a new Item but it showing this error please guide to me resolve it
share the full error by clicking “Copy error to clipboard” and then paste it here
{
"erpnext": "14.67.2",
"frappe": "14.72.0",
"hrms": "14.26.0"
}
Form/Item/new-item-gidiuauxxl
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 95, 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 48, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1611, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/form/save.py", line 31, in savedocs
doc.save()
File "apps/frappe/frappe/model/document.py", line 307, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 329, in _save
return self.insert()
File "apps/frappe/frappe/model/document.py", line 289, in insert
self.run_post_save_methods()
File "apps/frappe/frappe/model/document.py", line 1095, in run_post_save_methods
self.run_method("on_update")
File "apps/frappe/frappe/model/document.py", line 928, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1280, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1262, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 925, in fn
return method_object(*args, **kwargs)
File "apps/erpnext/erpnext/stock/doctype/item/item.py", line 126, in on_update
self.update_website_item()
File "apps/erpnext/erpnext/stock/doctype/item/item.py", line 259, in update_website_item
if doc_before_save.get(field) != self.get(field):
AttributeError: 'NoneType' object has no attribute 'get'
{
"type": "POST",
"args": {
"doc": "{\"docstatus\":0,\"doctype\":\"Item\",\"name\":\"new-item-gidiuauxxl\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"Administrator\",\"naming_series\":\"ITM-.####\",\"item_code\":\"ITM-\",\"stock_uom\":\"Nos\",\"disabled\":1,\"allow_alternative_item\":0,\"is_stock_item\":0,\"has_variants\":0,\"include_item_in_manufacturing\":0,\"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,\"has_batch_no\":0,\"create_new_batch\":0,\"has_expiry_date\":0,\"retain_sample\":0,\"has_serial_no\":0,\"variant_based_on\":\"Item Attribute\",\"enable_deferred_expense\":0,\"enable_deferred_revenue\":0,\"min_order_qty\":0,\"is_purchase_item\":1,\"is_customer_provided_item\":0,\"delivered_by_supplier\":0,\"country_of_origin\":\"United Arab Emirates\",\"grant_commission\":1,\"is_sales_item\":1,\"inspection_required_before_purchase\":0,\"inspection_required_before_delivery\":0,\"is_sub_contracted_item\":0,\"published_in_website\":0,\"item_name\":\"sample\",\"item_group\":\"All Item Groups\",\"size\":\"1\",\"finish\":\"1\"}",
"action": "Save"
},
"btn": {
"jQuery3600379097172639267341": {
"events": {
"click": [
{
"type": "click",
"origType": "click",
"guid": 1103,
"namespace": ""
}
]
}
}
},
"freeze": true,
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.form.save.savedocs"
}
{
"exception": "AttributeError: 'NoneType' object has no attribute 'get'"
}
I don’t know why, but the self.get_doc_before_save()
method is returning None
in the update_website_item()
method
I think you duplicated the website item and created it, so you are facing an issue. Please reload the page first and then create the item again so that the error does not occur. Try it.