fixes related to --> clear locals and then sync locals when whole doclist is passed

This commit is contained in:
Anand Doshi
2012-06-25 20:05:35 +05:30
parent 815ad3fa28
commit 8ae5ba9abf
39 changed files with 103 additions and 79 deletions

View File

@@ -48,7 +48,7 @@ class DocType:
if not self.doc.kra_template:
msgprint("Please select Appraisal Template to be be fetched")
raise Exception
self.doc.clear_table(self.doclist,'appraisal_details')
self.doclist = self.doc.clear_table(self.doclist,'appraisal_details')
get_obj('DocType Mapper', 'Appraisal Template-Appraisal').dt_map('Appraisal Template', 'Appraisal', self.doc.kra_template, self.doc, self.doclist, "[['Appraisal Template','Appraisal'],['Appraisal Template Goal', 'Appraisal Goal']]")
def validate_dates(self):

View File

@@ -113,7 +113,7 @@ class DocType:
# clear table
# ------------
def clear_table(self):
self.doc.clear_table(self.doclist,'holiday_list_details')
self.doclist = self.doc.clear_table(self.doclist,'holiday_list_details')
# ***************************************** validate *************************************************

View File

@@ -24,7 +24,7 @@ cur_frm.cscript.onload = function(doc,dt,dn){
// Validation For To Date
// ================================================================================================
cur_frm.cscript.to_date = function(doc, cdt, cdn) {
$c('runserverobj', args={'method':'to_date_validation','docs':compress_doclist([doc])},
$c('runserverobj', args={'method':'to_date_validation','docs':compress_doclist(make_doclist(doc.doctype, doc.name))},
function(r, rt) {
var doc = locals[cdt][cdn];
if (r.message) {

View File

@@ -70,8 +70,8 @@ class DocType(TransactionBase):
# Pull struct details
#=======================================================
def pull_sal_struct(self, struct):
self.doc.clear_table(self.doclist, 'earning_details')
self.doc.clear_table(self.doclist, 'deduction_details')
self.doclist = self.doc.clear_table(self.doclist, 'earning_details')
self.doclist = self.doc.clear_table(self.doclist, 'deduction_details')
get_obj('DocType Mapper', 'Salary Structure-Salary Slip').dt_map('Salary Structure', 'Salary Slip', struct, self.doc, self.doclist, "[['Salary Structure', 'Salary Slip'],['Salary Structure Earning', 'Salary Slip Earning'],['Salary Structure Deduction','Salary Slip Deduction']]")