mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
patch: trim sales invoice custom field lengths
This commit is contained in:
@@ -309,3 +309,4 @@ erpnext.patches.v13_0.update_dates_in_tax_withholding_category
|
|||||||
erpnext.patches.v14_0.update_opportunity_currency_fields
|
erpnext.patches.v14_0.update_opportunity_currency_fields
|
||||||
erpnext.patches.v13_0.gst_fields_for_pos_invoice
|
erpnext.patches.v13_0.gst_fields_for_pos_invoice
|
||||||
erpnext.patches.v13_0.create_accounting_dimensions_in_pos_doctypes
|
erpnext.patches.v13_0.create_accounting_dimensions_in_pos_doctypes
|
||||||
|
erpnext.patches.v13_0.trim_sales_invoice_custom_field_length
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Copyright (c) 2020, Frappe and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
from erpnext.regional.india.setup import create_custom_fields, get_custom_fields
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
company = frappe.get_all('Company', filters = {'country': 'India'})
|
||||||
|
if not company:
|
||||||
|
return
|
||||||
|
|
||||||
|
custom_fields = {
|
||||||
|
'Sales Invoice': get_custom_fields().get('Sales Invoice')
|
||||||
|
}
|
||||||
|
|
||||||
|
create_custom_fields(custom_fields, update=True)
|
||||||
@@ -132,6 +132,10 @@ def make_property_setters(patch=False):
|
|||||||
make_property_setter('Journal Entry', 'voucher_type', 'options', '\n'.join(journal_entry_types), '')
|
make_property_setter('Journal Entry', 'voucher_type', 'options', '\n'.join(journal_entry_types), '')
|
||||||
|
|
||||||
def make_custom_fields(update=True):
|
def make_custom_fields(update=True):
|
||||||
|
custom_fields = get_custom_fields()
|
||||||
|
create_custom_fields(custom_fields, update=update)
|
||||||
|
|
||||||
|
def get_custom_fields():
|
||||||
hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC',
|
hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC',
|
||||||
fieldtype='Data', fetch_from='item_code.gst_hsn_code', insert_after='description',
|
fieldtype='Data', fetch_from='item_code.gst_hsn_code', insert_after='description',
|
||||||
allow_on_submit=1, print_hide=1, fetch_if_empty=1)
|
allow_on_submit=1, print_hide=1, fetch_if_empty=1)
|
||||||
@@ -672,7 +676,8 @@ def make_custom_fields(update=True):
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
create_custom_fields(custom_fields, update=update)
|
|
||||||
|
return custom_fields
|
||||||
|
|
||||||
def make_fixtures(company=None):
|
def make_fixtures(company=None):
|
||||||
docs = []
|
docs = []
|
||||||
|
|||||||
Reference in New Issue
Block a user