* fix(ux): stock-item filter for Item Code field (cherry picked from commitccdcb7dfcc) * fix: don't show non-stock items in Stock Analytics report (cherry picked from commit01aadbef85) * fix: `linter` (cherry picked from commit15fff84bb5) --------- Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
@@ -1085,7 +1085,7 @@ class ReceivablePayableReport(object):
|
||||
)
|
||||
|
||||
if self.filters.show_remarks:
|
||||
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200),
|
||||
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200)
|
||||
|
||||
def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120):
|
||||
if not fieldname:
|
||||
|
||||
@@ -17,6 +17,7 @@ frappe.query_reports["Stock Analytics"] = {
|
||||
fieldtype: "Link",
|
||||
options:"Item",
|
||||
default: "",
|
||||
get_query: () => ({filters: { 'is_stock_item': 1 }}),
|
||||
},
|
||||
{
|
||||
fieldname: "value_quantity",
|
||||
|
||||
@@ -270,7 +270,7 @@ def get_items(filters):
|
||||
if item_code := filters.get("item_code"):
|
||||
return [item_code]
|
||||
else:
|
||||
item_filters = {}
|
||||
item_filters = {"is_stock_item": 1}
|
||||
if item_group := filters.get("item_group"):
|
||||
children = get_descendants_of("Item Group", item_group, ignore_permissions=True)
|
||||
item_filters["item_group"] = ("in", children + [item_group])
|
||||
|
||||
Reference in New Issue
Block a user