From 7facc34851e1874cff436494b42645762b080f16 Mon Sep 17 00:00:00 2001 From: NahuelOperto Date: Fri, 11 Jan 2019 10:46:38 -0300 Subject: [PATCH 1/6] fix: removed filter from method validate --- erpnext/selling/doctype/sales_order/sales_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index b2c6ccc7f1..a30f2fac3d 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -141,7 +141,7 @@ class SalesOrder(SellingController): super(SalesOrder, self).validate_with_previous_doc({ "Quotation": { "ref_dn_field": "prevdoc_docname", - "compare_fields": [["company", "="], ["currency", "="]] + "compare_fields": [["company", "="]] } }) From 9080221d46b74e78238ec8a170a68949b0b81aef Mon Sep 17 00:00:00 2001 From: NahuelOperto Date: Mon, 14 Jan 2019 12:12:56 -0300 Subject: [PATCH 2/6] fix: added test cases --- .../doctype/quotation/test_quotation.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index e79d46ae3f..909442af2f 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -31,6 +31,26 @@ class TestQuotation(unittest.TestCase): self.assertFalse(sales_order.get('payment_schedule')) + def test_make_sales_order_with_different_currency(self): + from erpnext.selling.doctype.quotation.quotation import make_sales_order + + quotation = frappe.copy_doc(test_records[0]) + quotation.transaction_date = nowdate() + quotation.valid_till = add_months(quotation.transaction_date, 1) + quotation.insert() + quotation.submit() + + sales_order = make_sales_order(quotation.name) + sales_order.currency = "USD" + sales_order.conversion_rate = 20.0 + sales_order.delivery_date = "2019-01-01" + sales_order.naming_series = "_T-Quotation-" + sales_order.transaction_date = nowdate() + sales_order.insert() + + self.assertEquals(sales_order.currency, "USD") + self.assertNotEqual(sales_order.currency, quotation.currency) + def test_make_sales_order(self): from erpnext.selling.doctype.quotation.quotation import make_sales_order From 876d868fa13aa03ed1c3adf3b017264537165033 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Tue, 15 Jan 2019 15:45:33 +0530 Subject: [PATCH 3/6] fix(tests): change patch order, optimise travis --- .travis.yml | 11 +++++------ erpnext/patches.txt | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 448cd40a39..e21d59511a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,17 +30,16 @@ before_script: - cd ~/frappe-bench - bench get-app erpnext $TRAVIS_BUILD_DIR - bench use test_site - - bench reinstall --yes - - bench build - - bench scheduler disable - - sed -i 's/9000/9001/g' sites/common_site_config.json - - bench start & - - sleep 10 jobs: include: - stage: test script: + - bench reinstall --yes + - bench scheduler disable + - sed -i 's/9000/9001/g' sites/common_site_config.json + - bench start & + - sleep 10 - set -e - bench run-tests env: Server Side Test diff --git a/erpnext/patches.txt b/erpnext/patches.txt index bc6f99db84..9d5b331123 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -1,5 +1,6 @@ execute:import unidecode # new requirement erpnext.patches.v8_0.move_perpetual_inventory_setting +erpnext.patches.v8_9.set_print_zero_amount_taxes erpnext.patches.v10_0.rename_schools_to_education erpnext.patches.v4_0.validate_v3_patch erpnext.patches.v4_0.fix_employee_user_id @@ -442,7 +443,6 @@ erpnext.patches.v8_9.add_setup_progress_actions #08-09-2017 #26-09-2017 #22-11-2 erpnext.patches.v8_9.rename_company_sales_target_field erpnext.patches.v8_8.set_bom_rate_as_per_uom erpnext.patches.v8_8.add_new_fields_in_accounts_settings -erpnext.patches.v8_9.set_print_zero_amount_taxes erpnext.patches.v8_9.set_default_customer_group erpnext.patches.v8_9.remove_employee_from_salary_structure_parent erpnext.patches.v8_9.delete_gst_doctypes_for_outside_india_accounts From 1ed819bb10be3bf89c3e2b6bc8126991937fde3e Mon Sep 17 00:00:00 2001 From: ks093 Date: Thu, 17 Jan 2019 12:09:04 +0530 Subject: [PATCH 4/6] Refresh quotation_series field to show series --- .../doctype/shopping_cart_settings/shopping_cart_settings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js index 3219d7a5cd..e1510f5335 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js @@ -5,6 +5,7 @@ $.extend(cur_frm.cscript, { onload: function() { if(cur_frm.doc.__onload && cur_frm.doc.__onload.quotation_series) { cur_frm.fields_dict.quotation_series.df.options = cur_frm.doc.__onload.quotation_series; + cur_frm.refresh_field("quotation_series"); } }, refresh: function(){ From 61c781325d1ffcb14e23f93374d0880baec7fe4d Mon Sep 17 00:00:00 2001 From: ks093 Date: Thu, 17 Jan 2019 12:16:43 +0530 Subject: [PATCH 5/6] Fix to show low stock message. In case of order being placed with stock quantity more than available, message showing stock available wasn't showing due to tuple unpacking not happening correctly. --- erpnext/shopping_cart/cart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index 254d7b74af..cc3205c7d7 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -66,7 +66,7 @@ def place_order(): sales_order = frappe.get_doc(_make_sales_order(quotation.name, ignore_permissions=True)) for item in sales_order.get("items"): item.reserved_warehouse, is_stock_item = frappe.db.get_value("Item", - item.item_code, ["website_warehouse", "is_stock_item"]) or None, None + item.item_code, ["website_warehouse", "is_stock_item"]) if is_stock_item: item_stock = get_qty_in_stock(item.item_code, "website_warehouse") From 1e61dd024b13bf809d4cf5cb3ee878df8878c51c Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Tue, 22 Jan 2019 15:53:48 +0550 Subject: [PATCH 6/6] bumped to version 10.1.78 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 26755dde61..db9ca3309e 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.77' +__version__ = '10.1.78' def get_default_company(user=None): '''Get default company for user'''