Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(india): keyerror while generating e-way bill from an e-invoice #30879

Conversation

maharshivpatel
Copy link
Contributor

When an IRN is created and the user tries to Generate E-way Bill (Part A) using Generate Eway Bill (E-Invoicing). KeyError(None) is raised due to invoice.mode_of_transport being None from Generate E-Way Bill Dialog and it prevents the user from creating Eway Bill ( Part A ) which can be generated by only providing transporter.

I have made a small change that prevents KeyError and allow the user to create E-Way bill ( Part A ).

This Closes #30878

…ay bill (part a)

When an IRN is created and the user tries to Generate E-way Bill (Part A) using Generate Eway Bill (E-Invoicing). KeyError(None) is raised due to invoice.mode_of_transport being None from Generate E-Way Bill Dialog and it prevents the user from creating Eway Bill ( Part A ) which can be generated by only providing transporter.
@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label May 2, 2022
@maharshivpatel
Copy link
Contributor Author

I have many bug fixes and UI/UX improvements for E-invoice & Eway Bill but as Rushabh suggested on the forum that we should start with small bug fixes so I am creating small issues and fixing them one at a time.

However, this is inefficient so I would like to know your opinion on what should I do? continue with small fixes for now or create one big pull request with many fixes and improvements?

@nextchamp-saqib
Copy link
Member

Hey @maharshivpatel Thanks for all the contribution!

I would say it's your choice, you can raise one PR for all the fixes/improvements that describes each major change OR small ones with just like these
Just that it'll take more time merging it, as there might possibly be multiple changes requested

@maharshivpatel
Copy link
Contributor Author

@nextchamp-saqib Thank you for your response then i will continue with small fixes.

@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #30879 (e1c1cac) into develop (564f5b2) will increase coverage by 0.18%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop   #30879      +/-   ##
===========================================
+ Coverage    62.80%   62.98%   +0.18%     
===========================================
  Files          983      983              
  Lines        67062    67062              
===========================================
+ Hits         42115    42242     +127     
+ Misses       24947    24820     -127     
Impacted Files Coverage Δ
erpnext/regional/india/e_invoice/utils.py 42.01% <ø> (ø)
...tch_item_expiry_status/batch_item_expiry_status.py 67.92% <0.00%> (-24.53%) ⬇️
...wise_balance_history/batch_wise_balance_history.py 67.79% <0.00%> (-22.04%) ⬇️
...pnext/accounts/report/gross_profit/gross_profit.py 81.48% <0.00%> (-3.71%) ⬇️
...e/asset_value_adjustment/asset_value_adjustment.py 86.04% <0.00%> (-3.49%) ⬇️
erpnext/crm/doctype/prospect/prospect.py 56.71% <0.00%> (-1.50%) ⬇️
...t/accounts/report/sales_register/sales_register.py 70.76% <0.00%> (-1.17%) ⬇️
...ctype/accounting_dimension/accounting_dimension.py 65.64% <0.00%> (-0.77%) ⬇️
erpnext/controllers/sales_and_purchase_return.py 85.07% <0.00%> (-0.75%) ⬇️
erpnext/accounts/doctype/pricing_rule/utils.py 69.84% <0.00%> (-0.52%) ⬇️
... and 22 more

@nextchamp-saqib nextchamp-saqib changed the title fix(india): e-invoice allows user to generate e-way bill (part a) fix(india): keyerror while generating e-way bill from an e-invoice May 6, 2022
@nextchamp-saqib nextchamp-saqib merged commit ee7a7eb into frappe:develop May 6, 2022
mergify bot pushed a commit that referenced this pull request May 6, 2022
deepeshgarg007 added a commit that referenced this pull request May 6, 2022
…-30879

