fix: Inactive items report fix

This commit is contained in:
deepeshgarg007 2019-05-02 19:32:43 +05:30
parent dc86bc756e
commit 9ae112bbfc
2 changed files with 12 additions and 13 deletions

View File

@ -599,3 +599,5 @@ erpnext.patches.v11_1.set_variant_based_on
erpnext.patches.v11_1.woocommerce_set_creation_user
erpnext.patches.v11_1.set_salary_details_submittable
erpnext.patches.v11_1.rename_depends_on_lwp
erpnext.patches.v11_1.set_missing_title_for_quotation
execute:frappe.delete_doc("Report", "Inactive Items")

View File

@ -80,27 +80,24 @@ def get_data(filters):
sales_invoice_data = get_sales_details(filters)
for item in items:
row = {
"item_group": item.item_group,
"item": item.name,
"item_name": item.item_name
}
if sales_invoice_data.get(item.name):
item_obj = sales_invoice_data[item.name]
if item_obj.days_since_last_order > cint(filters['days']):
row = {
row.update({
"territory": item_obj.territory,
"item_group": item_obj.item_group,
"item": item_obj.name,
"item_name": item_obj.item_name,
"customer": item_obj.customer,
"last_order_date": item_obj.last_order_date,
"qty": item_obj.qty,
"days_since_last_order": item_obj.days_since_last_order
}
data.append(row)
else:
row = {
"item_group": item.item_group,
"item": item.name,
"item_name": item.item_name
}
data.append(row)
})
data.append(row)
return data