Merge branch 'develop' into payment-terms
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
index f6d9ca9..3801141 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -254,6 +254,21 @@
}
})
}, __("Get items from"));
+ // Get items from Opportunity
+ this.frm.add_custom_button(__('Opportunity'),
+ function() {
+ erpnext.utils.map_current_doc({
+ method: "erpnext.crm.doctype.opportunity.opportunity.make_request_for_quotation",
+ source_doctype: "Opportunity",
+ target: me.frm,
+ setters: {
+ company: me.frm.doc.company
+ },
+ get_query_filters: {
+ enquiry_type: "Sales"
+ }
+ })
+ }, __("Get items from"));
// Get items from open Material Requests based on supplier
this.frm.add_custom_button(__('Possible Supplier'), function() {
// Create a dialog window for the user to pick their supplier
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index 8bc7ad8..4251cae 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -246,6 +246,27 @@
return doclist
@frappe.whitelist()
+def make_request_for_quotation(source_name, target_doc=None):
+ doclist = get_mapped_doc("Opportunity", source_name, {
+ "Opportunity": {
+ "doctype": "Request for Quotation",
+ "validation": {
+ "enquiry_type": ["=", "Sales"]
+ }
+ },
+ "Opportunity Item": {
+ "doctype": "Request for Quotation Item",
+ "field_map": [
+ ["name", "opportunity_item"],
+ ["parent", "opportunity"],
+ ["uom", "uom"]
+ ]
+ }
+ }, target_doc)
+
+ return doclist
+
+@frappe.whitelist()
def make_supplier_quotation(source_name, target_doc=None):
doclist = get_mapped_doc("Opportunity", source_name, {
"Opportunity": {
@@ -284,4 +305,4 @@
doc.status = "Closed"
doc.flags.ignore_permissions = True
doc.flags.ignore_mandatory = True
- doc.save()
\ No newline at end of file
+ doc.save()
diff --git a/erpnext/patches/v8_9/set_print_zero_amount_taxes.py b/erpnext/patches/v8_9/set_print_zero_amount_taxes.py
index 33d3ced..621b573 100644
--- a/erpnext/patches/v8_9/set_print_zero_amount_taxes.py
+++ b/erpnext/patches/v8_9/set_print_zero_amount_taxes.py
@@ -4,4 +4,5 @@
from erpnext.setup.install import create_print_zero_amount_taxes_custom_field
def execute():
+ frappe.reload_doc("printing", "doctype", "print_style")
create_print_zero_amount_taxes_custom_field()
\ No newline at end of file