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(patch): delete hospitality custom fields #29382

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

ankush
Copy link
Member

@ankush ankush commented Jan 20, 2022

Missed out the deletion of custom fields as pointed out here: #29167 (comment)

to test:

  • just see if the sales invoice page opens or not.
  • check if restaurant custom field got deleted from custom fields list.

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Jan 20, 2022
@ankush ankush requested review from ruchamahabal and removed request for nextchamp-saqib, marination and deepeshgarg007 January 20, 2022 13:50
@ankush ankush removed the needs-tests This PR needs automated unit-tests. label Jan 20, 2022
@ankush
Copy link
Member Author

ankush commented Jan 20, 2022

IMO this should just be part of delete_doc(doctype) for a simple reason: not deleting linked custom fields makes the whole form unusable (it just logs you out totally without any hints! LMAO)

https://github.com/frappe/frappe/blob/1e70c02e43b3a7212e4c35598721dcf1d183c249/frappe/model/delete_doc.py#L68

There could be one more delete here

frappe.db.delete("Custom Field", {"options": name})

@gavindsouza

@codecov
Copy link

codecov bot commented Jan 20, 2022

Codecov Report

Merging #29382 (5d1286e) into develop (c8489d6) will decrease coverage by 0.08%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop   #29382      +/-   ##
===========================================
- Coverage    57.88%   57.80%   -0.09%     
===========================================
  Files         1091     1091              
  Lines        67850    67866      +16     
===========================================
- Hits         39278    39232      -46     
- Misses       28572    28634      +62     
Impacted Files Coverage Δ
...unts/report/purchase_register/purchase_register.py 32.19% <0.00%> (-45.90%) ⬇️
erpnext/utilities/product.py 14.70% <0.00%> (-35.30%) ⬇️
...ext/accounts/report/balance_sheet/balance_sheet.py 36.36% <0.00%> (-21.82%) ⬇️
erpnext/shopping_cart/product_info.py 30.30% <0.00%> (-21.22%) ⬇️
...e_purchase_register/item_wise_purchase_register.py 58.00% <0.00%> (-20.00%) ⬇️
.../report/bom_operations_time/bom_operations_time.py 89.13% <0.00%> (-7.54%) ⬇️
...it_and_loss_statement/profit_and_loss_statement.py 71.42% <0.00%> (-3.90%) ⬇️
erpnext/assets/doctype/asset/depreciation.py 85.23% <0.00%> (-2.69%) ⬇️
...e/shopping_cart_settings/shopping_cart_settings.py 66.03% <0.00%> (-1.89%) ⬇️
erpnext/shopping_cart/product_query.py 61.19% <0.00%> (-1.50%) ⬇️
... and 34 more

@ruchamahabal ruchamahabal merged commit cce35c1 into frappe:develop Jan 20, 2022
@ChillarAnand ChillarAnand added the Hospitality hotels label Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants