Merge branch 'develop' into subcontracted-rm-to-transfer-report-develop

This commit is contained in:
Marica 2021-06-11 17:50:43 +05:30 committed by GitHub
commit 19d36be624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,9 @@ def setup_company_independent_fixtures(patch=False):
add_print_formats()
def add_hsn_sac_codes():
if frappe.flags.in_test and frappe.flags.created_hsn_codes:
return
# HSN codes
with open(os.path.join(os.path.dirname(__file__), 'hsn_code_data.json'), 'r') as f:
hsn_codes = json.loads(f.read())
@ -38,6 +41,9 @@ def add_hsn_sac_codes():
sac_codes = json.loads(f.read())
create_hsn_codes(sac_codes, code_field="sac_code")
if frappe.flags.in_test:
frappe.flags.created_hsn_codes = True
def create_hsn_codes(data, code_field):
for d in data:
hsn_code = frappe.new_doc('GST HSN Code')