removed schedule date mandatory from purchase receipt

This commit is contained in:
Rushabh Mehta
2012-12-03 10:21:52 +05:30
parent 48c774137a
commit 08a437bad7
4 changed files with 574 additions and 710 deletions

View File

@@ -32,13 +32,8 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.cscript.onload_post_render = function(doc, dt, dn) { cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
var callback = function(doc, dt, dn) { var callback = function(doc, dt, dn) {
var callback1 = function(doc, dt, dn) {
if(doc.__islocal){
cur_frm.cscript.get_default_schedule_date(doc);
}
}
// defined in purchase_common.js // defined in purchase_common.js
cur_frm.cscript.update_item_details(doc, dt, dn, callback1); cur_frm.cscript.update_item_details(doc, dt, dn, function(r,rt) { });
} }
cur_frm.cscript.dynamic_label(doc, dt, dn, callback); cur_frm.cscript.dynamic_label(doc, dt, dn, callback);
} }
@@ -118,13 +113,6 @@ cur_frm.cscript.new_contact = function(){
loaddoc('Contact', tn); loaddoc('Contact', tn);
} }
//======================= posting date =============================
cur_frm.cscript.transaction_date = function(doc,cdt,cdn){
if(doc.__islocal){
cur_frm.cscript.get_default_schedule_date(doc);
}
}
// ***************** Get project name ***************** // ***************** Get project name *****************
cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
return 'SELECT `tabProject`.name FROM `tabProject` \ return 'SELECT `tabProject`.name FROM `tabProject` \

View File

@@ -43,19 +43,9 @@ class DocType(TransactionBase):
def autoname(self): def autoname(self):
self.doc.name = make_autoname(self.doc.naming_series+'.#####') self.doc.name = make_autoname(self.doc.naming_series+'.#####')
# Client Trigger Functions
#----------------------------------------------------------------------------------------------------
def get_default_schedule_date(self):
get_obj(dt = 'Purchase Common').get_default_schedule_date(self)
#-----------------Validation For Fiscal Year------------------------
def validate_fiscal_year(self): def validate_fiscal_year(self):
get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Transaction Date') get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Transaction Date')
# Get Item Details
def get_item_details(self, arg = ''): def get_item_details(self, arg = ''):
if arg: if arg:
return get_obj(dt='Purchase Common').get_item_details(self,arg) return get_obj(dt='Purchase Common').get_item_details(self,arg)

File diff suppressed because it is too large Load Diff

View File

@@ -1,99 +1,73 @@
# DocType, Rename Tool
[ [
# These values are common in all dictionaries
{ {
u'creation': '2012-07-03 13:30:42', "owner": "Administrator",
u'docstatus': 0, "docstatus": 0,
u'modified': '2012-11-16 14:16:09', "creation": "2012-11-30 18:14:18",
u'modified_by': u'Administrator', "modified_by": "Administrator",
u'owner': u'Administrator' "modified": "2012-12-03 09:48:37"
}, },
# These values are common for all DocType
{ {
'_last_update': u'1308739509', "allow_email": 1,
'allow_email': 1, "hide_heading": 0,
'allow_print': 1, "issingle": 1,
'colour': u'White:FFF', "name": "__common__",
u'doctype': u'DocType', "allow_print": 1,
'hide_heading': 0, "doctype": "DocType",
'hide_toolbar': 0, "module": "Utilities",
'issingle': 1, "hide_toolbar": 0
'module': u'Utilities',
u'name': u'__common__',
'section_style': u'Simple',
'show_in_menu': 0,
'version': 1
}, },
# These values are common for all DocField
{ {
u'doctype': u'DocField', "name": "__common__",
u'name': u'__common__', "parent": "Rename Tool",
'parent': u'Rename Tool', "doctype": "DocField",
'parentfield': u'fields', "parenttype": "DocType",
'parenttype': u'DocType', "permlevel": 0,
'permlevel': 0 "parentfield": "fields"
}, },
# These values are common for all DocPerm
{ {
'create': 1, "parent": "Rename Tool",
u'doctype': u'DocPerm', "read": 1,
u'name': u'__common__', "name": "__common__",
'parent': u'Rename Tool', "create": 1,
'parentfield': u'permissions', "doctype": "DocPerm",
'parenttype': u'DocType', "write": 1,
'permlevel': 0, "parenttype": "DocType",
'read': 1, "role": "System Manager",
'role': u'System Manager', "permlevel": 0,
'write': 1 "parentfield": "permissions"
}, },
# DocType, Rename Tool
{ {
u'doctype': u'DocType', "name": "Rename Tool",
u'name': u'Rename Tool' "doctype": "DocType"
}, },
# DocField
{ {
u'doctype': u'DocField', "doctype": "DocField",
'fieldname': u'select_doctype', "label": "Select DocType",
'fieldtype': u'Select', "fieldname": "select_doctype",
'label': u'Select DocType', "fieldtype": "Select",
'options': u'\nAccount\nCompany\nCustomer\nSupplier\nEmployee\nWarehouse\nItem\nProfile\nSerial No' "options": "\nAccount\nCompany\nCustomer\nSupplier\nEmployee\nWarehouse\nItem\nProfile\nSerial No"
}, },
# DocField
{ {
u'doctype': u'DocField', "doctype": "DocField",
'fieldname': u'document_to_rename', "label": "Document to rename",
'fieldtype': u'Link', "fieldname": "document_to_rename",
'label': u'Document to rename', "fieldtype": "Link",
'options': u'[Select]' "options": "[Select]"
}, },
# DocField
{ {
u'doctype': u'DocField', "doctype": "DocField",
'fieldname': u'new_name', "label": "New Name",
'fieldtype': u'Data', "fieldname": "new_name",
'label': u'New Name' "fieldtype": "Data"
}, },
# DocField
{ {
u'doctype': u'DocField', "doctype": "DocField",
'fieldname': u'rename', "label": "Rename",
'fieldtype': u'Button', "fieldname": "rename",
'label': u'Rename', "fieldtype": "Button",
'options': u'rename' "options": "rename"
}, },
# DocPerm
{ {
u'doctype': u'DocPerm' "doctype": "DocPerm"
} }
] ]