Skip to content

Commit

Permalink
fix: patch globalStyles with barcodeShowText
Browse files Browse the repository at this point in the history
  • Loading branch information
dj12djdjs committed Mar 16, 2024
1 parent 798bcc0 commit 424a260
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion print_designer/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ print_designer.patches.introduce_jinja
print_designer.patches.introduce_schema_versioning
print_designer.patches.rerun_introduce_jinja
print_designer.patches.introduce_table_alt_row_styles
print_designer.patches.introduce_column_style
print_designer.patches.introduce_column_style
print_designer.patches.barcode_show_text
9 changes: 9 additions & 0 deletions print_designer/patches/barcode_show_text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import frappe


def execute():
for name, print_format in frappe.get_all("Print Format", filters={"print_designer": 1}, fields=["name", "print_designer_settings"], as_list=1):
print_format = frappe.parse_json(print_format)
if print_format and "barcode" in print_format["globalStyles"]:
print_format["globalStyles"]["barcode"]["showBarcodeText"] = True
frappe.set_value("Print Format", name, "print_designer_settings", frappe.as_json(print_format))

0 comments on commit 424a260

Please sign in to comment.