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: validate if asset account is set against company #28797

Merged

Conversation

nextchamp-saqib
Copy link
Member

Problem:

  • Asset Category "Office Equipments" has a Fixed Asset Account set for Company 1
  • Printer belongs to Asset Category Office Equipments
  • Creating Purchase Invoice for Company 2 with Printer as item throws an error "Account is Required", if expense account is not explicitly set

Fix:

  • Throw a proper error message if expense account is not found for the asset item

    CleanShot 2021-12-08 at 17 35 09

@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #28797 (c3b6fdb) into develop (ef53eb7) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

@@             Coverage Diff             @@
##           develop   #28797      +/-   ##
===========================================
- Coverage    55.27%   55.25%   -0.02%     
===========================================
  Files         1122     1122              
  Lines        66772    66786      +14     
===========================================
- Hits         36906    36905       -1     
- Misses       29866    29881      +15     
Impacted Files Coverage Δ
...ounts/doctype/purchase_invoice/purchase_invoice.py 81.20% <60.00%> (-0.20%) ⬇️
...ctype/woocommerce_settings/woocommerce_settings.py 80.00% <0.00%> (-4.00%) ⬇️
...eorder_level/itemwise_recommended_reorder_level.py 90.38% <0.00%> (-3.85%) ⬇️
...eport/item_variant_details/item_variant_details.py 84.33% <0.00%> (-3.62%) ⬇️
erpnext/stock/report/stock_ledger/stock_ledger.py 74.79% <0.00%> (-3.26%) ⬇️
erpnext/education/doctype/student/student.py 73.68% <0.00%> (-3.16%) ⬇️
...value/warehouse_wise_item_balance_age_and_value.py 92.40% <0.00%> (-2.54%) ⬇️
erpnext/stock/report/stock_ageing/stock_ageing.py 89.05% <0.00%> (-2.19%) ⬇️
...ion/doctype/course_enrollment/course_enrollment.py 44.00% <0.00%> (-2.00%) ⬇️
...wise_balance_history/batch_wise_balance_history.py 91.37% <0.00%> (-1.73%) ⬇️
... and 12 more

@nextchamp-saqib nextchamp-saqib merged commit c3e0de2 into frappe:develop Dec 13, 2021
@nextchamp-saqib
Copy link
Member Author

@Mergifyio backport version-12-hotfix

@mergify
Copy link
Contributor

mergify bot commented Dec 13, 2021

backport version-12-hotfix

✅ Backports have been created

nextchamp-saqib added a commit that referenced this pull request Dec 13, 2021
…-28797

fix: validate if asset account is set against company (backport #28797)
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.

None yet

1 participant