mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
sync with gateway now in defs - no need for utility in wnf
This commit is contained in:
15
wnf.py
15
wnf.py
@@ -78,9 +78,7 @@ def setup_options():
|
|||||||
# install
|
# install
|
||||||
parser.add_option('--install', nargs=3, metavar = "rootpassword dbname source",
|
parser.add_option('--install', nargs=3, metavar = "rootpassword dbname source",
|
||||||
help="install fresh db")
|
help="install fresh db")
|
||||||
parser.add_option('--sync_with_gateway', nargs=1, metavar = "1/0", \
|
|
||||||
help="Set or Unset Sync with Gateway")
|
|
||||||
|
|
||||||
# diff
|
# diff
|
||||||
parser.add_option('--diff_ref_file', nargs=0, \
|
parser.add_option('--diff_ref_file', nargs=0, \
|
||||||
help="Get missing database records and mismatch properties, with file as reference")
|
help="Get missing database records and mismatch properties, with file as reference")
|
||||||
@@ -185,17 +183,6 @@ def run():
|
|||||||
inst.import_from_db(options.install[1], source_path=options.install[2], \
|
inst.import_from_db(options.install[1], source_path=options.install[2], \
|
||||||
password='admin', verbose = 1)
|
password='admin', verbose = 1)
|
||||||
|
|
||||||
elif options.sync_with_gateway:
|
|
||||||
if int(options.sync_with_gateway[0]) in [0, 1]:
|
|
||||||
webnotes.conn.begin()
|
|
||||||
webnotes.conn.sql("""\
|
|
||||||
UPDATE `tabSingles` SET value=%s
|
|
||||||
WHERE field='sync_with_gateway' AND doctype='Control Panel'""", int(options.sync_with_gateway[0]))
|
|
||||||
webnotes.conn.commit()
|
|
||||||
webnotes.message_log.append("sync_with_gateway set to %s" % options.sync_with_gateway[0])
|
|
||||||
else:
|
|
||||||
webnotes.message_log.append("ERROR: sync_with_gateway can be either 0 or 1")
|
|
||||||
|
|
||||||
elif options.diff_ref_file is not None:
|
elif options.diff_ref_file is not None:
|
||||||
import webnotes.modules.diff
|
import webnotes.modules.diff
|
||||||
webnotes.modules.diff.diff_ref_file()
|
webnotes.modules.diff.diff_ref_file()
|
||||||
|
|||||||
Reference in New Issue
Block a user