brotherton-erpnext/patches/mar_2012/so_rv_mapper_fix.py

12 lines
446 B
Python
Raw Normal View History

from __future__ import unicode_literals
2012-03-28 19:12:36 +05:30
def execute():
import webnotes
count = webnotes.conn.sql("""SELECT COUNT(*) FROM `tabTable Mapper Detail`
2012-03-30 12:29:06 +05:30
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 12:29:06 +05:30
WHERE parent='Sales Order-Sales Invoice'
AND from_table='Sales Order Item'
AND validation_logic='docstatus = 1'""")