ERPNext Conference 2019* ERPNext.com Blog

Not able to import Lab Test Template using importing template Is Fixed Asset CannotChangeConstantError validation fails

erpnext

#1

I was trying to setup lab test template in Healthcare module. I have a list of Lab test with me. and i tried to import using Data Import. So, downloaded the template file and tried to import. But it is not getting imported. Saying error

frappe.exceptions.CannotChangeConstantError: Value cannot be changed for Is Fixed Asset

What is the issue in this ? Why it is happening like that ?
Anyone can tell me how to resolve this issue ??

I’m attaching error log here :

Traceback (most recent call last):
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py”, line 410, in upload
doc.insert()
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 252, in insert
self.run_method(“after_insert”)
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 786, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 1056, in composer
return composed(self, method, *args, **kwargs)
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 1039, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 780, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/rajeeb_tacten/frappe-bench/apps/erpnext/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py”, line 33, in after_insert
create_item_from_template(self)
File “/home/rajeeb_tacten/frappe-bench/apps/erpnext/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py”, line 90, in create_item_from_template
item.save(ignore_permissions = True)
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 271, in save
return self._save(*args, **kwargs)
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 310, in _save
self._validate()
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 479, in _validate
self.validate_set_only_once()
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/model/document.py”, line 507, in validate_set_only_once
frappe.CannotChangeConstantError)
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/init.py”, line 360, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/init.py”, line 346, in msgprint
_raise_exception()
File “/home/rajeeb_tacten/frappe-bench/apps/frappe/frappe/init.py”, line 315, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.CannotChangeConstantError: Value cannot be changed for Is Fixed Asset


#2

Does this apply to you? New Data Import

Please state details of your version and host environment thanks!