diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 96092b15238..d7d39636935 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -247,7 +247,7 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): "Quotation": {"doctype": "Sales Order", "validation": {"docstatus": ["=", 1]}}, "Quotation Item": { "doctype": "Sales Order Item", - "field_map": {"parent": "prevdoc_docname"}, + "field_map": {"parent": "prevdoc_docname", "name": "quotation_item"}, "postprocess": update_item, "condition": lambda doc: doc.qty > 0, }, diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 1f3419fd5dd..9d6b161490f 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -193,6 +193,9 @@ class SalesOrder(SellingController): {"Quotation": {"ref_dn_field": "prevdoc_docname", "compare_fields": [["company", "="]]}} ) + if cint(frappe.db.get_single_value("Selling Settings", "maintain_same_sales_rate")): + self.validate_rate_with_reference_doc([["Quotation", "prev_docname", "quotation_item"]]) + def update_enquiry_status(self, prevdoc, flag): enq = frappe.db.sql( "select t2.prevdoc_docname from `tabQuotation` t1, `tabQuotation Item` t2 where t2.parent = t1.name and t1.name=%s", diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json index ea0b25f41cc..8c7c5520a40 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json @@ -70,6 +70,7 @@ "warehouse", "target_warehouse", "prevdoc_docname", + "quotation_item", "col_break4", "against_blanket_order", "blanket_order", @@ -838,12 +839,20 @@ "label": "Purchase Order Item", "print_hide": 1, "read_only": 1 + }, + { + "fieldname": "quotation_item", + "fieldtype": "Data", + "hidden": 1, + "label": "quotation_item", + "no_copy": 1, + "read_only": 1 } ], "idx": 1, "istable": 1, "links": [], - "modified": "2022-10-26 16:05:02.712705", + "modified": "2022-11-10 18:20:30.137455", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Item",