fix: transaction date not found in sales invoice
diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py
index cb05481..53115f9 100644
--- a/erpnext/accounts/doctype/pricing_rule/utils.py
+++ b/erpnext/accounts/doctype/pricing_rule/utils.py
@@ -366,8 +366,7 @@
sum_qty, sum_amt = [0, 0]
doctype = doc.get('parenttype') or doc.doctype
- date_field = ('transaction_date'
- if doc.get('transaction_date') else 'posting_date')
+ date_field = 'transaction_date' if frappe.get_meta(doctype).has_field('transaction_date') else 'posting_date'
child_doctype = '{0} Item'.format(doctype)
apply_on = frappe.scrub(pr_doc.get('apply_on'))