frappe
frappe copied to clipboard
fix!: Skip virtual fields in meta.get_valid_columns
Problem
In [10]: set(frappe.get_meta("Submission Queue").get_valid_columns()) - set(frappe.db.get_table_columns("Submission Queue"))
Out[10]: {'created_at', 'enqueued_by'}
NOTE: Submission Queue doctype (in Frappe) has 2 virtual fields
Discovery
Meta.get_valid_columns used in Document.bulk_insert causes query generated to include virtual fields which error since the column does not exist in the Database.
This should've been a part of the original Virtual Docfields PR (#14593), ref: #17751
Re-starting previous attempt via https://github.com/frappe/frappe/pull/26877