Skip to content

Commit

Permalink
feat(Catch Log Days and Counts): fishing area restricts water body
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Jul 30, 2024
1 parent 54c4797 commit a90b021
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ frappe.query_reports["Catch Log Days and Counts"] = {
fieldname: "water_body",
fieldtype: "MultiSelectList",
label: __("Water Body"),
get_data: (txt) => frappe.db.get_link_options("Water Body", txt),
get_data: (txt) => {
const fishing_areas = frappe.query_report.get_filter_value("fishing_area") || [];
const filters = {};
if (fishing_areas.length > 0) {
filters.fishing_area = ["in", fishing_areas];
}
return frappe.db.get_link_options("Water Body", txt, filters);
},
},
{
fieldname: "organization",
Expand Down Expand Up @@ -44,7 +51,6 @@ frappe.query_reports["Catch Log Days and Counts"] = {
],
};


function get_extra_columns(txt) {
const extra_columns = [
{
Expand All @@ -62,7 +68,7 @@ function get_extra_columns(txt) {
label: __("Water Body Status"),
description: "",
},
]
];

return extra_columns.filter((d) => d.label.toLowerCase().includes(txt.toLowerCase()));
}

0 comments on commit a90b021

Please sign in to comment.