mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-13 23:38:01 +00:00
Merge branch 'version-14-hotfix' into handle_post_depr_entries_fail
This commit is contained in:
@@ -533,12 +533,13 @@ def get_accounts(root_type, companies):
|
||||
],
|
||||
filters={"company": company, "root_type": root_type},
|
||||
):
|
||||
if account.account_name not in added_accounts:
|
||||
if account.account_number:
|
||||
account_key = account.account_number + "-" + account.account_name
|
||||
else:
|
||||
account_key = account.account_name
|
||||
|
||||
if account_key not in added_accounts:
|
||||
accounts.append(account)
|
||||
if account.account_number:
|
||||
account_key = account.account_number + "-" + account.account_name
|
||||
else:
|
||||
account_key = account.account_name
|
||||
added_accounts.append(account_key)
|
||||
|
||||
return accounts
|
||||
|
||||
@@ -30,6 +30,24 @@ class TestQuotation(FrappeTestCase):
|
||||
|
||||
self.assertTrue(sales_order.get("payment_schedule"))
|
||||
|
||||
def test_maintain_rate_in_sales_cycle_is_enforced(self):
|
||||
from erpnext.selling.doctype.quotation.quotation import make_sales_order
|
||||
|
||||
maintain_rate = frappe.db.get_single_value("Selling Settings", "maintain_same_sales_rate")
|
||||
frappe.db.set_single_value("Selling Settings", "maintain_same_sales_rate", 1)
|
||||
|
||||
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.items[0].rate = 1
|
||||
self.assertRaises(frappe.ValidationError, sales_order.save)
|
||||
|
||||
frappe.db.set_single_value("Selling Settings", "maintain_same_sales_rate", maintain_rate)
|
||||
|
||||
def test_make_sales_order_with_different_currency(self):
|
||||
from erpnext.selling.doctype.quotation.quotation import make_sales_order
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ class SalesOrder(SellingController):
|
||||
)
|
||||
|
||||
if cint(frappe.db.get_single_value("Selling Settings", "maintain_same_sales_rate")):
|
||||
self.validate_rate_with_reference_doc([["Quotation", "prev_docname", "quotation_item"]])
|
||||
self.validate_rate_with_reference_doc([["Quotation", "prevdoc_docname", "quotation_item"]])
|
||||
|
||||
def update_enquiry_status(self, prevdoc, flag):
|
||||
enq = frappe.db.sql(
|
||||
|
||||
@@ -12,7 +12,10 @@ def get_data():
|
||||
"Auto Repeat": "reference_document",
|
||||
"Maintenance Visit": "prevdoc_docname",
|
||||
},
|
||||
"internal_links": {"Quotation": ["items", "prevdoc_docname"]},
|
||||
"internal_links": {
|
||||
"Quotation": ["items", "prevdoc_docname"],
|
||||
"Material Request": ["items", "material_request"],
|
||||
},
|
||||
"transactions": [
|
||||
{
|
||||
"label": _("Fulfillment"),
|
||||
|
||||
Reference in New Issue
Block a user