From 358304d21657537a4e969ac05cb0face0a95d699 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 23 Mar 2012 11:12:03 +0530 Subject: [PATCH] fix in sales common regarding date formatting --- erpnext/selling/doctype/sales_common/sales_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_common/sales_common.py b/erpnext/selling/doctype/sales_common/sales_common.py index 63f53eab7b..5c1a8e451f 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.py +++ b/erpnext/selling/doctype/sales_common/sales_common.py @@ -515,7 +515,7 @@ class DocType(TransactionBase): dt = webnotes.conn.sql("select posting_date from `tab%s` where name = '%s'" % (d.prevdoc_doctype, d.prevdoc_docname)) else: dt = webnotes.conn.sql("select transaction_date from `tab%s` where name = '%s'" % (d.prevdoc_doctype, d.prevdoc_docname)) - d.prevdoc_date = dt and dt[0][0].strftime('%Y-%m-%d') or '' + d.prevdoc_date = (dt and dt[0][0]) and dt[0][0].strftime('%Y-%m-%d') or '' def update_prevdoc_detail(self, is_submit, obj): StatusUpdater(obj, is_submit).update()