Merge pull request #10841 from rohitwaghchaure/subscription_patch_fix_docststus
[fix] Subscription patch broken if reference document has been cancelled
This commit is contained in:
commit
f551b43a94
@ -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()
|
Loading…
x
Reference in New Issue
Block a user