fix: Removed redundant code

This commit is contained in:
deepeshgarg007
2019-04-01 23:07:36 +05:30
parent a65af7a2f5
commit ff99492481
2 changed files with 6 additions and 14 deletions

View File

@@ -39,16 +39,16 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
onload: function(doc, dt, dn) {
var me = this;
this._super(doc, dt, dn);
if(doc.customer && !doc.quotation_to)
doc.quotation_to = "Customer";
else if(doc.lead && !doc.quotation_to)
doc.quotation_to = "Lead";
// if(doc.customer && !doc.quotation_to)
// doc.quotation_to = "Customer";
// else if(doc.lead && !doc.quotation_to)
// doc.quotation_to = "Lead";
},
refresh: function(doc, dt, dn) {
this._super(doc, dt, dn);
doctype = doc.quotation_to == 'Customer' ? 'Customer':'Lead';
frappe.dynamic_link = {doc: this.frm.doc, fieldname: doctype.toLowerCase(), doctype: doctype}
// doctype = doc.quotation_to == 'Customer' ? 'Customer':'Lead';
// frappe.dynamic_link = {doc: this.frm.doc, fieldname: doctype.toLowerCase(), doctype: doctype}
var me = this;

View File

@@ -28,7 +28,6 @@ class Quotation(SellingController):
self.update_opportunity()
self.validate_order_type()
self.validate_uom_is_integer("stock_uom", "qty")
# self.validate_quotation_to()
self.validate_valid_till()
if self.items:
self.with_items = 1
@@ -43,13 +42,6 @@ class Quotation(SellingController):
def validate_order_type(self):
super(Quotation, self).validate_order_type()
# def validate_quotation_to(self):
# if self.customer:
# self.quotation_to = "Customer"
# self.lead = None
# elif self.lead:
# self.quotation_to = "Lead"
def update_lead(self):
if self.quotation_to == "Lead":
frappe.get_doc("Lead", self.customer_lead).set_status(update=True)