mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-27 02:28:30 +00:00
[fix] Subscription patch broken if reference document has been cancelled
This commit is contained in:
@@ -20,8 +20,8 @@ def execute():
|
||||
def get_data(doctype):
|
||||
return frappe.db.sql(""" select name, from_date, end_date, recurring_type,recurring_id,
|
||||
next_date, notify_by_email, notification_email_address, recurring_print_format,
|
||||
repeat_on_day_of_month, submit_on_creation
|
||||
from `tab{0}` where is_recurring = 1 and next_date >= %s
|
||||
repeat_on_day_of_month, submit_on_creation, docstatus
|
||||
from `tab{0}` where is_recurring = 1 and next_date >= %s and docstatus < 2
|
||||
""".format(doctype), today(), as_dict=1)
|
||||
|
||||
def make_subscription(doctype, data):
|
||||
@@ -39,4 +39,5 @@ def make_subscription(doctype, data):
|
||||
'submit_on_creation': data.submit_on_creation
|
||||
}).insert(ignore_permissions=True)
|
||||
|
||||
doc.submit()
|
||||
if data.docstatus == 1:
|
||||
doc.submit()
|
||||
Reference in New Issue
Block a user