diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index ba0f0d3c4a..bf509de84f 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -81,7 +81,6 @@ def set_address_details(out, party, party_type, doctype=None, company=None): out.update(get_company_address(company)) if out.company_address: out.update(get_fetch_values(doctype, 'company_address', out.company_address)) - def set_contact_details(out, party, party_type): out.contact_person = get_default_contact(party_type, party.name) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index d83363852c..3d4d24e473 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -415,4 +415,5 @@ erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account erpnext.patches.v8_1.gst_fixes #2017-07-06 erpnext.patches.v8_0.update_production_orders erpnext.patches.v8_1.remove_sales_invoice_from_returned_serial_no -erpnext.patches.v8_1.allow_invoice_copy_to_edit_after_submit \ No newline at end of file +erpnext.patches.v8_1.allow_invoice_copy_to_edit_after_submit +erpnext.patches.v8_1.update_gst_state \ No newline at end of file diff --git a/erpnext/patches/v8_1/update_gst_state.py b/erpnext/patches/v8_1/update_gst_state.py new file mode 100644 index 0000000000..2bbb6b8a8e --- /dev/null +++ b/erpnext/patches/v8_1/update_gst_state.py @@ -0,0 +1,6 @@ +import frappe +from erpnext.regional.india import states + +def execute(): + frappe.db.sql("update `tabCustom Field` set options=%s where fieldname='gst_state'", '\n'.join(states)) + frappe.db.sql("update `tabAddress` set gst_state='Chhattisgarh' where gst_state='Chattisgarh'") diff --git a/erpnext/regional/india/__init__.py b/erpnext/regional/india/__init__.py index de5f1ab7ab..4a9a211b41 100644 --- a/erpnext/regional/india/__init__.py +++ b/erpnext/regional/india/__init__.py @@ -26,6 +26,7 @@ states = [ 'Mizoram', 'Nagaland', 'Odisha', + 'Other Territory', 'Pondicherry', 'Punjab', 'Rajasthan', diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 2df52ac649..4333fd846b 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -504,12 +504,12 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False): target.flags.ignore_permissions = True target.run_method("set_missing_values") target.run_method("calculate_taxes_and_totals") - + # set company address target.update(get_company_address(target.company)) if target.company_address: target.update(get_fetch_values("Sales Invoice", 'company_address', target.company_address)) - + def update_item(source, target, source_parent): target.amount = flt(source.amount) - flt(source.billed_amt) target.base_amount = target.amount * flt(source_parent.conversion_rate) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 3bf0384e7d..5c5f0f8b6a 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -382,12 +382,11 @@ def make_sales_invoice(source_name, target_doc=None): frappe.throw(_("All these items have already been invoiced")) target.run_method("calculate_taxes_and_totals") - + # set company address target.update(get_company_address(target.company)) if target.company_address: - target.update(get_fetch_values("Sales Invoice", 'company_address', target.company_address)) - + target.update(get_fetch_values("Sales Invoice", 'company_address', target.company_address)) def update_item(source_doc, target_doc, source_parent): target_doc.qty = source_doc.qty - invoiced_qty_map.get(source_doc.name, 0)