fix(e-invoicing): 'NoneType' object is not iterable (#25781)

This commit is contained in:
Saqib 2021-05-21 16:31:12 +05:30 committed by GitHub
parent 1097dc89c5
commit e930456be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ def validate_eligibility(doc):
invalid_supply_type = doc.get('gst_category') not in ['Registered Regular', 'SEZ', 'Overseas', 'Deemed Export']
company_transaction = doc.get('billing_address_gstin') == doc.get('company_gstin')
no_taxes_applied = not doc.get('taxes')
has_non_gst_item = any(d for d in doc.get('items') if d.get('is_non_gst'))
has_non_gst_item = any(d for d in doc.get('items', []) if d.get('is_non_gst'))
if invalid_company or invalid_supply_type or company_transaction or no_taxes_applied or has_non_gst_item:
return False