2012-03-28 13:42:36 +00:00
|
|
|
def execute():
|
|
|
|
import webnotes
|
2012-03-28 13:55:29 +00:00
|
|
|
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'""")
|
2012-03-28 13:55:29 +00:00
|
|
|
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'
|
2012-03-28 13:55:29 +00:00
|
|
|
AND validation_logic='docstatus = 1'""")
|