2019-07-14 12:45:19 +00:00
|
|
|
import frappe
|
2021-09-02 11:14:59 +00:00
|
|
|
|
2019-07-14 12:45:19 +00:00
|
|
|
|
|
|
|
def execute():
|
|
|
|
company = frappe.get_all('Company', filters = {'country': 'India'})
|
|
|
|
|
|
|
|
if not company:
|
|
|
|
return
|
|
|
|
|
|
|
|
field = frappe.db.get_value("Custom Field", {"dt": "Sales Invoice", "fieldname": "ewaybill"})
|
|
|
|
|
2019-07-18 12:44:12 +00:00
|
|
|
if field:
|
|
|
|
ewaybill_field = frappe.get_doc("Custom Field", field)
|
2019-07-14 12:45:19 +00:00
|
|
|
|
2019-07-18 12:44:12 +00:00
|
|
|
ewaybill_field.flags.ignore_validate = True
|
2019-07-14 12:45:19 +00:00
|
|
|
|
2019-07-18 12:44:12 +00:00
|
|
|
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
|
|
|
|
})
|
2019-07-14 12:45:19 +00:00
|
|
|
|
2019-07-18 12:44:12 +00:00
|
|
|
ewaybill_field.save()
|