[Fix] Disabled print settings for the custom print format (#2291)

This commit is contained in:
rohitwaghchaure 2016-11-10 14:55:24 +05:30 committed by Rushabh Mehta
parent ff9819ed8f
commit d8204d0891
3 changed files with 26 additions and 0 deletions

View file

@ -145,3 +145,4 @@ frappe.patches.v7_0.cleanup_list_settings
execute:frappe.db.set_default('language', '')
frappe.patches.v7_1.refactor_integration_broker
frappe.patches.v7_1.set_backup_limit
frappe.patches.v7_1.disabled_print_settings_for_custom_print_format

View file

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("""
update
`tabPrint Format`
set
align_labels_left = 0, line_breaks = 0, show_section_headings = 0
where
custom_format = 1
""")

View file

@ -33,3 +33,12 @@ frappe.ui.form.on("Print Format", "refresh", function(frm) {
});
}
});
frappe.ui.form.on("Print Format", {
'custom_format': function(frm) {
value = frm.doc.custom_format ? 0:1;
frm.set_value('align_labels_left', value);
frm.set_value('show_section_headings', value);
frm.set_value('line_breaks', value);
}
})