fix: Make status filter optional (#28126)
diff --git a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js
index 75f42a9..06989a9 100644
--- a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js
+++ b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.js
@@ -16,9 +16,8 @@
fieldname:"status",
label: __("Status"),
fieldtype: "Select",
- options: "In Location\nDisposed",
- default: 'In Location',
- reqd: 1
+ options: "\nIn Location\nDisposed",
+ default: 'In Location'
},
{
"fieldname":"filter_based_on",
diff --git a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py
index e370b9d..63685fe 100644
--- a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py
+++ b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py
@@ -45,12 +45,13 @@
if filters.get('cost_center'):
conditions["cost_center"] = filters.get('cost_center')
- # In Store assets are those that are not sold or scrapped
- operand = 'not in'
- if status not in 'In Location':
- operand = 'in'
+ if status:
+ # In Store assets are those that are not sold or scrapped
+ operand = 'not in'
+ if status not in 'In Location':
+ operand = 'in'
- conditions['status'] = (operand, ['Sold', 'Scrapped'])
+ conditions['status'] = (operand, ['Sold', 'Scrapped'])
return conditions