Merge branch 'master' into staging-fixes

This commit is contained in:
Sagar Vora 2019-01-22 15:37:05 +05:30
commit ceacacc320
7 changed files with 30 additions and 10 deletions

View File

@ -33,17 +33,16 @@ before_script:
- cd ~/frappe-bench - cd ~/frappe-bench
- bench get-app erpnext $TRAVIS_BUILD_DIR - bench get-app erpnext $TRAVIS_BUILD_DIR
- bench use test_site - bench use test_site
- bench reinstall --mariadb-root-username root --mariadb-root-password travis --yes
- bench build
- bench scheduler disable
- sed -i 's/9000/9001/g' sites/common_site_config.json
- bench start &
- sleep 10
jobs: jobs:
include: include:
- stage: test - stage: test
script: script:
- bench reinstall --mariadb-root-username root --mariadb-root-password travis --yes
- bench scheduler disable
- sed -i 's/9000/9001/g' sites/common_site_config.json
- bench start &
- sleep 10
- set -e - set -e
- bench run-tests --app erpnext --coverage - bench run-tests --app erpnext --coverage
after_script: after_script:

View File

@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
from frappe.utils import getdate from frappe.utils import getdate
__version__ = '10.1.77' __version__ = '10.1.78'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -1,5 +1,6 @@
execute:import unidecode # new requirement execute:import unidecode # new requirement
erpnext.patches.v8_0.move_perpetual_inventory_setting erpnext.patches.v8_0.move_perpetual_inventory_setting
erpnext.patches.v8_9.set_print_zero_amount_taxes
erpnext.patches.v11_0.rename_production_order_to_work_order erpnext.patches.v11_0.rename_production_order_to_work_order
erpnext.patches.v11_0.refactor_naming_series erpnext.patches.v11_0.refactor_naming_series
erpnext.patches.v11_0.refactor_autoname_naming erpnext.patches.v11_0.refactor_autoname_naming
@ -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_9.rename_company_sales_target_field
erpnext.patches.v8_8.set_bom_rate_as_per_uom erpnext.patches.v8_8.set_bom_rate_as_per_uom
erpnext.patches.v8_8.add_new_fields_in_accounts_settings 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.set_default_customer_group
erpnext.patches.v8_9.delete_gst_doctypes_for_outside_india_accounts erpnext.patches.v8_9.delete_gst_doctypes_for_outside_india_accounts
erpnext.patches.v8_9.set_default_fields_in_variant_settings erpnext.patches.v8_9.set_default_fields_in_variant_settings

View File

@ -31,6 +31,26 @@ class TestQuotation(unittest.TestCase):
self.assertFalse(sales_order.get('payment_schedule')) 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): def test_make_sales_order(self):
from erpnext.selling.doctype.quotation.quotation import make_sales_order from erpnext.selling.doctype.quotation.quotation import make_sales_order

View File

@ -147,7 +147,7 @@ class SalesOrder(SellingController):
super(SalesOrder, self).validate_with_previous_doc({ super(SalesOrder, self).validate_with_previous_doc({
"Quotation": { "Quotation": {
"ref_dn_field": "prevdoc_docname", "ref_dn_field": "prevdoc_docname",
"compare_fields": [["company", "="], ["currency", "="]] "compare_fields": [["company", "="]]
} }
}) })

View File

@ -66,7 +66,7 @@ def place_order():
sales_order = frappe.get_doc(_make_sales_order(quotation.name, ignore_permissions=True)) sales_order = frappe.get_doc(_make_sales_order(quotation.name, ignore_permissions=True))
for item in sales_order.get("items"): for item in sales_order.get("items"):
item.reserved_warehouse, is_stock_item = frappe.db.get_value("Item", 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: if is_stock_item:
item_stock = get_qty_in_stock(item.item_code, "website_warehouse") item_stock = get_qty_in_stock(item.item_code, "website_warehouse")

View File

@ -5,6 +5,7 @@ $.extend(cur_frm.cscript, {
onload: function() { onload: function() {
if(cur_frm.doc.__onload && cur_frm.doc.__onload.quotation_series) { 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.fields_dict.quotation_series.df.options = cur_frm.doc.__onload.quotation_series;
cur_frm.refresh_field("quotation_series");
} }
}, },
refresh: function(){ refresh: function(){