mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
fixed conflict
This commit is contained in:
42
patches/march_2013/p07_update_project_in_stock_ledger.py
Normal file
42
patches/march_2013/p07_update_project_in_stock_ledger.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("stock", "doctype", "stock_ledger_entry")
|
||||
|
||||
# from stock entry
|
||||
webnotes.conn.sql("""update
|
||||
`tabStock Ledger Entry` sle,
|
||||
`tabStock Entry` st
|
||||
set sle.project = st.project_name
|
||||
where
|
||||
sle.voucher_type = "Stock Entry"
|
||||
and sle.voucher_no = st.name""")
|
||||
|
||||
# from purchase
|
||||
webnotes.conn.sql("""update
|
||||
`tabStock Ledger Entry` sle,
|
||||
`tabPurchase Receipt Item` pri
|
||||
set sle.project = pri.project_name
|
||||
where
|
||||
sle.voucher_type = "Purchase Receipt"
|
||||
and sle.voucher_detail_no = pri.name""")
|
||||
|
||||
# from delivery note
|
||||
webnotes.conn.sql("""update
|
||||
`tabStock Ledger Entry` sle,
|
||||
`tabDelivery Note` dn
|
||||
set sle.project = dn.project_name
|
||||
where
|
||||
sle.voucher_type = "Delivery Note"
|
||||
and sle.voucher_no = dn.name""")
|
||||
|
||||
# from pos invoice
|
||||
webnotes.conn.sql("""update
|
||||
`tabStock Ledger Entry` sle,
|
||||
`tabSales Invoice` si
|
||||
set sle.project = si.project_name
|
||||
where
|
||||
sle.voucher_type = "Sales Invoice"
|
||||
and sle.voucher_no = si.name""")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user