fix: Make status filter optional (#28126)
This commit is contained in:
parent
eb720d18c3
commit
15e9b5170d
@ -16,9 +16,8 @@ frappe.query_reports["Fixed Asset Register"] = {
|
|||||||
fieldname:"status",
|
fieldname:"status",
|
||||||
label: __("Status"),
|
label: __("Status"),
|
||||||
fieldtype: "Select",
|
fieldtype: "Select",
|
||||||
options: "In Location\nDisposed",
|
options: "\nIn Location\nDisposed",
|
||||||
default: 'In Location',
|
default: 'In Location'
|
||||||
reqd: 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"filter_based_on",
|
"fieldname":"filter_based_on",
|
||||||
|
@ -45,12 +45,13 @@ def get_conditions(filters):
|
|||||||
if filters.get('cost_center'):
|
if filters.get('cost_center'):
|
||||||
conditions["cost_center"] = filters.get('cost_center')
|
conditions["cost_center"] = filters.get('cost_center')
|
||||||
|
|
||||||
# In Store assets are those that are not sold or scrapped
|
if status:
|
||||||
operand = 'not in'
|
# In Store assets are those that are not sold or scrapped
|
||||||
if status not in 'In Location':
|
operand = 'not in'
|
||||||
operand = 'in'
|
if status not in 'In Location':
|
||||||
|
operand = 'in'
|
||||||
|
|
||||||
conditions['status'] = (operand, ['Sold', 'Scrapped'])
|
conditions['status'] = (operand, ['Sold', 'Scrapped'])
|
||||||
|
|
||||||
return conditions
|
return conditions
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user