diff --git a/erpnext/patches/install_print_formats.py b/erpnext/patches/install_print_formats.py new file mode 100644 index 00000000000..af9756bbd7a --- /dev/null +++ b/erpnext/patches/install_print_formats.py @@ -0,0 +1,80 @@ +import os, sys + +path_to_file = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ['print_formats']) + +def prepare_pf_dict(args_list): + """ + + """ + pf_list = [] + for a in args_list: + for pf_type in ['Classic', 'Modern', 'Spartan']: + pf = {} + pf['name'] = " ".join([a['name'], pf_type]) + pf['file'] = os.sep.join([path_to_file, "".join(pf['name'].split(" ")) + ".html"]) + pf['module'] = a['module'] + pf['doc_type'] = a['doc_type'] + pf['standard'] = 'Yes' + pf_list += [pf] + return pf_list + + +pf_to_install = prepare_pf_dict([ + { + 'name' : 'Sales Invoice', + 'doc_type' : 'Receivable Voucher', + 'module' : 'Accounts' + }, + { + 'name' : 'Sales Order', + 'doc_type' : 'Sales Order', + 'module' : 'Selling' + }, + { + 'name' : 'Quotation', + 'doc_type' : 'Quotation', + 'module' : 'Selling' + }, + { + 'name' : 'Delivery Note', + 'doc_type' : 'Delivery Note', + 'module' : 'Stock' + }, + { + 'name' : 'Purchase Order', + 'doc_type' : 'Purchase Order', + 'module' : 'Buying' + } +]) + +def execute(): + """ + Install print formats + """ + global pf_to_install + print pf_to_install + for pf in pf_to_install: + install_print_format(pf) + print "Installed PF: " + pf['name'] + + +def install_print_format(args): + """ + Installs print format + args is a dict consisting of following keys: + * name + * module + * doctype + * standard = "Yes"/"No" + * file + """ + from webnotes.model.doc import Document + d = Document('Print Format') + d.name = args.name + f = open(args.file) + d.html = f.read() + f.close() + d.module = args.module + d.doc_type = args.doc_type + d.standard = args.standard + d.save(1) diff --git a/erpnext/patches/print_formats/DeliveryNoteClassic.html b/erpnext/patches/print_formats/DeliveryNoteClassic.html new file mode 100644 index 00000000000..0db80b9daba --- /dev/null +++ b/erpnext/patches/print_formats/DeliveryNoteClassic.html @@ -0,0 +1,279 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/DeliveryNoteModern.html b/erpnext/patches/print_formats/DeliveryNoteModern.html new file mode 100644 index 00000000000..634bea0c350 --- /dev/null +++ b/erpnext/patches/print_formats/DeliveryNoteModern.html @@ -0,0 +1,306 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/DeliveryNoteSpartan.html b/erpnext/patches/print_formats/DeliveryNoteSpartan.html new file mode 100644 index 00000000000..10ca9dd11b5 --- /dev/null +++ b/erpnext/patches/print_formats/DeliveryNoteSpartan.html @@ -0,0 +1,302 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/erpnext/patches/print_formats/PurchaseOrderClassic.html b/erpnext/patches/print_formats/PurchaseOrderClassic.html new file mode 100644 index 00000000000..0e51c6148aa --- /dev/null +++ b/erpnext/patches/print_formats/PurchaseOrderClassic.html @@ -0,0 +1,249 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/PurchaseOrderModern.html b/erpnext/patches/print_formats/PurchaseOrderModern.html new file mode 100644 index 00000000000..b159242aded --- /dev/null +++ b/erpnext/patches/print_formats/PurchaseOrderModern.html @@ -0,0 +1,276 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/PurchaseOrderSpartan.html b/erpnext/patches/print_formats/PurchaseOrderSpartan.html new file mode 100644 index 00000000000..ac4fc02f482 --- /dev/null +++ b/erpnext/patches/print_formats/PurchaseOrderSpartan.html @@ -0,0 +1,272 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/erpnext/patches/print_formats/QuotationClassic.html b/erpnext/patches/print_formats/QuotationClassic.html new file mode 100644 index 00000000000..5672fe9e130 --- /dev/null +++ b/erpnext/patches/print_formats/QuotationClassic.html @@ -0,0 +1,256 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/QuotationModern.html b/erpnext/patches/print_formats/QuotationModern.html new file mode 100644 index 00000000000..fadecf2b8e3 --- /dev/null +++ b/erpnext/patches/print_formats/QuotationModern.html @@ -0,0 +1,283 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/QuotationSpartan.html b/erpnext/patches/print_formats/QuotationSpartan.html new file mode 100644 index 00000000000..bf518808128 --- /dev/null +++ b/erpnext/patches/print_formats/QuotationSpartan.html @@ -0,0 +1,279 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/erpnext/patches/print_formats/SalesInvoiceClassic.html b/erpnext/patches/print_formats/SalesInvoiceClassic.html new file mode 100644 index 00000000000..f7eddcb7c2b --- /dev/null +++ b/erpnext/patches/print_formats/SalesInvoiceClassic.html @@ -0,0 +1,261 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/SalesInvoiceModern.html b/erpnext/patches/print_formats/SalesInvoiceModern.html new file mode 100644 index 00000000000..f5d4d7c7446 --- /dev/null +++ b/erpnext/patches/print_formats/SalesInvoiceModern.html @@ -0,0 +1,288 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/SalesInvoiceSpartan.html b/erpnext/patches/print_formats/SalesInvoiceSpartan.html new file mode 100644 index 00000000000..d25bc1abfae --- /dev/null +++ b/erpnext/patches/print_formats/SalesInvoiceSpartan.html @@ -0,0 +1,284 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/erpnext/patches/print_formats/SalesOrderClassic.html b/erpnext/patches/print_formats/SalesOrderClassic.html new file mode 100644 index 00000000000..fcf104ebf03 --- /dev/null +++ b/erpnext/patches/print_formats/SalesOrderClassic.html @@ -0,0 +1,260 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/SalesOrderModern.html b/erpnext/patches/print_formats/SalesOrderModern.html new file mode 100644 index 00000000000..7013e5d3f92 --- /dev/null +++ b/erpnext/patches/print_formats/SalesOrderModern.html @@ -0,0 +1,287 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/SalesOrderSpartan.html b/erpnext/patches/print_formats/SalesOrderSpartan.html new file mode 100644 index 00000000000..03521542088 --- /dev/null +++ b/erpnext/patches/print_formats/SalesOrderSpartan.html @@ -0,0 +1,283 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/index.html b/index.html index 315fe8ab4ca..c28b0aa3a9a 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ ERPNext -
- \ No newline at end of file + diff --git a/versions-master.db b/versions-master.db index 6628a8935f4..57072436b65 100644 Binary files a/versions-master.db and b/versions-master.db differ