[minor] fixes + patch (#14937)

This commit is contained in:
Rushabh Mehta 2018-07-17 18:22:51 +05:30 committed by Nabin Hait
parent 3c9839f832
commit 69fa808def
6 changed files with 13 additions and 7 deletions

View File

@ -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();
}

View File

@ -6,4 +6,4 @@ def execute():
if not company:
return
make_custom_fields()
make_custom_fields(update=False)

View File

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

View File

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

View File

@ -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 = []

View File

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