patch: set default for add taxes from item tax template

This commit is contained in:
Nabin Hait 2019-11-11 15:44:27 +05:30
commit 32936024a0
3 changed files with 8 additions and 2 deletions

View File

@ -15,8 +15,8 @@ class AccountsSettings(Document):
frappe.clear_cache()
def validate(self):
for f in ["add_taxes_from_item_tax_template"]:
frappe.db.set_default(f, self.get(f, ""))
frappe.db.set_default("add_taxes_from_item_tax_template",
self.get("add_taxes_from_item_tax_template", 0))
self.validate_stale_days()
self.enable_payment_schedule_in_print()

View File

@ -644,3 +644,4 @@ erpnext.patches.v12_0.set_expense_account_in_landed_cost_voucher_taxes
erpnext.patches.v12_0.replace_accounting_with_accounts_in_home_settings
erpnext.patches.v12_0.set_payment_entry_status
erpnext.patches.v12_0.update_owner_fields_in_acc_dimension_custom_fields
erpnext.patches.v12_0.set_default_for_add_taxes_from_item_tax_template

View File

@ -0,0 +1,5 @@
import frappe
def execute():
frappe.db.set_value("Accounts Settings", None, "add_taxes_from_item_tax_template", 1)
frappe.db.set_default("add_taxes_from_item_tax_template", 1)