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

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

Does this apply to you? New Data Import

Please state details of your version and host environment thanks!

1 Like

I am facing the same error message while a tempting to import Healthcare Service unit type.

The error is:
on the following versions:
ERPNext: v14.31.3 (version-14)
Frappe Framework: v14.41.0 (version-14)
Healthcare: v15.0.0-dev (develop)
Frappe HR: v15.0.0-dev (develop)

Traceback (most recent call last):
File “apps/frappe/frappe/core/doctype/data_import/importer.py”, line 148, in import_data
doc = self.process_doc(doc)
File “apps/frappe/frappe/core/doctype/data_import/importer.py”, line 242, in process_doc
return self.insert_record(doc)
File “apps/frappe/frappe/core/doctype/data_import/importer.py”, line 261, in insert_record
new_doc.insert()
File “apps/frappe/frappe/model/document.py”, line 276, in insert
self.run_method(“after_insert”)
File “apps/frappe/frappe/model/document.py”, line 914, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1267, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1249, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/document.py”, line 911, in fn
return method_object(*args, **kwargs)
File “apps/healthcare/healthcare/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py”, line 44, in after_insert
create_item(self)
File “apps/healthcare/healthcare/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py”, line 113, in create_item
item.save(ignore_permissions=True)
File “apps/frappe/frappe/model/document.py”, line 305, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 342, in _save
self._validate()
File “apps/frappe/frappe/model/document.py”, line 555, in _validate
self.validate_set_only_once()
File “apps/frappe/frappe/model/document.py”, line 609, in validate_set_only_once
frappe.throw(
File “apps/frappe/frappe/init.py”, line 533, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 501, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 450, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.CannotChangeConstantError: Value cannot be changed for Is Fixed Asset