brotherton-erpnext/erpnext/patches/mar_2012/so_rv_mapper_fix.py

11 lines
406 B
Python
Raw Normal View History

2012-03-28 13:42:36 +00:00
def execute():
import webnotes
count = webnotes.conn.sql("""SELECT COUNT(*) FROM `tabTable Mapper Detail`
2012-03-30 06:59:06 +00:00
WHERE parent='Sales Order-Sales Invoice'
AND from_table='Sales Order Item'""")
if count and count[0][0]==2:
webnotes.conn.sql("""DELETE FROM `tabTable Mapper Detail`
2012-03-30 06:59:06 +00:00
WHERE parent='Sales Order-Sales Invoice'
AND from_table='Sales Order Item'
AND validation_logic='docstatus = 1'""")