2012-07-19 13:40:31 +05:30
|
|
|
from __future__ import unicode_literals
|
2012-03-28 19:12:36 +05:30
|
|
|
def execute():
|
|
|
|
import webnotes
|
2012-03-28 19:25:29 +05:30
|
|
|
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'""")
|
2012-03-28 19:25:29 +05:30
|
|
|
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'
|
2012-03-28 19:25:29 +05:30
|
|
|
AND validation_logic='docstatus = 1'""")
|