From 703fc08467cdd205262d34ca75ac3319b9d00cb6 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 18 Jul 2019 18:14:12 +0530 Subject: [PATCH] fix: Patch --- .../v12_0/update_ewaybill_field_position.py | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/erpnext/patches/v12_0/update_ewaybill_field_position.py b/erpnext/patches/v12_0/update_ewaybill_field_position.py index d0291d2123..c0230c4395 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 @@ def execute(): 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