2012-02-27 07:18:35 +00:00
|
|
|
def execute():
|
|
|
|
import webnotes
|
|
|
|
from webnotes.model import delete_doc
|
2012-03-12 09:04:55 +00:00
|
|
|
from webnotes.modules import reload_doc
|
2012-02-27 07:18:35 +00:00
|
|
|
|
2012-02-28 08:44:20 +00:00
|
|
|
dt = {
|
2012-02-27 13:16:51 +00:00
|
|
|
'selling': ['quotation', 'sales_order', 'quotation_detail', 'sales_order_detail'],
|
|
|
|
'stock': ['delivery_note', 'delivery_note_detail', 'purchase_receipt', 'purchase_receipt_detail'],
|
|
|
|
'accounts': ['receivable_voucher', 'payable_voucher', 'rv_detail', 'pv_detail', 'rv_tax_detail', 'purchase_tax_detail'],
|
|
|
|
'buying': ['purchase_order', 'po_detail']
|
2012-02-28 08:44:20 +00:00
|
|
|
}
|
2012-02-27 13:16:51 +00:00
|
|
|
for m in dt:
|
2012-02-28 08:44:20 +00:00
|
|
|
for d in dt[m]:
|
2012-02-27 13:16:51 +00:00
|
|
|
reload_doc(m, 'doctype', d)
|
|
|
|
|
2012-02-27 07:18:35 +00:00
|
|
|
|
|
|
|
webnotes.conn.sql("""delete from `tabDocField`
|
|
|
|
where label in ('Note1', 'OT Notes', 'Note', 'Note HTML', 'Rates HTML')
|
2012-02-27 13:16:51 +00:00
|
|
|
and parent in ('Quotation', 'Sales Order', 'Delivery Note', 'Receivable Voucher', 'Purchase Order')""")
|
|
|
|
|
2012-02-27 07:18:35 +00:00
|
|
|
|
|
|
|
del_flds = {
|
|
|
|
'Sales Order Detail': "'delivery_date', 'confirmation_date'",
|
2012-02-28 08:44:20 +00:00
|
|
|
'Delivery Note': "'supplier', 'supplier_address', 'purchase_receipt_no', 'purchase_order_no', 'transaction_date'",
|
2012-02-27 13:16:51 +00:00
|
|
|
'Receivable Voucher': "'voucher_date'",
|
|
|
|
'Payable Voucher': "'voucher_date'",
|
|
|
|
'Purchase Receipt': "'transaction_date'"
|
2012-02-27 07:18:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
del_labels = {
|
2012-02-27 13:16:51 +00:00
|
|
|
'Delivery Note': "'Supplier Details'",
|
|
|
|
'Purchase Receipt': "'Get Currrent Stock'"
|
2012-02-27 07:18:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for d in del_flds:
|
2012-03-01 10:21:33 +00:00
|
|
|
webnotes.conn.sql("delete from `tabDocField` where fieldname in (%s) and parent = '%s'"% (del_flds[d], d))
|
2012-02-27 07:18:35 +00:00
|
|
|
|
|
|
|
for d in del_labels:
|
2012-03-01 10:21:33 +00:00
|
|
|
webnotes.conn.sql("delete from `tabDocField` where label in (%s) and parent = '%s'"% (del_labels[d], d))
|
2012-02-27 07:18:35 +00:00
|
|
|
|
|
|
|
delete_doc('DocType', 'Update Delivery Date Detail')
|
2012-02-28 08:44:20 +00:00
|
|
|
|
2012-03-01 08:28:13 +00:00
|
|
|
# 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')
|
|
|
|
|