Fixed multiple minor issues
diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js
index 2f1169d..b6346f8 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.js
+++ b/erpnext/crm/doctype/opportunity/opportunity.js
@@ -23,20 +23,19 @@
refresh: function(frm) {
var doc = frm.doc;
frm.events.enquiry_from(frm);
-
if(doc.status!=="Lost") {
if(doc.with_items){
frm.add_custom_button(__('Supplier Quotation'),
function() {
frm.trigger("make_supplier_quotation")
}, __("Make"));
-
- frm.add_custom_button(__('Quotation'),
- cur_frm.cscript.create_quotation, __("Make"));
-
- frm.page.set_inner_btn_group_as_primary(__("Make"));
}
+ frm.add_custom_button(__('Quotation'),
+ cur_frm.cscript.create_quotation, __("Make"));
+
+ frm.page.set_inner_btn_group_as_primary(__("Make"));
+
if(doc.status!=="Quotation") {
frm.add_custom_button(__('Lost'),
cur_frm.cscript['Declare Opportunity Lost']);
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index 8bd3a23..6be0768 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -39,6 +39,9 @@
if not self.title:
self.title = self.customer_name
+
+ if not self.with_items:
+ self.items = []
def make_new_lead_if_required(self):
diff --git a/erpnext/patches/v7_1/set_prefered_contact_email.py b/erpnext/patches/v7_1/set_prefered_contact_email.py
index d662e0d..d083811 100644
--- a/erpnext/patches/v7_1/set_prefered_contact_email.py
+++ b/erpnext/patches/v7_1/set_prefered_contact_email.py
@@ -14,6 +14,4 @@
employee.prefered_contact_email = "User ID"
employee.prefered_email = employee.user_id
- employee.flags.ignore_mandatory = True
- employee.flags.ignore_validate = True
- employee.save()
\ No newline at end of file
+ employee.db_update()
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py
index a687880..dd6aa10 100644
--- a/erpnext/utilities/doctype/contact/contact.py
+++ b/erpnext/utilities/doctype/contact/contact.py
@@ -103,4 +103,5 @@
for key in ("first_name", "last_name", "phone"):
if doc.get(key):
contact.set(key, doc.get(key))
+ contact.flags.ignore_mandatory = True
contact.save(ignore_permissions=True)