From f7b39438d2f2fa512c19c1bd237b3277dd24e003 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 19 Mar 2018 11:32:39 +0530 Subject: [PATCH] travis fix --- erpnext/controllers/selling_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 606cc90866..2a22b32637 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -330,7 +330,7 @@ class SellingController(StockController): self.make_sl_entries(sl_entries) def set_po_nos(self): - if self.doctype in ("Delivery Note", "Sales Invoice"): + if self.doctype in ("Delivery Note", "Sales Invoice") and hasattr(self, "items"): ref_fieldname = "against_sales_order" if self.doctype == "Delivery Note" else "sales_order" sales_orders = list(set([d.get(ref_fieldname) for d in self.items if d.get(ref_fieldname)])) if sales_orders: