[mappers] cleanup, remove dt_map, map_doclist and other such functions

This commit is contained in:
Rushabh Mehta
2013-07-08 11:08:27 +05:30
parent ed23cca9d3
commit a2a1ec765b
25 changed files with 75 additions and 213 deletions

View File

@@ -65,8 +65,7 @@ class DocType(TransactionBase):
'Installation Date')
def validate_reference_value(self):
mapper = get_obj('DocType Mapper', 'Delivery Note-Installation Note', with_children = 1)
mapper.validate_reference_value(self, self.doc.name)
pass
def is_serial_no_added(self, item_code, serial_no):
ar_required = webnotes.conn.get_value("Item", item_code, "has_serial_no")

View File

@@ -135,25 +135,10 @@ cur_frm.cscript['Make Sales Order'] = function() {
//pull enquiry details
cur_frm.cscript.pull_enquiry_detail = function(doc,cdt,cdn){
var callback = function(r,rt){
if(r.message){
doc.quotation_to = r.message;
if(doc.quotation_to == 'Lead') {
unhide_field('lead');
}
else if(doc.quotation_to == 'Customer') {
unhide_field(['customer','customer_address','contact_person','territory','customer_group']);
}
refresh_many(['quotation_details','quotation_to','customer','customer_address',
'contact_person', 'lead', 'address_display', 'contact_display', 'contact_mobile',
'contact_email', 'territory', 'customer_group', 'order_type']);
}
}
$c_obj(make_doclist(doc.doctype, doc.name),'pull_enq_details','',callback);
wn.model.map_current_doc({
method: "selling.doctype.opportunity.opportunity.make_quotation",
source_name: cur_frm.doc.enq_no,
})
}
// declare order lost

View File

@@ -37,26 +37,11 @@ class DocType(SellingController):
def onload(self):
self.add_communication_list()
# Pull Opportunity Details
# --------------------
def pull_enq_details(self):
self.doclist = self.doc.clear_table(self.doclist, 'quotation_details')
get_obj('DocType Mapper', 'Opportunity-Quotation').dt_map('Opportunity', 'Quotation', self.doc.enq_no, self.doc, self.doclist, "[['Opportunity', 'Quotation'],['Opportunity Item', 'Quotation Item']]")
self.get_adj_percent()
return self.doc.quotation_to
# Get contact person details based on customer selected
# ------------------------------------------------------
def get_contact_details(self):
return get_obj('Sales Common').get_contact_details(self,0)
# QUOTATION DETAILS TRIGGER FUNCTIONS
# ================================================================================
# Get Item Details
# -----------------
def get_item_details(self, args=None):
@@ -83,20 +68,12 @@ class DocType(SellingController):
# --------------------------------------------------------------
def get_adj_percent(self, arg=''):
get_obj('Sales Common').get_adj_percent(self)
# OTHER CHARGES TRIGGER FUNCTIONS
# ====================================================================================
# Get Tax rate if account type is TAX
# -----------------------------------
def get_rate(self,arg):
return get_obj('Sales Common').get_rate(arg)
# VALIDATE
# ==============================================================================================
# Fiscal Year Validation
# ----------------------

View File

@@ -89,7 +89,6 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
},
make_delivery_note: function() {
console.log(cur_frm.doc.name);
wn.model.open_mapped_doc({
method: "selling.doctype.sales_order.sales_order.make_delivery_note",
source_name: cur_frm.doc.name