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

refactor: update_serial_no function for old Maintenance Visits #28843

Merged
merged 11 commits into from
Jan 19, 2022

Conversation

noahjacob
Copy link
Contributor

@noahjacob noahjacob commented Dec 13, 2021

Issue

  • Old documents which were saved before the refactor would not have the "Maintenance Schedule Detail" field set.

image

Fix

  • Using maintenance_schedule field in "Maintenance Visit" to fetch the serial nos instead of the Maintenance Schedule Detail row id, which isn't possible to identify on old docs.
  • Patch to update this field on old docs that have prevdoc_docname.

To Test:

  • Make an independent maintenance visit (not from maintenance schedule) and see if it works fine. Use serialised item in it and add serial nos > Add multiple serialised items and see if you can select appropriate serial nos (check the filters)
  • Make a maintenance schedule with multiple items, 1 non serialised, 2 serialised. Make visits, see if it works and updates the schedule correctly

@codecov
Copy link

codecov bot commented Dec 13, 2021

Codecov Report

Merging #28843 (dec7513) into develop (9088984) will increase coverage by 0.08%.
The diff coverage is 90.00%.

@@             Coverage Diff             @@
##           develop   #28843      +/-   ##
===========================================
+ Coverage    57.96%   58.05%   +0.08%     
===========================================
  Files         1110     1110              
  Lines        68080    68088       +8     
===========================================
+ Hits         39464    39528      +64     
+ Misses       28616    28560      -56     
Impacted Files Coverage Δ
...nce/doctype/maintenance_visit/maintenance_visit.py 51.25% <75.00%> (+1.25%) ⬆️
...ctype/maintenance_schedule/maintenance_schedule.py 85.83% <100.00%> (+9.24%) ⬆️
...t/accounts/report/sales_register/sales_register.py 73.33% <0.00%> (-5.46%) ⬇️
...em_wise_sales_register/item_wise_sales_register.py 61.36% <0.00%> (-1.82%) ⬇️
erpnext/hr/doctype/attendance/attendance.py 40.54% <0.00%> (-1.52%) ⬇️
erpnext/crm/doctype/prospect/prospect.py 55.22% <0.00%> (-1.50%) ⬇️
erpnext/stock/report/stock_ledger/stock_ledger.py 77.23% <0.00%> (-0.82%) ⬇️
erpnext/selling/doctype/quotation/quotation.py 49.18% <0.00%> (-0.55%) ⬇️
erpnext/selling/doctype/sales_order/sales_order.py 77.29% <0.00%> (-0.39%) ⬇️
...stock/doctype/purchase_receipt/purchase_receipt.py 90.42% <0.00%> (-0.27%) ⬇️
... and 21 more

@ankush ankush added the needs-tests This PR needs automated unit-tests. label Dec 14, 2021
@ankush ankush modified the milestones: v13.17, v13.18 Dec 15, 2021
@noahjacob noahjacob added backport version-13-hotfix and removed needs-tests This PR needs automated unit-tests. labels Dec 17, 2021
@marination marination assigned marination and unassigned ankush Jan 17, 2022
@marination marination merged commit b9f70ed into frappe:develop Jan 19, 2022
@marination
Copy link
Collaborator

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Jan 19, 2022

backport version-13-hotfix

✅ Backports have been created

marination added a commit that referenced this pull request Jan 19, 2022
…-28843

refactor: update_serial_no function for old Maintenance Visits (backport #28843)
marination added a commit that referenced this pull request Jan 19, 2022
…se/pr-29352

refactor: update_serial_no function for old Maintenance Visits (backport #28843) (backport #29352)
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

3 participants