Merge pull request #16393 from diamorafaela/quotation-currency
fix: Quotation to Sales Order with different currency
This commit is contained in:
commit
f0571ddf4b
@ -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
|
||||
|
||||
|
@ -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", "="]]
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user