From f37d4337a486c6bc8ee7976d627f1a039f66ac19 Mon Sep 17 00:00:00 2001 From: Sambhaji Kolate Date: Mon, 15 Sep 2014 13:37:46 +0530 Subject: [PATCH] fix test for purchase order --- erpnext/controllers/recurring_document.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py index 7b4310badad..32b1cebd036 100644 --- a/erpnext/controllers/recurring_document.py +++ b/erpnext/controllers/recurring_document.py @@ -16,6 +16,8 @@ month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} def create_recurring_documents(): manage_recurring_documents("Sales Order") manage_recurring_documents("Sales Invoice") + manage_recurring_documents("Purchase Order") + manage_recurring_documents("Purchase Invoice") def manage_recurring_documents(doctype, next_date=None, commit=True): """ @@ -28,6 +30,10 @@ def manage_recurring_documents(doctype, next_date=None, commit=True): date_field = "transaction_date" elif doctype == "Sales Invoice": date_field = "posting_date" + elif doctype == "Purchase Order": + date_field = "transaction_date" + elif doctype == "Purchase Invoice": + date_field = "posting_date" recurring_documents = frappe.db.sql("""select name, recurring_id from `tab{}` where ifnull(is_recurring, 0)=1