Skip to content

Commit

Permalink
fix: fallback to item_name if description is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Apr 7, 2022
1 parent 8e42525 commit 7fc98e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions erpnext/stock/get_item_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from frappe import _, throw
from frappe.model import child_table_fields, default_fields
from frappe.model.meta import get_field_precision
from frappe.utils import add_days, add_months, cint, cstr, flt, getdate
from frappe.utils import add_days, add_months, cint, cstr, flt, getdate, strip_html

from erpnext import get_company_currency
from erpnext.accounts.doctype.pricing_rule.pricing_rule import (
Expand Down Expand Up @@ -332,11 +332,13 @@ def get_basic_details(args, item, overwrite_warehouse=True):
):
args["batch_no"] = ""

description = cstr(item.description).strip()

out = frappe._dict(
{
"item_code": item.name,
"item_name": item.item_name,
"description": cstr(item.description).strip(),
"description": description if strip_html(description).strip() else item.item_name,
"image": cstr(item.image).strip(),
"warehouse": warehouse,
"income_account": get_default_income_account(
Expand Down

0 comments on commit 7fc98e0

Please sign in to comment.