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