mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
10
erpnext/patches/profile_mark_not_in_create.py
Normal file
10
erpnext/patches/profile_mark_not_in_create.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import webnotes
|
||||||
|
def execute():
|
||||||
|
"""
|
||||||
|
Mark DocType Profile as 'not_in_create'
|
||||||
|
"""
|
||||||
|
webnotes.conn.sql("""
|
||||||
|
UPDATE `tabDocType`
|
||||||
|
SET in_create=1
|
||||||
|
WHERE name='Profile'
|
||||||
|
""")
|
||||||
@@ -417,7 +417,6 @@ class DocType:
|
|||||||
sch = Scheduler()
|
sch = Scheduler()
|
||||||
sch.connect()
|
sch.connect()
|
||||||
|
|
||||||
|
|
||||||
if self.doc.enabled == 1:
|
if self.doc.enabled == 1:
|
||||||
# Create scheduler entry
|
# Create scheduler entry
|
||||||
res = sch.conn.sql("""
|
res = sch.conn.sql("""
|
||||||
@@ -429,15 +428,21 @@ class DocType:
|
|||||||
|
|
||||||
if not (res and res[0]):
|
if not (res and res[0]):
|
||||||
args['next_execution'] = self.get_next_execution()
|
args['next_execution'] = self.get_next_execution()
|
||||||
|
sch.conn.begin()
|
||||||
sch.conn.sql("""
|
sch.conn.sql("""
|
||||||
INSERT INTO Event (db_name, event, `interval`, next_execution, recurring)
|
INSERT INTO Event (db_name, event, `interval`, next_execution, recurring)
|
||||||
VALUES (%(db_name)s, %(event)s, 86400, %(next_execution)s, 1)
|
VALUES (%(db_name)s, %(event)s, 86400, %(next_execution)s, 1)
|
||||||
""", args)
|
""", args)
|
||||||
|
sch.conn.commit()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# delete scheduler entry
|
# delete scheduler entry if no other email digest is enabled
|
||||||
sch.clear(args['db_name'], args['event'])
|
res = webnotes.conn.sql("""
|
||||||
|
SELECT * FROM `tabEmail Digest`
|
||||||
|
WHERE enabled=1
|
||||||
|
""")
|
||||||
|
if not (res and res[0]):
|
||||||
|
sch.clear(args['db_name'], args['event'])
|
||||||
#print "after on update"
|
#print "after on update"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class DocType:
|
|||||||
WHERE ifnull(docstatus,0)=0
|
WHERE ifnull(docstatus,0)=0
|
||||||
AND ifnull(istable,0)=0
|
AND ifnull(istable,0)=0
|
||||||
AND ifnull(issingle,0)=0
|
AND ifnull(issingle,0)=0
|
||||||
AND `module` NOT IN ('System','Utilities','Setup Masters','Roles','Recycle Bin','Mapper','Application Internal','Development')
|
AND `module` NOT IN ('System','Utilities','Setup Masters','Roles','Recycle Bin','Mapper','Application Internal','Development', 'Core')
|
||||||
ORDER BY `name` ASC""")
|
ORDER BY `name` ASC""")
|
||||||
|
|
||||||
rl = [''] + [a[0] for a in sql("select name from tabRole where ifnull(docstatus,0)=0")]
|
rl = [''] + [a[0] for a in sql("select name from tabRole where ifnull(docstatus,0)=0")]
|
||||||
|
|||||||
Reference in New Issue
Block a user