fix: Refactor for Print Format changes (#17242)

- Rename Server to Jinja
- Rename Js to JS
This commit is contained in:
Faris Ansari 2019-04-22 12:08:18 +05:30 committed by GitHub
parent 89d3aaf349
commit 733ff48d51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -18,14 +18,14 @@ def create_or_update_cheque_print_format(template_name):
"doc_type": "Payment Entry",
"standard": "No",
"custom_format": 1,
"print_format_type": "Server",
"print_format_type": "Jinja",
"name": template_name
})
else:
cheque_print = frappe.get_doc("Print Format", template_name)
doc = frappe.get_doc("Cheque Print Template", template_name)
cheque_print.html = """
<style>
.print-format {
@ -91,9 +91,9 @@ def create_or_update_cheque_print_format(template_name):
"signatory_from_top_edge": doc.signatory_from_top_edge,
"signatory_from_left_edge": doc.signatory_from_left_edge
}
cheque_print.save(ignore_permissions=True)
frappe.db.set_value("Cheque Print Template", template_name, "has_print_format", 1)
return cheque_print

View File

@ -28,7 +28,7 @@ frappe.ui.form.on('POS Profile', {
return {
filters: [
['Print Format', 'doc_type', '=', 'Sales Invoice'],
['Print Format', 'print_format_type', '=', 'Server'],
['Print Format', 'print_format_type', '=', 'Jinja'],
]
};
});
@ -42,7 +42,7 @@ frappe.ui.form.on('POS Profile', {
});
frm.set_query("print_format", function() {
return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} };
return { filters: { doc_type: "Sales Invoice", print_format_type: "JS"} };
});
frappe.db.get_value('POS Settings', 'POS Settings', 'use_pos_in_offline_mode', (r) => {