[sales invoice] [update stock] allow update stock in sales invoice, without it being a pos invoice

This commit is contained in:
Anand Doshi
2013-05-30 17:43:30 +05:30
parent c6f890f892
commit ecc28f0311
12 changed files with 115 additions and 101 deletions

View File

@@ -0,0 +1,18 @@
import webnotes, webnotes.defaults
from webnotes.utils import cint
def execute():
webnotes.reload_doc("accounts", "doctype", "pos_setting")
webnotes.conn.sql("""update `tabPOS Setting` set update_stock=%s""",
cint(webnotes.defaults.get_global_default("update_stock")))
webnotes.conn.sql("""delete from `tabSingles`
where doctype='Global Defaults' and field='update_stock'""")
webnotes.conn.sql("""delete from `tabDefaultValue`
where parent='Control Panel' and defkey="update_stock" """)
webnotes.defaults.clear_cache("Control Panel")
webnotes.reload_doc("setup", "doctype", "global_defaults")