mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 03:15:07 +00:00
fix(warehouse_capacity_dashboard): escaping warehouse, item_code and company on get_data (backport #53894) (#53900)
Co-authored-by: diptanilsaha <diptanil@frappe.io> fix(warehouse_capacity_dashboard): escaping `warehouse`, `item_code` and `company` on `get_data` (#53894)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe.desk.reportview import build_match_conditions
|
from frappe.desk.reportview import build_match_conditions
|
||||||
from frappe.utils import flt, nowdate
|
from frappe.utils import escape_html, flt, nowdate
|
||||||
|
|
||||||
from erpnext.stock.utils import get_stock_balance
|
from erpnext.stock.utils import get_stock_balance
|
||||||
|
|
||||||
@@ -75,6 +75,9 @@ def get_warehouse_capacity_data(filters, start):
|
|||||||
balance_qty = get_stock_balance(entry.item_code, entry.warehouse, nowdate()) or 0
|
balance_qty = get_stock_balance(entry.item_code, entry.warehouse, nowdate()) or 0
|
||||||
entry.update(
|
entry.update(
|
||||||
{
|
{
|
||||||
|
"warehouse": escape_html(entry.warehouse),
|
||||||
|
"item_code": escape_html(entry.item_code),
|
||||||
|
"company": escape_html(entry.company),
|
||||||
"actual_qty": balance_qty,
|
"actual_qty": balance_qty,
|
||||||
"percent_occupied": flt((flt(balance_qty) / flt(entry.stock_capacity)) * 100, 0),
|
"percent_occupied": flt((flt(balance_qty) / flt(entry.stock_capacity)) * 100, 0),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user