fix(india): keyerror while generating e-way bill from an e-invoice (backport #30879)
frappe-pr-bot pushed a commit that referenced this pull request May 10, 2022
# [13.29.0](v13.28.0...v13.29.0) (2022-05-10)

### Bug Fixes

* Consider paryt and party type as well in group by consolidated view ([189fc89](189fc89))
* disable form save on naming series tool ([#30909](#30909)) ([#30910](#30910)) ([d60a6cb](d60a6cb))
* double future qty updates ([0db3013](0db3013))
* HSN-wise-summary of outward supplies Updated Report ([3637525](3637525))
* Ignore loan repayments made from salary slip ([b7e1d40](b7e1d40))
* **india:** invoice type for a debit note e-invoice ([#30948](#30948)) ([c46add3](c46add3))
* **india:** keyerror while generating e-way bill from an e-invoice ([#30879](#30879)) ([98d799e](98d799e))
* **india:** re-arrange e-way bill dialog fields ([#30941](#30941)) ([7ce5c93](7ce5c93))
* Item Alternative Test ([964de1f](964de1f))
* patch for renaming membership settings ([#30929](#30929)) ([9189653](9189653))
* **pos:** creating pos returns resets pricing rules & discounts ([#30936](#30936)) ([a0e39db](a0e39db))
* remove check for already allocated earned leaves ([#30931](#30931)) ([#30932](#30932)) ([80f7d66](80f7d66))
* Remove commit from stock entry test. The assertion is not important ([c449b35](c449b35))
* Set available-for-use date if missing ([#30838](#30838)) ([bf2eaec](bf2eaec))
* show group warehouse in Sales Order ([#30891](#30891)) ([#30893](#30893)) ([c458e14](c458e14))
* Show linked time sheets in sales invoice dashboard ([4f4af52](4f4af52))
* sort before picking next stock reco ([e27fb58](e27fb58))
* subtract change_amount from paid_amount field on POS Register ([#30937](#30937)) ([b7e873b](b7e873b))
* Unlink and delete batch created from stock reco on cancel ([fc35323](fc35323))
* Wrap SLE actual_qty in `flt` to avoid NoneType operation ([d53228b](d53228b))

### Features

* **HR:** Leave Type configuration to allow over allocation (backport [#30940](#30940)) ([#30944](#30944)) ([64440fc](64440fc))
* **india:** cancel e-way bill is enabled with e-invoicing APIs. ([#30924](#30924)) ([4ef2ffd](4ef2ffd))
* **india:** generate qrcode button for e-invoice ([#30946](#30946)) ([7bd5b2b](7bd5b2b))
* **india:** store e-way bill auto calculated distance in sales invoice ([#30923](#30923)) ([b96f156](b96f156))
deepeshgarg007 pushed a commit to deepeshgarg007/erpnext that referenced this pull request May 13, 2022
# [13.29.0](frappe/erpnext@v13.28.0...v13.29.0) (2022-05-10)

### Bug Fixes

* Consider paryt and party type as well in group by consolidated view ([189fc89](frappe@189fc89))
* disable form save on naming series tool ([frappe#30909](frappe#30909)) ([frappe#30910](frappe#30910)) ([d60a6cb](frappe@d60a6cb))
* double future qty updates ([0db3013](frappe@0db3013))
* HSN-wise-summary of outward supplies Updated Report ([3637525](frappe@3637525))
* Ignore loan repayments made from salary slip ([b7e1d40](frappe@b7e1d40))
* **india:** invoice type for a debit note e-invoice ([frappe#30948](frappe#30948)) ([c46add3](frappe@c46add3))
* **india:** keyerror while generating e-way bill from an e-invoice ([frappe#30879](frappe#30879)) ([98d799e](frappe@98d799e))
* **india:** re-arrange e-way bill dialog fields ([frappe#30941](frappe#30941)) ([7ce5c93](frappe@7ce5c93))
* Item Alternative Test ([964de1f](frappe@964de1f))
* patch for renaming membership settings ([frappe#30929](frappe#30929)) ([9189653](frappe@9189653))
* **pos:** creating pos returns resets pricing rules & discounts ([frappe#30936](frappe#30936)) ([a0e39db](frappe@a0e39db))
* remove check for already allocated earned leaves ([frappe#30931](frappe#30931)) ([frappe#30932](frappe#30932)) ([80f7d66](frappe@80f7d66))
* Remove commit from stock entry test. The assertion is not important ([c449b35](frappe@c449b35))
* Set available-for-use date if missing ([frappe#30838](frappe#30838)) ([bf2eaec](frappe@bf2eaec))
* show group warehouse in Sales Order ([frappe#30891](frappe#30891)) ([frappe#30893](frappe#30893)) ([c458e14](frappe@c458e14))
* Show linked time sheets in sales invoice dashboard ([4f4af52](frappe@4f4af52))
* sort before picking next stock reco ([e27fb58](frappe@e27fb58))
* subtract change_amount from paid_amount field on POS Register ([frappe#30937](frappe#30937)) ([b7e873b](frappe@b7e873b))
* Unlink and delete batch created from stock reco on cancel ([fc35323](frappe@fc35323))
* Wrap SLE actual_qty in `flt` to avoid NoneType operation ([d53228b](frappe@d53228b))

### Features

* **HR:** Leave Type configuration to allow over allocation (backport [frappe#30940](frappe#30940)) ([frappe#30944](frappe#30944)) ([64440fc](frappe@64440fc))
* **india:** cancel e-way bill is enabled with e-invoicing APIs. ([frappe#30924](frappe#30924)) ([4ef2ffd](frappe@4ef2ffd))
* **india:** generate qrcode button for e-invoice ([frappe#30946](frappe#30946)) ([7bd5b2b](frappe@7bd5b2b))
* **india:** store e-way bill auto calculated distance in sales invoice ([frappe#30923](frappe#30923)) ([b96f156](frappe@b96f156))
mergify bot pushed a commit that referenced this pull request May 15, 2022
# [13.29.0](v13.28.0...v13.29.0) (2022-05-10)

### Bug Fixes

* Consider paryt and party type as well in group by consolidated view ([189fc89](189fc89))
* disable form save on naming series tool ([#30909](#30909)) ([#30910](#30910)) ([d60a6cb](d60a6cb))
* double future qty updates ([0db3013](0db3013))
* HSN-wise-summary of outward supplies Updated Report ([3637525](3637525))
* Ignore loan repayments made from salary slip ([b7e1d40](b7e1d40))
* **india:** invoice type for a debit note e-invoice ([#30948](#30948)) ([c46add3](c46add3))
* **india:** keyerror while generating e-way bill from an e-invoice ([#30879](#30879)) ([98d799e](98d799e))
* **india:** re-arrange e-way bill dialog fields ([#30941](#30941)) ([7ce5c93](7ce5c93))
* Item Alternative Test ([964de1f](964de1f))
* patch for renaming membership settings ([#30929](#30929)) ([9189653](9189653))
* **pos:** creating pos returns resets pricing rules & discounts ([#30936](#30936)) ([a0e39db](a0e39db))
* remove check for already allocated earned leaves ([#30931](#30931)) ([#30932](#30932)) ([80f7d66](80f7d66))
* Remove commit from stock entry test. The assertion is not important ([c449b35](c449b35))
* Set available-for-use date if missing ([#30838](#30838)) ([bf2eaec](bf2eaec))
* show group warehouse in Sales Order ([#30891](#30891)) ([#30893](#30893)) ([c458e14](c458e14))
* Show linked time sheets in sales invoice dashboard ([4f4af52](4f4af52))
* sort before picking next stock reco ([e27fb58](e27fb58))
* subtract change_amount from paid_amount field on POS Register ([#30937](#30937)) ([b7e873b](b7e873b))
* Unlink and delete batch created from stock reco on cancel ([fc35323](fc35323))
* Wrap SLE actual_qty in `flt` to avoid NoneType operation ([d53228b](d53228b))

### Features

* **HR:** Leave Type configuration to allow over allocation (backport [#30940](#30940)) ([#30944](#30944)) ([64440fc](64440fc))
* **india:** cancel e-way bill is enabled with e-invoicing APIs. ([#30924](#30924)) ([4ef2ffd](4ef2ffd))
* **india:** generate qrcode button for e-invoice ([#30946](#30946)) ([7bd5b2b](7bd5b2b))
* **india:** store e-way bill auto calculated distance in sales invoice ([#30923](#30923)) ([b96f156](b96f156))

(cherry picked from commit 7369db5)

# Conflicts:
#	erpnext/__init__.py
hrwX pushed a commit to hrwX/erpnext that referenced this pull request May 20, 2022
# [13.29.0](frappe/erpnext@v13.28.0...v13.29.0) (2022-05-10)

### Bug Fixes

* Consider paryt and party type as well in group by consolidated view ([189fc89](frappe@189fc89))
* disable form save on naming series tool ([frappe#30909](frappe#30909)) ([frappe#30910](frappe#30910)) ([d60a6cb](frappe@d60a6cb))
* double future qty updates ([0db3013](frappe@0db3013))
* HSN-wise-summary of outward supplies Updated Report ([3637525](frappe@3637525))
* Ignore loan repayments made from salary slip ([b7e1d40](frappe@b7e1d40))
* **india:** invoice type for a debit note e-invoice ([frappe#30948](frappe#30948)) ([c46add3](frappe@c46add3))
* **india:** keyerror while generating e-way bill from an e-invoice ([frappe#30879](frappe#30879)) ([98d799e](frappe@98d799e))
* **india:** re-arrange e-way bill dialog fields ([frappe#30941](frappe#30941)) ([7ce5c93](frappe@7ce5c93))
* Item Alternative Test ([964de1f](frappe@964de1f))
* patch for renaming membership settings ([frappe#30929](frappe#30929)) ([9189653](frappe@9189653))
* **pos:** creating pos returns resets pricing rules & discounts ([frappe#30936](frappe#30936)) ([a0e39db](frappe@a0e39db))
* remove check for already allocated earned leaves ([frappe#30931](frappe#30931)) ([frappe#30932](frappe#30932)) ([80f7d66](frappe@80f7d66))
* Remove commit from stock entry test. The assertion is not important ([c449b35](frappe@c449b35))
* Set available-for-use date if missing ([frappe#30838](frappe#30838)) ([bf2eaec](frappe@bf2eaec))
* show group warehouse in Sales Order ([frappe#30891](frappe#30891)) ([frappe#30893](frappe#30893)) ([c458e14](frappe@c458e14))
* Show linked time sheets in sales invoice dashboard ([4f4af52](frappe@4f4af52))
* sort before picking next stock reco ([e27fb58](frappe@e27fb58))
* subtract change_amount from paid_amount field on POS Register ([frappe#30937](frappe#30937)) ([b7e873b](frappe@b7e873b))
* Unlink and delete batch created from stock reco on cancel ([fc35323](frappe@fc35323))
* Wrap SLE actual_qty in `flt` to avoid NoneType operation ([d53228b](frappe@d53228b))

### Features

* **HR:** Leave Type configuration to allow over allocation (backport [frappe#30940](frappe#30940)) ([frappe#30944](frappe#30944)) ([64440fc](frappe@64440fc))
* **india:** cancel e-way bill is enabled with e-invoicing APIs. ([frappe#30924](frappe#30924)) ([4ef2ffd](frappe@4ef2ffd))
* **india:** generate qrcode button for e-invoice ([frappe#30946](frappe#30946)) ([7bd5b2b](frappe@7bd5b2b))
* **india:** store e-way bill auto calculated distance in sales invoice ([frappe#30923](frappe#30923)) ([b96f156](frappe@b96f156))

(cherry picked from commit 7369db5)

# Conflicts:
#	erpnext/__init__.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport version-13-hotfix needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to Generate E-Way Bill ( Part A ) due to KeyError(None).
2 participants