mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
Merge pull request #52643 from aerele/quotation-lost-reason-detail
fix: consider table multiselect in delete transaction
This commit is contained in:
@@ -465,3 +465,4 @@ erpnext.patches.v16_0.set_ordered_qty_in_quotation_item
|
|||||||
erpnext.patches.v16_0.update_company_custom_field_in_bin
|
erpnext.patches.v16_0.update_company_custom_field_in_bin
|
||||||
erpnext.patches.v15_0.replace_http_with_https_in_sales_partner
|
erpnext.patches.v15_0.replace_http_with_https_in_sales_partner
|
||||||
erpnext.patches.v16_0.migrate_asset_type_checkboxes_to_select
|
erpnext.patches.v16_0.migrate_asset_type_checkboxes_to_select
|
||||||
|
erpnext.patches.v15_0.delete_quotation_lost_record_detail
|
||||||
11
erpnext/patches/v15_0/delete_quotation_lost_record_detail.py
Normal file
11
erpnext/patches/v15_0/delete_quotation_lost_record_detail.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import frappe
|
||||||
|
from frappe.query_builder import DocType
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
qlr = DocType("Quotation Lost Reason Detail")
|
||||||
|
quotation = DocType("Quotation")
|
||||||
|
|
||||||
|
sub_query = frappe.qb.from_(quotation).select(quotation.name)
|
||||||
|
query = frappe.qb.from_(qlr).delete().where(qlr.parent.notin(sub_query))
|
||||||
|
query.run()
|
||||||
@@ -317,7 +317,9 @@ class TransactionDeletionRecord(Document):
|
|||||||
list: List of child table DocType names (Table field options)
|
list: List of child table DocType names (Table field options)
|
||||||
"""
|
"""
|
||||||
return frappe.get_all(
|
return frappe.get_all(
|
||||||
"DocField", filters={"parent": doctype_name, "fieldtype": "Table"}, pluck="options"
|
"DocField",
|
||||||
|
filters={"parent": doctype_name, "fieldtype": ["in", ["Table", "Table MultiSelect"]]},
|
||||||
|
pluck="options",
|
||||||
)
|
)
|
||||||
|
|
||||||
def _get_to_delete_row_infos(self, doctype_name, company_field=None, company=None):
|
def _get_to_delete_row_infos(self, doctype_name, company_field=None, company=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user