Merge pull request #32923 from deepeshgarg007/rate_quotation
fix: Maintain same rate between Quotation and Sales Order
This commit is contained in:
commit
06a42caa5b
@ -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,
|
||||
},
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user