feat: option to disable Item Tax Template
This commit is contained in:
parent
34fad75f5d
commit
f60e040d69
@ -2,7 +2,7 @@
|
|||||||
"actions": [],
|
"actions": [],
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"creation": "2018-11-22 22:45:00.370913",
|
"creation": "2022-01-19 01:09:13.297137",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Setup",
|
"document_type": "Setup",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
@ -10,6 +10,9 @@
|
|||||||
"field_order": [
|
"field_order": [
|
||||||
"title",
|
"title",
|
||||||
"company",
|
"company",
|
||||||
|
"column_break_3",
|
||||||
|
"disabled",
|
||||||
|
"section_break_5",
|
||||||
"taxes"
|
"taxes"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
@ -36,10 +39,24 @@
|
|||||||
"label": "Company",
|
"label": "Company",
|
||||||
"options": "Company",
|
"options": "Company",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_3",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "disabled",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Disabled"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_5",
|
||||||
|
"fieldtype": "Section Break"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-03-08 19:50:21.416513",
|
"modified": "2022-01-18 21:11:23.105589",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Item Tax Template",
|
"name": "Item Tax Template",
|
||||||
@ -82,6 +99,7 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"states": [],
|
||||||
"title_field": "title",
|
"title_field": "title",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
@ -707,6 +707,7 @@ def get_tax_template(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
|
|
||||||
item_doc = frappe.get_cached_doc('Item', filters.get('item_code'))
|
item_doc = frappe.get_cached_doc('Item', filters.get('item_code'))
|
||||||
item_group = filters.get('item_group')
|
item_group = filters.get('item_group')
|
||||||
|
company = filters.get('company')
|
||||||
taxes = item_doc.taxes or []
|
taxes = item_doc.taxes or []
|
||||||
|
|
||||||
while item_group:
|
while item_group:
|
||||||
@ -715,7 +716,7 @@ def get_tax_template(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
item_group = item_group_doc.parent_item_group
|
item_group = item_group_doc.parent_item_group
|
||||||
|
|
||||||
if not taxes:
|
if not taxes:
|
||||||
return frappe.db.sql(""" SELECT name FROM `tabItem Tax Template` """)
|
return frappe.get_all('Item Tax Template', filters={'disabled': 0, 'company': company}, as_list=True)
|
||||||
else:
|
else:
|
||||||
valid_from = filters.get('valid_from')
|
valid_from = filters.get('valid_from')
|
||||||
valid_from = valid_from[1] if isinstance(valid_from, list) else valid_from
|
valid_from = valid_from[1] if isinstance(valid_from, list) else valid_from
|
||||||
@ -724,7 +725,7 @@ def get_tax_template(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
'item_code': filters.get('item_code'),
|
'item_code': filters.get('item_code'),
|
||||||
'posting_date': valid_from,
|
'posting_date': valid_from,
|
||||||
'tax_category': filters.get('tax_category'),
|
'tax_category': filters.get('tax_category'),
|
||||||
'company': filters.get('company')
|
'company': company
|
||||||
}
|
}
|
||||||
|
|
||||||
taxes = _get_item_tax_template(args, taxes, for_validate=True)
|
taxes = _get_item_tax_template(args, taxes, for_validate=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user