From 69fa808defccf39c8afe86e980adb162347490f9 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 17 Jul 2018 18:22:51 +0530 Subject: [PATCH] [minor] fixes + patch (#14937) --- erpnext/accounts/page/pos/pos.js | 5 ++++- erpnext/patches/v10_0/added_extra_gst_custom_field.py | 2 +- .../patches/v10_0/added_extra_gst_custom_field_in_gstr2.py | 6 +++--- erpnext/patches/v8_7/add_more_gst_fields.py | 2 ++ erpnext/regional/india/setup.py | 4 ++-- erpnext/selling/page/point_of_sale/point_of_sale.js | 1 + 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 164bbd5d62..ce1f34bb27 100755 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -288,6 +288,9 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ if (callback) { callback(); } + }, + error: () => { + setTimeout(() => frappe.set_route('List', 'POS Profile'), 2000); } }) }, @@ -1187,7 +1190,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ message: __('Discount amount cannot be greater than 100%') }); me.update_discount(item_code, discount); - }else{ + }else{ me.update_discount(item_code, discount); me.update_value(); } diff --git a/erpnext/patches/v10_0/added_extra_gst_custom_field.py b/erpnext/patches/v10_0/added_extra_gst_custom_field.py index a1512ed9b7..98b18202fe 100644 --- a/erpnext/patches/v10_0/added_extra_gst_custom_field.py +++ b/erpnext/patches/v10_0/added_extra_gst_custom_field.py @@ -6,4 +6,4 @@ def execute(): if not company: return - make_custom_fields() \ No newline at end of file + make_custom_fields(update=False) \ No newline at end of file diff --git a/erpnext/patches/v10_0/added_extra_gst_custom_field_in_gstr2.py b/erpnext/patches/v10_0/added_extra_gst_custom_field_in_gstr2.py index 7b65a6510c..12aa5fd5d2 100644 --- a/erpnext/patches/v10_0/added_extra_gst_custom_field_in_gstr2.py +++ b/erpnext/patches/v10_0/added_extra_gst_custom_field_in_gstr2.py @@ -10,12 +10,12 @@ def execute(): frappe.db.sql("""delete from `tabCustom Field` where dt = %s and fieldname in ('port_code', 'shipping_bill_number', 'shipping_bill_date')""", doctype) - make_custom_fields() + make_custom_fields(update=False) frappe.db.sql(""" update `tabCustom Field` set reqd = 0, `default` = '' where fieldname = 'reason_for_issuing_document' """) - - + + diff --git a/erpnext/patches/v8_7/add_more_gst_fields.py b/erpnext/patches/v8_7/add_more_gst_fields.py index a1512ed9b7..fc76a0652f 100644 --- a/erpnext/patches/v8_7/add_more_gst_fields.py +++ b/erpnext/patches/v8_7/add_more_gst_fields.py @@ -6,4 +6,6 @@ def execute(): if not company: return + frappe.reload_doc('hr', 'doctype', 'Employee Tax Exemption Declaration') + frappe.reload_doc('hr', 'doctype', 'Employee Tax Exemption Proof Submission') make_custom_fields() \ No newline at end of file diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index 630e029577..cd0bc9a01c 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -81,7 +81,7 @@ def add_print_formats(): frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where name in('GST POS Invoice', 'GST Tax Invoice') """) -def make_custom_fields(): +def make_custom_fields(update=True): hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC', fieldtype='Data', options='item_code.gst_hsn_code', insert_after='description', allow_on_submit=1, print_hide=1) @@ -241,7 +241,7 @@ def make_custom_fields(): ] } - create_custom_fields(custom_fields, ignore_validate = frappe.flags.in_patch) + create_custom_fields(custom_fields, ignore_validate = frappe.flags.in_patch, update=update) def make_fixtures(company=None): docs = [] diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index d75bf619c7..da72dc570f 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -511,6 +511,7 @@ erpnext.pos.PointOfSale = class PointOfSale { if(!r.exc) { if (!this.frm.doc.pos_profile) { frappe.dom.unfreeze(); + setTimeout(() => frappe.set_route('List', 'POS Profile'), 2000); frappe.throw(__("POS Profile is required to use Point-of-Sale")); } this.frm.script_manager.trigger("update_stock");