From 7ff69e10bfac9e034f14d80247a5b0c9dcb92b40 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 27 Apr 2012 18:27:06 +0530 Subject: [PATCH] repost stock for entries where posting time goes wrong --- .../patches/april_2012/repost_stock_for_posting_time.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 erpnext/patches/april_2012/repost_stock_for_posting_time.py diff --git a/erpnext/patches/april_2012/repost_stock_for_posting_time.py b/erpnext/patches/april_2012/repost_stock_for_posting_time.py new file mode 100644 index 0000000000..258a622be9 --- /dev/null +++ b/erpnext/patches/april_2012/repost_stock_for_posting_time.py @@ -0,0 +1,9 @@ +def execute(): + import webnotes + from webnotes.model.code import get_obj + + bins = sql("select distinct t2.name from `tabStock Ledger Entry` t1, tabBin t2 where t1.posting_time > '00:00:00' and t1.posting_time < '00:01:00' and t1.item_code = t2.item_code and t1.warehouse = t2.warehouse") + sql("update `tabStock Ledger Entry` set posting_time = '00:00:00' where posting_time > '00:00:00' and posting_time < '00:01:00'") + + for d in bins: + get_obj('Bin', d[0]).update_entries_after(posting_date = '2000-01-01', posting_time = '12:01')