Merge branch 'enterprise-hotfix' of https://github.com/frappe/erpnext into enterprise-hotfix

This commit is contained in:
Deepesh Garg
2021-09-07 18:15:01 +05:30

View File

@@ -861,6 +861,22 @@ def get_depreciation_amount(asset, depreciable_value, row):
return depreciation_amount
def delete_gst_settings_for_company(doc, method):
if doc.country != 'India':
return
gst_settings = frappe.get_doc("GST Settings")
records_to_delete = []
for d in reversed(gst_settings.get('gst_accounts')):
if d.company == doc.name:
records_to_delete.append(d)
for d in records_to_delete:
gst_settings.remove(d)
gst_settings.save()
def set_item_tax_from_hsn_code(item):
if not item.taxes and item.gst_hsn_code:
hsn_doc = frappe.get_doc("GST HSN Code", item.gst_hsn_code)