Selaa lähdekoodia

Merge pull request #15418 from Don-Leopardo/fix_html_custom_print_fotmat

fix: Module path for external print formats
version-14
Rushabh Mehta 3 vuotta sitten
committed by GitHub
vanhempi
commit
8dcf4d6f1f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. +4
    -4
      frappe/www/printview.py

+ 4
- 4
frappe/www/printview.py Näytä tiedosto

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


import frappe, os, copy, json, re 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.core.doctype.access_log.access_log import make_access_log
from frappe.utils import cint, sanitize_html, strip_html from frappe.utils import cint, sanitize_html, strip_html
from frappe.utils.jinja_globals import is_rtl from frappe.utils.jinja_globals import is_rtl
@@ -251,8 +250,9 @@ def get_print_format(doctype, print_format):
frappe.DoesNotExistError) frappe.DoesNotExistError)


# server, find template # 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): if os.path.exists(path):
with open(path, "r") as pffile: with open(path, "r") as pffile:


Ladataan…
Peruuta
Tallenna