Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions print_designer/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def before_install():
def after_install():
create_custom_fields(CUSTOM_FIELDS, ignore_validate=True)
on_print_designer_install()
add_pdf_generator_option()
# TODO: move to get-app command ( not that much harmful as it will check if it is already installed )
setup_chromium()


Expand All @@ -59,6 +57,9 @@ def setup_chromium():
except Exception as e:
click.echo(f"Failed to setup Chromium: {e}")
raise RuntimeError(f"Failed to setup Chromium: {e}")

add_pdf_generator_option()

return executable


Expand Down Expand Up @@ -321,6 +322,9 @@ def add_pdf_generator_option():
def set_pdf_generator_option(action: Literal["add", "remove"]):
options = (frappe.get_meta("Print Format").get_field("pdf_generator").options).split("\n")

if "chrome" in options and action == "add":
return

if action == "add":
if "chrome" not in options:
options.append("chrome")
Expand Down