Browse Source

Merge pull request #15418 from Don-Leopardo/fix_html_custom_print_fotmat

fix: Module path for external print formats
version-14
Rushabh Mehta 3 years ago
committed by GitHub
parent
commit
8dcf4d6f1f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      frappe/www/printview.py

+ 4
- 4
frappe/www/printview.py View File

@@ -2,9 +2,8 @@
# License: MIT. See LICENSE

import frappe, os, copy, json, re
from frappe import _
from frappe import _, get_module_path

from frappe.modules import get_doc_path
from frappe.core.doctype.access_log.access_log import make_access_log
from frappe.utils import cint, sanitize_html, strip_html
from frappe.utils.jinja_globals import is_rtl
@@ -251,8 +250,9 @@ def get_print_format(doctype, print_format):
frappe.DoesNotExistError)

# server, find template
path = os.path.join(get_doc_path(frappe.db.get_value("DocType", doctype, "module"),
"Print Format", print_format.name), frappe.scrub(print_format.name) + ".html")
module = print_format.module or frappe.db.get_value("DocType", doctype, "module")
path = os.path.join(get_module_path(module, "Print Format", print_format.name),
frappe.scrub(print_format.name) + ".html")

if os.path.exists(path):
with open(path, "r") as pffile:


Loading…
Cancel
Save