2019-01-22 12:52:20 +00:00
|
|
|
from __future__ import unicode_literals
|
2016-03-02 12:21:24 +00:00
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
|
|
|
for doctype in ('Sales Order', 'Purchase Order', 'Sales Invoice',
|
|
|
|
'Purchase Invoice'):
|
|
|
|
frappe.reload_doctype(doctype)
|
2016-03-03 05:07:45 +00:00
|
|
|
frappe.db.sql('''update `tab{0}` set submit_on_creation=1, notify_by_email=1
|
2016-03-02 12:21:24 +00:00
|
|
|
where is_recurring=1'''.format(doctype))
|
|
|
|
frappe.db.sql('''update `tab{0}` set notify_by_email=1
|
|
|
|
where is_recurring=1'''.format(doctype))
|
|
|
|
frappe.db.sql('''update `tab{0}` set recurring_id = name
|
|
|
|
where is_recurring=1 and ifnull(recurring_id, '') = "" '''.format(doctype))
|