Merge branch 'master' into staging

This commit is contained in:
Nabin Hait 2017-10-26 14:35:34 +05:30
commit c799a22d55
6 changed files with 26 additions and 18 deletions

View File

@ -4,7 +4,7 @@ import inspect
import frappe import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
__version__ = '9.2.1' __version__ = '9.2.2'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -473,6 +473,7 @@ class TestPurchaseInvoice(unittest.TestCase):
import test_records as jv_test_records import test_records as jv_test_records
jv = frappe.copy_doc(jv_test_records[1]) jv = frappe.copy_doc(jv_test_records[1])
jv.accounts[0].is_advance = 'Yes'
jv.insert() jv.insert()
jv.submit() jv.submit()

View File

@ -1133,6 +1133,7 @@ class TestSalesInvoice(unittest.TestCase):
import test_records as jv_test_records import test_records as jv_test_records
jv = frappe.copy_doc(jv_test_records[0]) jv = frappe.copy_doc(jv_test_records[0])
jv.accounts[0].is_advance = 'Yes'
jv.insert() jv.insert()
jv.submit() jv.submit()

View File

@ -15,7 +15,7 @@ class TestPhysician(unittest.TestCase):
def test_schedule_and_time(self): def test_schedule_and_time(self):
physician = frappe.new_doc('Physician') physician = frappe.new_doc('Physician')
physician.first_name = '_Testdoctor2' physician.first_name = '_Testdoctor2'
physician.physician_schedule = '_Test Testdoctor Schedule' physician.physician_schedule = '_Testdoctor2 Schedule'
self.assertRaises(frappe.ValidationError, physician.insert) self.assertRaises(frappe.ValidationError, physician.insert)
@ -24,7 +24,7 @@ class TestPhysician(unittest.TestCase):
self.assertRaises(frappe.ValidationError, physician.insert) self.assertRaises(frappe.ValidationError, physician.insert)
physician.physician_schedule = '_Test Testdoctor Schedule' physician.physician_schedule = '_Testdoctor2 Schedule'
physician.time_per_appointment = 15 physician.time_per_appointment = 15
physician.insert() physician.insert()

View File

@ -0,0 +1,8 @@
[
{
"schedule_name": "_Testdoctor1 Schedule"
},
{
"schedule_name": "_Testdoctor2 Schedule"
}
]

View File

@ -208,7 +208,9 @@ erpnext.pos.PointOfSale = class PointOfSale {
this.update_item_in_frm(item) this.update_item_in_frm(item)
.then(() => { .then(() => {
// update cart // update cart
this.remove_item_from_cart(item); if (item.qty === 0) {
frappe.model.clear_doc(item.doctype, item.name);
}
this.update_cart_data(item); this.update_cart_data(item);
}); });
}, true); }, true);
@ -227,22 +229,18 @@ erpnext.pos.PointOfSale = class PointOfSale {
} }
if (field) { if (field) {
frappe.model.set_value(item.doctype, item.name, field, value); return frappe.model.set_value(item.doctype, item.name, field, value)
.then(() => this.frm.script_manager.trigger('qty', item.doctype, item.name))
.then(() => {
console.log(item.qty, item.amount);
if (field === 'qty' && item.qty === 0) {
frappe.model.clear_doc(item.doctype, item.name);
}
})
} }
return this.frm.script_manager return Promise.resolve();
.trigger('qty', item.doctype, item.name)
.then(() => {
if (field === 'qty') {
this.remove_item_from_cart(item);
}
});
}
remove_item_from_cart(item) {
if (item.qty === 0) {
frappe.model.clear_doc(item.doctype, item.name);
}
} }
make_payment_modal() { make_payment_modal() {