From 1077c782a3598ddd5ca9d1e4cf75334434ce5556 Mon Sep 17 00:00:00 2001 From: Alchez Date: Fri, 10 Nov 2017 11:14:57 +0530 Subject: [PATCH] [Fix] Packing Slip creation if custom field does not have a value (#11423) * [Fix] Packing Slip creation if custom field is Column/Section Break * Used no_value_fields and sorted imports * Update packing_slip.py --- .../stock/doctype/packing_slip/packing_slip.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py index 25fde08eec..ec5392f99e 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/packing_slip.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import flt, cint -from frappe import _ +import frappe +from frappe import _ +from frappe.model import no_value_fields from frappe.model.document import Document +from frappe.utils import cint, flt + class PackingSlip(Document): @@ -84,11 +86,12 @@ class PackingSlip(Document): * No. of Cases of this packing slip """ - # also pick custom fields from delivery note rows = [d.item_code for d in self.get("items")] - custom_fields = ', '.join(['dni.`{0}`'.format(d.fieldname) for d in \ - frappe.get_meta("Delivery Note Item").get_custom_fields()]) + # also pick custom fields from delivery note + custom_fields = ', '.join(['dni.`{0}`'.format(d.fieldname) + for d in frappe.get_meta("Delivery Note Item").get_custom_fields() + if d.fieldtype not in no_value_fields]) if custom_fields: custom_fields = ', ' + custom_fields