From bdaada108044c2dccf17b2f8f1b061b0d9964283 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 29 Oct 2012 14:26:05 +0530 Subject: [PATCH 1/2] allow attachments in Task --- projects/doctype/task/task.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/projects/doctype/task/task.txt b/projects/doctype/task/task.txt index 07a9343027..2ced8289d7 100644 --- a/projects/doctype/task/task.txt +++ b/projects/doctype/task/task.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - u'creation': '2012-08-08 15:39:55', + u'creation': '2012-09-18 11:05:48', u'docstatus': 0, - u'modified': '2012-09-17 10:58:32', + u'modified': '2012-10-29 14:24:55', u'modified_by': u'Administrator', u'owner': u'Administrator' }, @@ -13,12 +13,14 @@ # These values are common for all DocType { '_last_update': u'1324880734', + 'allow_attach': 1, 'allow_trash': 1, 'autoname': u'TASK.#####', 'colour': u'White:FFF', 'default_print_format': u'Standard', u'doctype': u'DocType', 'document_type': u'Master', + 'max_attachments': 5, 'module': u'Projects', u'name': u'__common__', 'section_style': u'Tray', @@ -298,6 +300,17 @@ 'oldfieldtype': u'Date' }, + # DocField + { + u'doctype': u'DocField', + 'fieldname': u'file_list', + 'fieldtype': u'Text', + 'hidden': 1, + 'label': u'File List', + 'no_copy': 1, + 'print_hide': 1 + }, + # DocPerm { 'cancel': 1, From 548eb7b1c30127b5da015751fce623cb49056826 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 29 Oct 2012 14:26:38 +0530 Subject: [PATCH 2/2] change project get_query to include projects with status other than Completed and Cancelled --- accounts/doctype/purchase_invoice/purchase_invoice.js | 4 +++- accounts/doctype/sales_invoice/sales_invoice.js | 5 ++++- buying/doctype/purchase_order/purchase_order.js | 4 +++- buying/doctype/supplier_quotation/supplier_quotation.js | 3 ++- production/doctype/bom/bom.js | 4 +++- production/doctype/production_order/production_order.js | 4 +++- projects/doctype/task/task.js | 4 +++- selling/doctype/sales_order/sales_order.js | 4 +++- stock/doctype/delivery_note/delivery_note.js | 5 ++++- stock/doctype/purchase_receipt/purchase_receipt.js | 4 +++- 10 files changed, 31 insertions(+), 10 deletions(-) diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.js b/accounts/doctype/purchase_invoice/purchase_invoice.js index 8d37b77c76..1a9ef60baa 100644 --- a/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -394,7 +394,9 @@ cur_frm.cscript.make_jv = function(doc, dt, dn, bank_account) { // ***************** Get project name ***************** cur_frm.fields_dict['entries'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { - return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; + return 'SELECT `tabProject`.name FROM `tabProject` \ + WHERE `tabProject`.status not in ("Completed", "Cancelled") \ + AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; } diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/accounts/doctype/sales_invoice/sales_invoice.js index 16973f07bd..ad774fe0e8 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.js +++ b/accounts/doctype/sales_invoice/sales_invoice.js @@ -376,7 +376,10 @@ cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) { cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { var cond = ''; if(doc.customer) cond = '(`tabProject`.customer = "'+doc.customer+'" OR IFNULL(`tabProject`.customer,"")="") AND'; - return repl('SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND %(cond)s `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond}); + return repl('SELECT `tabProject`.name FROM `tabProject` \ + WHERE `tabProject`.status not in ("Completed", "Cancelled") \ + AND %(cond)s `tabProject`.name LIKE "%s" \ + ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond}); } //Territory diff --git a/buying/doctype/purchase_order/purchase_order.js b/buying/doctype/purchase_order/purchase_order.js index 0eb830bcde..d0d878df08 100644 --- a/buying/doctype/purchase_order/purchase_order.js +++ b/buying/doctype/purchase_order/purchase_order.js @@ -99,7 +99,9 @@ cur_frm.cscript.transaction_date = function(doc,cdt,cdn){ } cur_frm.fields_dict['po_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { - return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; + return 'SELECT `tabProject`.name FROM `tabProject` \ + WHERE `tabProject`.status not in ("Completed", "Cancelled") \ + AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; } cur_frm.fields_dict['indent_no'].get_query = function(doc) { diff --git a/buying/doctype/supplier_quotation/supplier_quotation.js b/buying/doctype/supplier_quotation/supplier_quotation.js index faaf296cb5..7c9b55c27a 100644 --- a/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/buying/doctype/supplier_quotation/supplier_quotation.js @@ -77,7 +77,8 @@ cur_frm.cscript.uom = function(doc, cdt, cdn) { cur_frm.fields_dict['quotation_items'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { return "select `tabProject`.name from `tabProject` \ - where `tabProject`.status = \"Open\" and `tabProject`.name like \"%s\" \ + where `tabProject`.status not in (\"Completed\", \"Cancelled\") \ + and `tabProject`.name like \"%s\" \ order by `tabProject`.name ASC LIMIT 50"; } diff --git a/production/doctype/bom/bom.js b/production/doctype/bom/bom.js index 393125750d..fd9be8f604 100644 --- a/production/doctype/bom/bom.js +++ b/production/doctype/bom/bom.js @@ -145,7 +145,9 @@ cur_frm.fields_dict['item'].get_query = function(doc) { } cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) { - return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; + return 'SELECT `tabProject`.name FROM `tabProject` \ + WHERE `tabProject`.status not in ("Completed", "Cancelled") \ + AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; } cur_frm.fields_dict['bom_materials'].grid.get_field('item_code').get_query = function(doc) { diff --git a/production/doctype/production_order/production_order.js b/production/doctype/production_order/production_order.js index 6ac70652ae..411f77999b 100644 --- a/production/doctype/production_order/production_order.js +++ b/production/doctype/production_order/production_order.js @@ -104,7 +104,9 @@ cur_frm.fields_dict['production_item'].get_query = function(doc) { } cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) { - return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; + return 'SELECT `tabProject`.name FROM `tabProject` \ + WHERE `tabProject`.status not in ("Completed", "Cancelled") \ + AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; } cur_frm.fields_dict['bom_no'].get_query = function(doc) { diff --git a/projects/doctype/task/task.js b/projects/doctype/task/task.js index d1317aeb65..295c58eb93 100644 --- a/projects/doctype/task/task.js +++ b/projects/doctype/task/task.js @@ -17,7 +17,9 @@ cur_frm.fields_dict['project'].get_query = function(doc,cdt,cdn){ var cond=''; if(doc.customer) cond = 'ifnull(`tabProject`.customer, "") = "'+doc.customer+'" AND'; - return repl('SELECT distinct `tabProject`.`name` FROM `tabProject` WHERE %(cond)s `tabProject`.`name` LIKE "%s" ORDER BY `tabProject`.`name` ASC LIMIT 50', {cond:cond}); + return repl('SELECT distinct `tabProject`.`name` FROM `tabProject` \ + WHERE %(cond)s `tabProject`.`name` LIKE "%s" \ + ORDER BY `tabProject`.`name` ASC LIMIT 50', {cond:cond}); } diff --git a/selling/doctype/sales_order/sales_order.js b/selling/doctype/sales_order/sales_order.js index d448c79c91..1285c84e97 100644 --- a/selling/doctype/sales_order/sales_order.js +++ b/selling/doctype/sales_order/sales_order.js @@ -168,7 +168,9 @@ cur_frm.cscript.new_contact = function(){ cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { var cond = ''; if(doc.customer) cond = '(`tabProject`.customer = "'+doc.customer+'" OR IFNULL(`tabProject`.customer,"")="") AND'; - return repl('SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND %(cond)s `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond}); + return repl('SELECT `tabProject`.name FROM `tabProject` \ + WHERE `tabProject`.status not in ("Completed", "Cancelled") \ + AND %(cond)s `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond}); } //---- get customer details ---------------------------- diff --git a/stock/doctype/delivery_note/delivery_note.js b/stock/doctype/delivery_note/delivery_note.js index 03743e2ffe..e1f8b3784e 100644 --- a/stock/doctype/delivery_note/delivery_note.js +++ b/stock/doctype/delivery_note/delivery_note.js @@ -150,7 +150,10 @@ cur_frm.fields_dict['delivery_note_details'].grid.get_field('batch_no').get_quer cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { var cond = ''; if(doc.customer) cond = '(`tabProject`.customer = "'+doc.customer+'" OR IFNULL(`tabProject`.customer,"")="") AND'; - return repl('SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND %(cond)s `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond}); + return repl('SELECT `tabProject`.name FROM `tabProject` \ + WHERE `tabProject`.status not in ("Completed", "Cancelled") \ + AND %(cond)s `tabProject`.name LIKE "%s" \ + ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond}); } diff --git a/stock/doctype/purchase_receipt/purchase_receipt.js b/stock/doctype/purchase_receipt/purchase_receipt.js index 9cb13f4a74..b9433147a8 100644 --- a/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/stock/doctype/purchase_receipt/purchase_receipt.js @@ -128,7 +128,9 @@ cur_frm.cscript.transaction_date = function(doc,cdt,cdn){ // ***************** Get project name ***************** cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { - return 'SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; + return 'SELECT `tabProject`.name FROM `tabProject` \ + WHERE `tabProject`.status not in ("Completed", "Cancelled") \ + AND `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50'; }