39 lines
1.3 KiB
Python
Raw Normal View History

from __future__ import unicode_literals
2012-02-27 12:48:35 +05:30
def execute():
import webnotes
from webnotes.model import delete_doc
2012-03-12 14:34:55 +05:30
from webnotes.modules import reload_doc
2012-02-27 12:48:35 +05:30
webnotes.conn.sql("""delete from `tabDocField`
where label in ('Note1', 'OT Notes', 'Note', 'Note HTML', 'Rates HTML')
2012-03-30 12:29:06 +05:30
and parent in ('Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice', 'Purchase Order')""")
2012-02-27 12:48:35 +05:30
del_flds = {
2012-03-30 12:29:06 +05:30
'Sales Order Item': "'delivery_date', 'confirmation_date'",
2012-02-28 14:14:20 +05:30
'Delivery Note': "'supplier', 'supplier_address', 'purchase_receipt_no', 'purchase_order_no', 'transaction_date'",
2012-03-30 12:29:06 +05:30
'Sales Invoice': "'voucher_date'",
'Purchase Invoice': "'voucher_date'",
'Purchase Receipt': "'transaction_date'"
2012-02-27 12:48:35 +05:30
}
del_labels = {
'Delivery Note': "'Supplier Details'",
'Purchase Receipt': "'Get Currrent Stock'"
2012-02-27 12:48:35 +05:30
}
for d in del_flds:
2012-03-01 15:51:33 +05:30
webnotes.conn.sql("delete from `tabDocField` where fieldname in (%s) and parent = '%s'"% (del_flds[d], d))
2012-02-27 12:48:35 +05:30
for d in del_labels:
2012-03-01 15:51:33 +05:30
webnotes.conn.sql("delete from `tabDocField` where label in (%s) and parent = '%s'"% (del_labels[d], d))
2012-02-27 12:48:35 +05:30
delete_doc('DocType', 'Update Delivery Date Detail')
2012-02-28 14:14:20 +05:30
2012-03-01 13:58:13 +05:30
# Reload print formats
reload_doc('accounts', 'Print Format', 'Sales Invoice Classic')
reload_doc('accounts', 'Print Format', 'Sales Invoice Modern')
reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan')