From c7b8c4a414cec3f589794a4d0851bd77b0fd16b5 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 31 May 2013 16:31:44 +0530 Subject: [PATCH] [move update stock to pos] set update_stock = 0 in old sales invoice where is_pos = 0 --- patches/may_2013/p07_move_update_stock_to_pos.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/patches/may_2013/p07_move_update_stock_to_pos.py b/patches/may_2013/p07_move_update_stock_to_pos.py index f76cda3212..7928728f4a 100644 --- a/patches/may_2013/p07_move_update_stock_to_pos.py +++ b/patches/may_2013/p07_move_update_stock_to_pos.py @@ -15,4 +15,9 @@ def execute(): webnotes.defaults.clear_cache("Control Panel") - webnotes.reload_doc("setup", "doctype", "global_defaults") \ No newline at end of file + webnotes.reload_doc("setup", "doctype", "global_defaults") + + # previously, update_stock was valid only when is_pos was checked + # henceforth it is valid, and hence the patch + webnotes.conn.sql("""update `tabSales Invoice` set update_stock=0 + where ifnull(is_pos, 0)=0""") \ No newline at end of file