From 571a9d0f198c53e675493d0af960cb715407af5e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 3 Mar 2016 15:03:23 +0530 Subject: [PATCH] [fix] [tests] --- erpnext/controllers/recurring_document.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py index a853e10d87..2f5fccc390 100644 --- a/erpnext/controllers/recurring_document.py +++ b/erpnext/controllers/recurring_document.py @@ -3,13 +3,10 @@ import frappe import frappe.utils import frappe.defaults -from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, \ - get_first_day, get_last_day, comma_and, split_emails -from frappe.model.naming import make_autoname +from frappe.utils import cint, cstr, getdate, nowdate, \ + get_first_day, get_last_day, split_emails from frappe import _, msgprint, throw -from erpnext.accounts.party import get_party_account, get_due_date, get_party_details -from frappe.model.mapper import get_mapped_doc month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} date_field_map = { @@ -166,7 +163,7 @@ def validate_recurring_document(doc): if doc.is_recurring: validate_notification_email_id(doc) - if not doc.recurring_id: + if not doc.recurring_id and not doc.is_new(): doc.recurring_id = doc.name if not doc.recurring_type: