fix: add company filter in Warehouse wise Item Balance Age and Value
(cherry picked from commit 75950f86cf)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user