fix: add company filter in Warehouse wise Item Balance Age and Value

(cherry picked from commit 75950f86cf)
This commit is contained in:
Nihantra Patel
2024-10-01 10:50:43 +05:30
committed by Mergify
parent 619550942f
commit 3cb85028d0
2 changed files with 15 additions and 2 deletions

View File

@@ -4,6 +4,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"),
@@ -40,6 +49,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):