Set corrected states list in GST State field's options

This commit is contained in:
Nabin Hait 2017-07-12 16:01:24 +05:30
parent 0a32b7a6eb
commit 7312186c76
6 changed files with 13 additions and 7 deletions

View File

@ -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)

View File

@ -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
erpnext.patches.v8_1.allow_invoice_copy_to_edit_after_submit
erpnext.patches.v8_1.update_gst_state

View File

@ -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'")

View File

@ -26,6 +26,7 @@ states = [
'Mizoram',
'Nagaland',
'Odisha',
'Other Territory',
'Pondicherry',
'Punjab',
'Rajasthan',

View File

@ -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)

View File

@ -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)