mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-17 22:12:12 +00:00
fix: add company filter in Warehouse wise Item Balance Age and Value
(cherry picked from commit 75950f86cf)
This commit is contained in:
@@ -3,6 +3,15 @@
|
|||||||
|
|
||||||
frappe.query_reports["Warehouse wise Item Balance Age and Value"] = {
|
frappe.query_reports["Warehouse wise Item Balance Age and Value"] = {
|
||||||
filters: [
|
filters: [
|
||||||
|
{
|
||||||
|
fieldname: "company",
|
||||||
|
label: __("Company"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
width: "80",
|
||||||
|
options: "Company",
|
||||||
|
reqd: 1,
|
||||||
|
default: frappe.defaults.get_user_default("Company"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldname: "from_date",
|
fieldname: "from_date",
|
||||||
label: __("From Date"),
|
label: __("From Date"),
|
||||||
@@ -39,6 +48,12 @@ frappe.query_reports["Warehouse wise Item Balance Age and Value"] = {
|
|||||||
fieldtype: "Link",
|
fieldtype: "Link",
|
||||||
width: "80",
|
width: "80",
|
||||||
options: "Warehouse",
|
options: "Warehouse",
|
||||||
|
get_query: function () {
|
||||||
|
const company = frappe.query_report.get_filter_value("company");
|
||||||
|
return {
|
||||||
|
filters: { company: company },
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname: "filter_total_zero_qty",
|
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])
|
sle_count = flt(frappe.qb.from_("Stock Ledger Entry").select(Count("name")).run()[0][0])
|
||||||
if sle_count > 500000:
|
if sle_count > 500000:
|
||||||
frappe.throw(_("Please set filter based on Item or Warehouse"))
|
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):
|
def get_warehouse_list(filters):
|
||||||
|
|||||||
Reference in New Issue
Block a user