fix: Patch
diff --git a/erpnext/patches/v12_0/update_ewaybill_field_position.py b/erpnext/patches/v12_0/update_ewaybill_field_position.py
index d0291d2..c0230c4 100644
--- a/erpnext/patches/v12_0/update_ewaybill_field_position.py
+++ b/erpnext/patches/v12_0/update_ewaybill_field_position.py
@@ -10,18 +10,19 @@
field = frappe.db.get_value("Custom Field", {"dt": "Sales Invoice", "fieldname": "ewaybill"})
- ewaybill_field = frappe.get_doc("Custom Field", field)
+ if field:
+ ewaybill_field = frappe.get_doc("Custom Field", field)
- ewaybill_field.flags.ignore_validate = True
+ ewaybill_field.flags.ignore_validate = True
- ewaybill_field.update({
- 'fieldname': 'ewaybill',
- 'label': 'e-Way Bill No.',
- 'fieldtype': 'Data',
- 'depends_on': 'eval:(doc.docstatus === 1)',
- 'allow_on_submit': 1,
- 'insert_after': 'tax_id',
- 'translatable': 0
- })
+ ewaybill_field.update({
+ 'fieldname': 'ewaybill',
+ 'label': 'e-Way Bill No.',
+ 'fieldtype': 'Data',
+ 'depends_on': 'eval:(doc.docstatus === 1)',
+ 'allow_on_submit': 1,
+ 'insert_after': 'tax_id',
+ 'translatable': 0
+ })
- ewaybill_field.save()
\ No newline at end of file
+ ewaybill_field.save()
\ No newline at end of file