I need not to show "None" when if empty value in Part number field in SI

Hi All,
In my sales invoice, i had fetched part number from item transaction through this code {{ frappe.db.get_value(“Item”, doc.item, “custom_part_number”) }} my problem is if the part number field is empty it is showing none in sales invoice print i need not to show none


Thanks in Advance

Please use the item_code instead of the item

Example:

{% for row in doc.items %}
    {{ frappe.db.get_value("Item", row.item_code, "custom_part_number") or ''}}
{% endfor %}

Also, check the field the field name of the part number

1 Like

please guide how i keep your code inside this html


Thanks in Advance

Paste the above line in center part-number

because you used a doc instead of the row.

same for, item_code instead of the item

1 Like

Thank you so much