diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template.json b/erpnext/accounts/doctype/item_tax_template/item_tax_template.json index 8915f79b926..77c9e95b759 100644 --- a/erpnext/accounts/doctype/item_tax_template/item_tax_template.json +++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template.json @@ -1,7 +1,7 @@ { + "actions": [], "allow_import": 1, "allow_rename": 1, - "autoname": "field:title", "creation": "2018-11-22 22:45:00.370913", "doctype": "DocType", "document_type": "Setup", @@ -20,8 +20,7 @@ "in_list_view": 1, "label": "Title", "no_copy": 1, - "reqd": 1, - "unique": 1 + "reqd": 1 }, { "fieldname": "taxes", @@ -33,12 +32,14 @@ { "fieldname": "company", "fieldtype": "Link", + "in_list_view": 1, "label": "Company", "options": "Company", "reqd": 1 } ], - "modified": "2020-09-18 17:26:09.703215", + "links": [], + "modified": "2021-03-08 19:50:21.416513", "modified_by": "Administrator", "module": "Accounts", "name": "Item Tax Template", @@ -81,5 +82,6 @@ "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", + "title_field": "title", "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template.py b/erpnext/accounts/doctype/item_tax_template/item_tax_template.py index e77481d44f5..d9155cbab4a 100644 --- a/erpnext/accounts/doctype/item_tax_template/item_tax_template.py +++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template.py @@ -11,6 +11,11 @@ class ItemTaxTemplate(Document): def validate(self): self.validate_tax_accounts() + def autoname(self): + if self.company and self.title: + abbr = frappe.get_cached_value('Company', self.company, 'abbr') + self.name = '{0} - {1}'.format(self.title, abbr) + def validate_tax_accounts(self): """Check whether Tax Rate is not entered twice for same Tax Type""" check_list = []