diff --git a/frappe/public/js/print_format_builder/PrintFormatControls.vue b/frappe/public/js/print_format_builder/PrintFormatControls.vue index dd54f8f55e..68e85354a3 100644 --- a/frappe/public/js/print_format_builder/PrintFormatControls.vue +++ b/frappe/public/js/print_format_builder/PrintFormatControls.vue @@ -72,7 +72,7 @@ export default { if (value < 0) { value = 0; } - this.$emit("update", { fieldname, value }); + this.$store.print_format[fieldname] = value; }, clone_field(df) { let cloned = pluck(df, [ @@ -80,9 +80,11 @@ export default { "fieldname", "fieldtype", "options", - "table_columns" + "table_columns", + "html" ]); - if (cloned.fieldname == "custom_html") { + if (cloned.custom) { + // generate unique fieldnames for custom blocks cloned.fieldname += "_" + frappe.utils.get_random(8); } return cloned; @@ -133,7 +135,8 @@ export default { label: __("Custom HTML"), fieldname: "custom_html", fieldtype: "HTML", - html: "" + html: "", + custom: 1 }, { label: __("ID (name)"), diff --git a/frappe/public/js/print_format_builder/PrintFormatSection.vue b/frappe/public/js/print_format_builder/PrintFormatSection.vue index 73772bd27a..b278a593f7 100644 --- a/frappe/public/js/print_format_builder/PrintFormatSection.vue +++ b/frappe/public/js/print_format_builder/PrintFormatSection.vue @@ -1,61 +1,82 @@ @@ -94,6 +115,12 @@ export default { this.$set(this.section, "columns", columns); }, + add_page_break() { + this.$set(this.section, "page_break", true); + }, + remove_page_break() { + this.$set(this.section, "page_break", false); + }, get_fields(column) { return column.fields.filter(df => !df.remove); } @@ -102,6 +129,10 @@ export default {