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: typeerror on invoice creation from SO/PO #29560

Conversation

ruthra-kumar
Copy link
Member

Issue

"TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'" occurs when an invoice is created from SO/PO.

Replication Steps

'Automatically Fetch Payment Terms from Order' is enabled.
account settings

SO/PO should have payment term with '0%' invoice portion.
0 invoice portion

Create-> Sales/Purchase Invoice should throw error
typerror

Fix

The payment_schedule object created by auto fetch feature has uninitialised attribute 'payment_amount' which causes this error. It has been fixed in this change.

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Feb 1, 2022
@ruthra-kumar ruthra-kumar marked this pull request as ready for review February 1, 2022 10:47
@deepeshgarg007 deepeshgarg007 self-assigned this Feb 1, 2022
@nextchamp-saqib nextchamp-saqib added this to the v13.21 milestone Feb 4, 2022
@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #29560 (0f913e0) into develop (8eff296) will increase coverage by 5.41%.
The diff coverage is 50.00%.

@@             Coverage Diff             @@
##           develop   #29560      +/-   ##
===========================================
+ Coverage    53.59%   59.00%   +5.41%     
===========================================
  Files         1111     1112       +1     
  Lines        69328    69469     +141     
===========================================
+ Hits         37153    40989    +3836     
+ Misses       32175    28480    -3695     
Impacted Files Coverage Δ
erpnext/controllers/accounts_controller.py 84.51% <50.00%> (+3.78%) ⬆️
...t/payroll/doctype/payroll_period/payroll_period.py 64.81% <0.00%> (-5.56%) ⬇️
.../report/bom_operations_time/bom_operations_time.py 89.13% <0.00%> (-2.18%) ⬇️
erpnext/stock/report/stock_ledger/stock_ledger.py 84.55% <0.00%> (-0.82%) ⬇️
...ype/account/chart_of_accounts/chart_of_accounts.py 77.39% <0.00%> (-0.69%) ⬇️
erpnext/accounts/report/financial_statements.py 35.24% <0.00%> (-0.39%) ⬇️
erpnext/projects/doctype/project/project.py 54.54% <0.00%> (ø)
erpnext/payroll/doctype/salary_slip/salary_slip.py 83.89% <0.00%> (ø)
.../report/stock_projected_qty/stock_projected_qty.py 88.15% <0.00%> (ø)
erpnext/e_commerce/product_data_engine/query.py 75.53% <0.00%> (ø)
... and 165 more

@nextchamp-saqib nextchamp-saqib added backport version-13-hotfix and removed needs-tests This PR needs automated unit-tests. labels Feb 8, 2022
@nextchamp-saqib nextchamp-saqib merged commit 27ced4f into frappe:develop Feb 8, 2022
nextchamp-saqib added a commit that referenced this pull request Feb 8, 2022
…-29560

fix: typeerror on invoice creation from SO/PO (backport #29560)
@ruthra-kumar ruthra-kumar deleted the bug_invoice_creation_throws_typeerror branch April 19, 2022 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants