Merge pull request #43459 from frappe/mergify/bp/version-15-hotfix/pr-43455

fix: add company filter in Warehouse wise Item Balance Age and Value (backport #43455)
This commit is contained in:
Nihantra C. Patel
2024-10-01 11:46:46 +05:30
committed by GitHub
2 changed files with 15 additions and 2 deletions

View File

@@ -3,6 +3,15 @@
frappe.query_reports["Warehouse wise Item Balance Age and Value"] = {
filters: [
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
width: "80",
options: "Company",
reqd: 1,
default: frappe.defaults.get_user_default("Company"),
},
{
fieldname: "from_date",
label: __("From Date"),
@@ -39,6 +48,12 @@ frappe.query_reports["Warehouse wise Item Balance Age and Value"] = {
fieldtype: "Link",
width: "80",
options: "Warehouse",
get_query: function () {
const company = frappe.query_report.get_filter_value("company");
return {
filters: { company: company },
};
},
},
{
fieldname: "filter_total_zero_qty",

View File

@@ -109,8 +109,6 @@ def validate_filters(filters):
sle_count = flt(frappe.qb.from_("Stock Ledger Entry").select(Count("name")).run()[0][0])
if sle_count > 500000:
frappe.throw(_("Please set filter based on Item or Warehouse"))
if not filters.get("company"):
filters["company"] = frappe.defaults.get_user_default("Company")
def get_warehouse_list(filters):