Fixed multiple minor issues

This commit is contained in:
Nabin Hait 2016-11-14 11:10:22 +05:30
parent 598a0c918d
commit 256a3fef95
4 changed files with 10 additions and 9 deletions

View File

@ -23,19 +23,18 @@ frappe.ui.form.on("Opportunity", {
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"));
}
if(doc.status!=="Quotation") {
frm.add_custom_button(__('Lost'),

View File

@ -40,6 +40,9 @@ class Opportunity(TransactionBase):
if not self.title:
self.title = self.customer_name
if not self.with_items:
self.items = []
def make_new_lead_if_required(self):
"""Set lead against new opportunity"""

View File

@ -14,6 +14,4 @@ def execute():
employee.prefered_contact_email = "User ID"
employee.prefered_email = employee.user_id
employee.flags.ignore_mandatory = True
employee.flags.ignore_validate = True
employee.save()
employee.db_update()

View File

@ -103,4 +103,5 @@ def update_contact(doc, method):
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)