mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +00:00
[sales invoice] [update stock] allow update stock in sales invoice, without it being a pos invoice
This commit is contained in:
18
patches/may_2013/p07_move_update_stock_to_pos.py
Normal file
18
patches/may_2013/p07_move_update_stock_to_pos.py
Normal 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")
|
||||
Reference in New Issue
Block a user