Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make status filter in Fixed Asset Register optional #28126

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ frappe.query_reports["Fixed Asset Register"] = {
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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ def get_conditions(filters):
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

Expand Down