Merge pull request #17466 from deepeshgarg007/inactive-items-fix-develop

fix: Inactive sales items report fix
This commit is contained in:
Deepesh Garg 2019-05-03 11:54:05 +05:30 committed by GitHub
commit 8ca3df7aac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 13 deletions

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

View File

@ -599,3 +599,4 @@ 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
execute:frappe.delete_doc("Report", "Inactive Items")