From bc640fe6a62f525de597be884d9116e18f019f0e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 30 Jan 2018 19:26:28 +0530 Subject: [PATCH] minor fix in old patch --- erpnext/patches/v8_1/set_delivery_date_in_so_item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v8_1/set_delivery_date_in_so_item.py b/erpnext/patches/v8_1/set_delivery_date_in_so_item.py index aa5cbc50bc..e3e23a584e 100644 --- a/erpnext/patches/v8_1/set_delivery_date_in_so_item.py +++ b/erpnext/patches/v8_1/set_delivery_date_in_so_item.py @@ -13,11 +13,11 @@ def execute(): frappe.db.sql(""" update `tabSales Order` so, `tabSales Order Item` so_item - set so_item.delivery_date = so.delivery_date + set so_item.delivery_date = if(ifnull(so.delivery_date, '0000-00-00'), ifnull(so.delivery_date, '0000-00-00'), '0000-00-00') where so.name = so_item.parent and so.order_type = 'Sales' and (so_item.delivery_date is null or so_item.delivery_date = '' or so_item.delivery_date = '0000-00-00') - and (so.delivery_date is not null and so.delivery_date != '' + and (so.delivery_date is not null and so.delivery_date != '' and so.delivery_date != "" and so.delivery_date != '0000-00-00') """)