From 52909b73bbcc807a8d0fe5064a55075674bcfd13 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 26 Oct 2017 11:06:07 +0530 Subject: [PATCH 1/4] [test] Fixed advance jv cancellation (#11333) --- .../accounts/doctype/purchase_invoice/test_purchase_invoice.py | 1 + erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py | 1 + 2 files changed, 2 insertions(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 639620f910..474329fc9a 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -473,6 +473,7 @@ class TestPurchaseInvoice(unittest.TestCase): import test_records as jv_test_records jv = frappe.copy_doc(jv_test_records[1]) + jv.accounts[0].is_advance = 'Yes' jv.insert() jv.submit() diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 264f027486..50d2ce810b 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -1133,6 +1133,7 @@ class TestSalesInvoice(unittest.TestCase): import test_records as jv_test_records jv = frappe.copy_doc(jv_test_records[0]) + jv.accounts[0].is_advance = 'Yes' jv.insert() jv.submit() From aa7896f1e11cc57329f9afb0ca5dc39761ca4eb4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 26 Oct 2017 14:33:28 +0530 Subject: [PATCH 2/4] [test] Fixed physician test cases (#11347) --- erpnext/healthcare/doctype/physician/test_physician.py | 4 ++-- .../doctype/physician_schedule/test_records.json | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 erpnext/healthcare/doctype/physician_schedule/test_records.json diff --git a/erpnext/healthcare/doctype/physician/test_physician.py b/erpnext/healthcare/doctype/physician/test_physician.py index e57bdae46e..4bd497a4e9 100644 --- a/erpnext/healthcare/doctype/physician/test_physician.py +++ b/erpnext/healthcare/doctype/physician/test_physician.py @@ -15,7 +15,7 @@ class TestPhysician(unittest.TestCase): def test_schedule_and_time(self): physician = frappe.new_doc('Physician') physician.first_name = '_Testdoctor2' - physician.physician_schedule = '_Test Testdoctor Schedule' + physician.physician_schedule = '_Testdoctor2 Schedule' self.assertRaises(frappe.ValidationError, physician.insert) @@ -24,7 +24,7 @@ class TestPhysician(unittest.TestCase): self.assertRaises(frappe.ValidationError, physician.insert) - physician.physician_schedule = '_Test Testdoctor Schedule' + physician.physician_schedule = '_Testdoctor2 Schedule' physician.time_per_appointment = 15 physician.insert() diff --git a/erpnext/healthcare/doctype/physician_schedule/test_records.json b/erpnext/healthcare/doctype/physician_schedule/test_records.json new file mode 100644 index 0000000000..1e6230dd98 --- /dev/null +++ b/erpnext/healthcare/doctype/physician_schedule/test_records.json @@ -0,0 +1,8 @@ +[ + { + "schedule_name": "_Testdoctor1 Schedule" + }, + { + "schedule_name": "_Testdoctor2 Schedule" + } +] \ No newline at end of file From 6887cedaeaeea8998bc968d4eef467202fd36463 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 26 Oct 2017 14:34:15 +0530 Subject: [PATCH 3/4] [fix] item qty trigger (#11349) --- .../page/point_of_sale/point_of_sale.js | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) 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 e23dcdbc95..196bb960df 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -208,7 +208,9 @@ erpnext.pos.PointOfSale = class PointOfSale { this.update_item_in_frm(item) .then(() => { // 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); }); }, true); @@ -227,22 +229,18 @@ erpnext.pos.PointOfSale = class PointOfSale { } 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 - .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); - } + return Promise.resolve(); } make_payment_modal() { From 819c50c042698e03e2118aea2704f63add334ebd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 26 Oct 2017 15:05:33 +0600 Subject: [PATCH 4/4] bumped to version 9.2.2 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 84b2b0388a..b245f56172 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from erpnext.hooks import regional_overrides -__version__ = '9.2.1' +__version__ = '9.2.2' def get_default_company(user=None): '''Get default company for user'''