From 29d5549bde40a79581bcf4bd5b97cd5ac4d17521 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Thu, 25 Aug 2011 16:20:16 +0530 Subject: [PATCH 01/37] Features Setting 1. Features Setting DocType 2. Startup.js will be added with a function which binds with refresh of doc 3. Startup.js contains the Features dictionary --- accounts/doctype/loan/__init__.py | 0 accounts/doctype/loan/loan.js | 54 ------ accounts/doctype/loan/loan.py | 48 ----- accounts/doctype/loan/loan.txt | 172 ------------------ accounts/doctype/loan/test_loan.py | 17 -- accounts/doctype/loan_installment/__init__.py | 0 .../loan_installment/loan_installment.txt | 111 ----------- .../receivable_voucher/receivable_voucher.js | 50 ++--- .../production_order/production_order.py | 12 +- selling/doctype/sales_order/sales_order.js | 4 +- 10 files changed, 33 insertions(+), 435 deletions(-) delete mode 100644 accounts/doctype/loan/__init__.py delete mode 100644 accounts/doctype/loan/loan.js delete mode 100644 accounts/doctype/loan/loan.py delete mode 100644 accounts/doctype/loan/loan.txt delete mode 100644 accounts/doctype/loan/test_loan.py delete mode 100644 accounts/doctype/loan_installment/__init__.py delete mode 100644 accounts/doctype/loan_installment/loan_installment.txt diff --git a/accounts/doctype/loan/__init__.py b/accounts/doctype/loan/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/accounts/doctype/loan/loan.js b/accounts/doctype/loan/loan.js deleted file mode 100644 index 5a453627ec..0000000000 --- a/accounts/doctype/loan/loan.js +++ /dev/null @@ -1,54 +0,0 @@ -$.extend(cur_frm.cscript, { - Generate: function(doc, dt, dn) { - cur_frm.cscript.clear_installments(doc); - for(var i=0; i< doc.no_of_installments; i++) { - d = LocalDB.add_child(doc, 'Loan Installment', 'installments'); - d.amount = doc.loan_amount / doc.no_of_installments; - d.due_date = dateutil.add_months(doc.start_date, i+1); - } - cur_frm.refresh(); - }, -/* submit:function(doc){ - data=doc.get_values(); - - data['']= - $c_obj(make_doclist(dt,dn),'loan_post',data,function(){}); - },*/ - refresh: function(doc) { - cur_frm.cscript.hide_show_buttons(doc); - }, - hide_show_buttons: function(doc) { - if(doc.docstatus==0) { - hide_field('Installment Reciept'); unhide_field('Generate'); - } else if (doc.docstatus==1) { - unhide_field('Installment Reciept');hide_field('Generate'); - } - }, - clear_installments: function(doc) { - $.each(getchildren('Loan Installment', doc.name, 'installments', 'Loan'), - function(i, d) { - LocalDB.delete_doc('Loan Installment', d.name); - } - ) - }, - 'Installment Reciept': function(doc, dt, dn) { - var d = new wn.widgets.Dialog({ - width: 500, - title: 'Add a new payment installment', - fields: [ - {fieldtype:'Data', label:'Cheque Number', fieldname:'cheque_number', reqd:1}, - {fieldtype:'Date', label:'Cheque Date', fieldname:'cheque_date', reqd:1}, - {fieldtype:'Link', label:'Bank Account', fieldname:'bank_account', reqd:1, options:'Account'}, - {fieldtype:'Button', label:'Update',fieldname:'update'} - ] - }) - d.show(); - d.fields_dict.update.input.onclick = function() { - var data = d.get_values(); - - if(data) { - $c_obj(make_doclist(dt,dn),'loan_installment_post',data,function(){cur_frm.refresh(); d.hide();}); - } - } - } -}) diff --git a/accounts/doctype/loan/loan.py b/accounts/doctype/loan/loan.py deleted file mode 100644 index 9f0bcb53a0..0000000000 --- a/accounts/doctype/loan/loan.py +++ /dev/null @@ -1,48 +0,0 @@ -import webnotes -from webnotes.model.doc import make_autoname, Document, addchild -from webnotes import msgprint -from webnotes.utils import get_defaults -import json -from accounts.utils import post_jv -sql = webnotes.conn.sql - -class DocType: - def __init__(self, doc, doclist): - self.doc, self.doclist = doc, doclist - - def autoname(self): - """ - Create Loan Id using naming_series pattern - """ - self.doc.name = make_autoname(self.doc.naming_series+ '.#####') - - def loan_post(self): - data['voucher_type']='Loan Issue' - data['naming_series']='JV' - data['fiscal_year'] = get_defaults()['fiscal_year'] # To be modified to take care - data['company'] = get_defaults()['company'] - data['debit_account'] = self.doc['receivable_account'] - data['credit_account'] = self.doc['account'] - data['amount'] = self.doc.loan_amount - jv_name=post_jv(data) - - def loan_installment_post(self, args): - """ - Posts the loan receipt into Journal Voucher - """ - next_inst = sql("select amount,name from `tabLoan Installment` where parent=%s and ifnull(cheque_number,'')='' order by due_date limit 1",self.doc.name) - - data = json.loads(args) - data['voucher_type']='Loan Receipt' - data['naming_series']='JV' - data['amount']=next_inst[0][0] - data['debit_account']=data.get('bank_account') - data['credit_account']=self.doc.account - data['fiscal_year']=get_defaults()['fiscal_year'] - data['company']=get_defaults()['company'] - jv_name=post_jv(data) - - sql("update `tabLoan Installment` set cheque_number=%s, cheque_date=%s, jv_number=%s where name=%s",(data.get('cheque_number'),data.get('cheque_date'),jv_name,next_inst[0][1])) - - self.doclist = [Document(d.doctype, d.name) for d in self.doclist] - diff --git a/accounts/doctype/loan/loan.txt b/accounts/doctype/loan/loan.txt deleted file mode 100644 index 001e1d3845..0000000000 --- a/accounts/doctype/loan/loan.txt +++ /dev/null @@ -1,172 +0,0 @@ -# DocType, Loan -[ - - # These values are common in all dictionaries - { - 'creation': '2011-07-15 10:35:26', - 'docstatus': 0, - 'modified': '2011-07-18 12:12:19', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all DocType - { - '_last_update': '1310963215', - 'colour': 'White:FFF', - 'doctype': 'DocType', - 'module': 'Accounts', - 'name': '__common__', - 'section_style': 'Simple', - 'show_in_menu': 0, - 'version': 15 - }, - - # These values are common for all DocField - { - 'doctype': 'DocField', - 'name': '__common__', - 'parent': 'Loan', - 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0 - }, - - # These values are common for all DocPerm - { - 'doctype': 'DocPerm', - 'name': '__common__', - 'parent': 'Loan', - 'parentfield': 'permissions', - 'parenttype': 'DocType', - 'read': 1, - 'role': 'Accounts User' - }, - - # DocType, Loan - { - 'doctype': 'DocType', - 'name': 'Loan' - }, - - # DocPerm - { - 'cancel': 1, - 'create': 1, - 'doctype': 'DocPerm', - 'idx': 1, - 'permlevel': 0, - 'submit': 1, - 'write': 1 - }, - - # DocPerm - { - 'doctype': 'DocPerm', - 'idx': 2, - 'permlevel': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'naming_series', - 'fieldtype': 'Select', - 'idx': 1, - 'label': 'Naming Series', - 'options': '\nLOAN', - 'reqd': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'account', - 'fieldtype': 'Link', - 'idx': 2, - 'label': 'Account', - 'options': 'Account', - 'reqd': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'receivable_account', - 'fieldtype': 'Link', - 'idx': 3, - 'label': 'Receivable Account', - 'options': 'Account' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'invoice', - 'fieldtype': 'Link', - 'idx': 4, - 'label': 'Invoice', - 'options': 'Receivable Voucher', - 'reqd': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'loan_amount', - 'fieldtype': 'Currency', - 'idx': 5, - 'label': 'Loan Amount', - 'reqd': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'start_date', - 'fieldtype': 'Date', - 'idx': 6, - 'label': 'Start Date', - 'reqd': 1 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'no_of_installments', - 'fieldtype': 'Int', - 'idx': 7, - 'label': 'No of Installments', - 'reqd': 1 - }, - - # DocField - { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'Button', - 'idx': 8, - 'label': 'Generate', - 'trigger': 'Client' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'installments', - 'fieldtype': 'Table', - 'idx': 9, - 'label': 'Installments', - 'options': 'Loan Installment' - }, - - # DocField - { - 'allow_on_submit': 1, - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'Button', - 'idx': 10, - 'label': 'Installment Reciept' - } -] \ No newline at end of file diff --git a/accounts/doctype/loan/test_loan.py b/accounts/doctype/loan/test_loan.py deleted file mode 100644 index 4e72559d6e..0000000000 --- a/accounts/doctype/loan/test_loan.py +++ /dev/null @@ -1,17 +0,0 @@ -import unittest -import webnotes -from webnotes.model.code import get_obj - -class TestScheduleGeneartion(unittest.TestCase): - def setUp(self): - webnotes.conn.begin() - # create a mock loan - self.loan = get_obj('Loan', 'LOAN00001') - - def test_generation(self): - "test the genaration of loan installments" - self.loan.generate() - self.assertEqual(self.loan.get_installment_total(), self.loan.doc.loan_amount) - - def tearDown(self): - webnotes.conn.rollback() diff --git a/accounts/doctype/loan_installment/__init__.py b/accounts/doctype/loan_installment/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/accounts/doctype/loan_installment/loan_installment.txt b/accounts/doctype/loan_installment/loan_installment.txt deleted file mode 100644 index f729e3434b..0000000000 --- a/accounts/doctype/loan_installment/loan_installment.txt +++ /dev/null @@ -1,111 +0,0 @@ -# DocType, Loan Installment -[ - - # These values are common in all dictionaries - { - 'creation': '2011-07-15 10:36:42', - 'docstatus': 0, - 'modified': '2011-07-15 15:48:34', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all DocType - { - 'colour': 'White:FFF', - 'doctype': 'DocType', - 'istable': 1, - 'module': 'Accounts', - 'name': '__common__', - 'section_style': 'Simple', - 'show_in_menu': 0, - 'version': 4 - }, - - # These values are common for all DocField - { - 'doctype': 'DocField', - 'name': '__common__', - 'parent': 'Loan Installment', - 'parentfield': 'fields', - 'parenttype': 'DocType' - }, - - # DocType, Loan Installment - { - 'doctype': 'DocType', - 'name': 'Loan Installment' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'amount', - 'fieldtype': 'Currency', - 'idx': 1, - 'label': 'Amount', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'due_date', - 'fieldtype': 'Date', - 'idx': 2, - 'label': 'Due Date', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'cheque_number', - 'fieldtype': 'Data', - 'idx': 3, - 'label': 'Cheque Number', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'cheque_date', - 'fieldtype': 'Date', - 'idx': 4, - 'label': 'Cheque Date', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'deposit_date', - 'fieldtype': 'Date', - 'idx': 5, - 'label': 'Deposit Date', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'realized_date', - 'fieldtype': 'Date', - 'idx': 6, - 'label': 'Realized Date', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'jv_number', - 'fieldtype': 'Link', - 'hidden': 0, - 'idx': 7, - 'label': 'JV Number', - 'options': 'Journal Voucher', - 'permlevel': 1 - } -] \ No newline at end of file diff --git a/accounts/doctype/receivable_voucher/receivable_voucher.js b/accounts/doctype/receivable_voucher/receivable_voucher.js index a25d311110..e773a95fc8 100644 --- a/accounts/doctype/receivable_voucher/receivable_voucher.js +++ b/accounts/doctype/receivable_voucher/receivable_voucher.js @@ -18,10 +18,10 @@ cur_frm.cscript.onload = function(doc,dt,dn) { if(!doc.voucher_date) set_multiple(dt,dn,{voucher_date:get_today()}); if(!doc.due_date) set_multiple(dt,dn,{due_date:get_today()}); if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()}); - + //for previously created sales invoice, set required field related to pos if(doc.is_pos ==1) cur_frm.cscript.is_pos(doc, dt, dn); - + hide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']); } } @@ -37,10 +37,10 @@ cur_frm.cscript.onload_post_render = function(doc, dt, dn) { } ); } - + if(!doc.customer && doc.__islocal) { // new -- load default taxes - cur_frm.cscript.load_taxes(doc, cdt, cdn); + cur_frm.cscript.load_taxes(doc, cdt, cdn); } } @@ -61,19 +61,19 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { // Show / Hide button cur_frm.clear_custom_buttons(); - - if(doc.docstatus==1) { + + if(doc.docstatus==1) { cur_frm.add_custom_button('View Ledger', cur_frm.cscript['View Ledger Entry']); cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']); unhide_field('Repair Outstanding Amt'); - + if(doc.is_pos==1 && doc.update_stock!=1) cur_frm.add_custom_button('Make Delivery', cur_frm.cscript['Make Delivery Note']); - + if(doc.outstanding_amount!=0) cur_frm.add_custom_button('Make Payment Entry', cur_frm.cscript['Make Bank Voucher']); } - else + else hide_field('Repair Outstanding Amt'); cur_frm.cscript.is_opening(doc, dt, dn); cur_frm.cscript.hide_fields(doc, cdt, cdn); @@ -117,13 +117,13 @@ cur_frm.cscript.customer = function(doc,dt,dn) { var doc = locals[cur_frm.doctype][cur_frm.docname]; get_server_fields('get_debit_to','','',doc, dt, dn, 0); cur_frm.refresh(); - } + } - if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', '', callback); + if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', '', callback); if(doc.customer) unhide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']); } -cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) { +cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) { if(doc.customer) get_server_fields('get_customer_address', JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1); } @@ -152,15 +152,15 @@ cur_frm.cscript.debit_to = function(doc,dt,dn) { var callback2 = function(r,rt) { var doc = locals[cur_frm.doctype][cur_frm.docname]; cur_frm.refresh(); - } - + } + var callback = function(r,rt) { - var doc = locals[cur_frm.doctype][cur_frm.docname]; + var doc = locals[cur_frm.doctype][cur_frm.docname]; if(doc.customer) $c_obj(make_doclist(dt,dn), 'get_default_customer_address', '', callback2); if(doc.customer) unhide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']); cur_frm.refresh(); } - + if(doc.debit_to && doc.posting_date){ get_server_fields('get_cust_and_due_date','','',doc,dt,dn,1,callback); } @@ -187,13 +187,13 @@ cur_frm.cscript.project_name = function(doc,cdt,cdn){ //Set debit and credit to zero on adding new row //---------------------------------------------- cur_frm.fields_dict['entries'].grid.onrowadd = function(doc, cdt, cdn){ - + cl = getchildren('RV Detail', doc.name, cur_frm.cscript.fname, doc.doctype); acc = ''; cc = ''; for(var i = 0; i Date: Mon, 29 Aug 2011 19:24:54 +0530 Subject: [PATCH 02/37] Added new Feature List option to control front end based on companies broad requirements --- selling/doctype/sales_order/sales_order.js | 1 - setup/doctype/features_setup/__init__.py | 0 .../doctype/features_setup/features_setup.py | 13 + .../doctype/features_setup/features_setup.txt | 152 ++++++++++ startup/startup.js | 280 ++++++++++++++---- 5 files changed, 386 insertions(+), 60 deletions(-) create mode 100644 setup/doctype/features_setup/__init__.py create mode 100644 setup/doctype/features_setup/features_setup.py create mode 100644 setup/doctype/features_setup/features_setup.txt diff --git a/selling/doctype/sales_order/sales_order.js b/selling/doctype/sales_order/sales_order.js index 47c8c34418..e684bed1bf 100644 --- a/selling/doctype/sales_order/sales_order.js +++ b/selling/doctype/sales_order/sales_order.js @@ -70,7 +70,6 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { } else { hide_field(['Repair Sales Order', 'Send SMS', 'message', 'customer_mobile_no']) } - pscript.apply_feature_settings(); } //customer diff --git a/setup/doctype/features_setup/__init__.py b/setup/doctype/features_setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/setup/doctype/features_setup/features_setup.py b/setup/doctype/features_setup/features_setup.py new file mode 100644 index 0000000000..3a549d9e32 --- /dev/null +++ b/setup/doctype/features_setup/features_setup.py @@ -0,0 +1,13 @@ +class DocType: + def __init__(self, d, dl): + self.doc, self.doclist = d, dl + + def validate(self): + """ + update settings in defaults + """ + from webnotes.model import default_fields + from webnotes.utils import set_default + for key in self.doc.fields: + if key not in default_fields: + set_default(key, self.doc.fields[key]) diff --git a/setup/doctype/features_setup/features_setup.txt b/setup/doctype/features_setup/features_setup.txt new file mode 100644 index 0000000000..491cb8d203 --- /dev/null +++ b/setup/doctype/features_setup/features_setup.txt @@ -0,0 +1,152 @@ +# DocType, Features Setup +[ + + # These values are common in all dictionaries + { + 'creation': '2011-08-25 16:53:56', + 'docstatus': 0, + 'modified': '2011-08-29 13:16:51', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all DocType + { + '_last_update': '1314601410', + 'colour': 'White:FFF', + 'doctype': 'DocType', + 'issingle': 1, + 'module': 'Setup', + 'name': '__common__', + 'section_style': 'Simple', + 'show_in_menu': 1, + 'version': 6 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Check', + 'name': '__common__', + 'parent': 'Features Setup', + 'parentfield': 'fields', + 'parenttype': 'DocType', + 'permlevel': 0 + }, + + # These values are common for all DocPerm + { + 'create': 1, + 'doctype': 'DocPerm', + 'name': '__common__', + 'parent': 'Features Setup', + 'parentfield': 'permissions', + 'parenttype': 'DocType', + 'permlevel': 0, + 'read': 1, + 'write': 1 + }, + + # DocType, Features Setup + { + 'doctype': 'DocType', + 'name': 'Features Setup' + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'role': 'System Manager' + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'role': 'Administrator' + }, + + # DocField + { + 'description': 'Available in \nBill Of Materials, Delivery Note, Payable Voucher, Production Order, Purchase Order, Purchase Receipt, Receivable Voucher, Sales Order, Stock Entry, Timesheet', + 'doctype': 'DocField', + 'fieldname': 'projects', + 'label': 'Projects' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'Available in Delivery Note and Sales Order', + 'doctype': 'DocField', + 'fieldname': 'packing_details', + 'label': 'Packing Detials' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'Available in Delivery Note, Quotation, Receivable Voucher, Sales Order', + 'doctype': 'DocField', + 'fieldname': 'discounts', + 'label': 'Discounts' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'Availble in Delivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No', + 'doctype': 'DocField', + 'fieldname': 'brands', + 'label': 'Brands' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'after_sale_installations', + 'label': 'After Sale Installations' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'warehouses', + 'label': 'Warehouses' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'item_batch_nos', + 'label': 'Item Batch Nos' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'item_searial_nos', + 'label': 'Item Serial Nos' + }, + + # DocField + { + 'colour': 'White:FFF', + 'doctype': 'DocField', + 'fieldname': 'page_break', + 'label': 'Page Break' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'item_groups_in_groups', + 'label': 'Item Groups in Details' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'ref_rates', + 'label': 'Ref Rates' + } +] \ No newline at end of file diff --git a/startup/startup.js b/startup/startup.js index 5a2a816e89..13be705261 100644 --- a/startup/startup.js +++ b/startup/startup.js @@ -12,8 +12,8 @@ if(inList(user_roles,'System Manager')) is_system_manager = 1; function startup_setup() { pscript.is_erpnext_saas = cint(locals['Control Panel']['Control Panel'].sync_with_gateway) - - + + if(get_url_arg('embed')) { // hide header, footer $dh(page_body.banner_area); @@ -34,7 +34,7 @@ function startup_setup() { $td(page_body.wntoolbar.body_tab,0,0).innerHTML = 'erpnext'; $y($td(page_body.wntoolbar.body_tab,0,0), {width:'140px', color:'#FFF', paddingLeft:'8px', paddingRight:'8px', fontSize:'14px'}) $dh(page_body.banner_area); - + // sidebar // ------- pscript.startup_make_sidebar(); @@ -65,10 +65,10 @@ pscript.startup_make_sidebar = function() { var callback = function(r,rt) { // menu var ml = r.message; - + // clear page_body.left_sidebar.innerHTML = ''; - + for(var m=0; mNote: These changes will apply to all users!', ml, update_order, 1); } $c_obj('Home Control', 'get_module_order', '', callback) - + } // ==================================================================== @@ -437,7 +437,7 @@ pscript.startup_setup_toolbar = function() { // Profile // --------- $td(menu_tab,0,0).innerHTML = ''+user_fullname+''; - + if(pscript.is_erpnext_saas){ // Help // -------------- @@ -474,7 +474,7 @@ show_chart_browser = function(nm, chart_type){ var call_back = function(){ if(nm == 'Sales Browser'){ var sb_obj = new SalesBrowser(); - sb_obj.set_val(chart_type); + sb_obj.set_val(chart_type); } else if(nm == 'Accounts Browser') pscript.make_chart(chart_type); @@ -501,7 +501,7 @@ ModulePage = function(parent, module_name, module_label, help_page, callback) { var btn = this.page_head.add_button('Help', function() { loadpage(this.help_page) }, 1, 'ui-icon-help') btn.help_page = help_page; } - + if(callback) this.callback = function(){ callback(); } } @@ -517,12 +517,12 @@ get_plural = function(str){ // set user fullname // ==================================================================== pscript.set_user_fullname = function(ele,username,get_latest){ - + var set_it = function(){ if(ele) ele.innerHTML = user_full_nm[username]; } - + if(get_latest){ $c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); }); } @@ -530,7 +530,7 @@ pscript.set_user_fullname = function(ele,username,get_latest){ if(user_full_nm[username]){ set_it(); } - + else $c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); }); } @@ -539,4 +539,166 @@ pscript.set_user_fullname = function(ele,username,get_latest){ // ==================================================================== startup_setup(); -$(document).bind('form_refresh', function() { }) \ No newline at end of file +/* features setup "Dictionary", "Script" +Dictionary Format + 'projects': { + 'Sales Order': { + 'fields':['project_name'], + 'sales_order_details':['projected_qty'] + }, + 'Purchase Order': { + 'fields':['project_name'] + } + } +// ====================================================================*/ +pscript.feature_dict = { + 'projects': { + 'Bill Of Materials': {'fields':['project_name']}, + 'Delivery Note': {'fields':['project_name']}, + 'Payable Voucher': {'fields':['project_name']}, + 'Production Order': {'fields':['project_name']}, + 'Purchase Order': {'fields':['project_name']}, + 'Purchase Receipt': {'fields':['project_name']}, + 'Receivable Voucher': {'fields':['project_name']}, + 'Sales Order': {'fields':['project_name']}, + 'Stock Entry': {'fields':['project_name']}, + 'Timesheet': {'timesheet_details':['project_name']} + }, + 'packing_details': { + 'Delivery Note': {'fields':['packing_details','print_packing_slip'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']}, + 'Sales Order': {'fields':['packing_details']} + }, + 'discounts': { + 'Delivery Note': {'delivery_note_details':['adj_rate']}, + 'Quotation': {'quotation_details':['adj_rate']}, + 'Receivable Voucher': {'rv_details':['adj_rate']}, + 'Sales Order': {'sale_order_details':['adj_rate']} + }, + 'brands': { + 'Delivery Note': {'delivery_note_details':['brand']}, + 'Enquiry': {'enquiry_details':['brand']}, + 'Indent': {'indent_details':['brand']}, + 'Item': {'fields':['brand']}, + 'Purchase Order': {'po_details':['brand']}, + 'Purchase Receipt': {'purchase_receipt_details':['brand']}, + 'Payable Voucher': {'pv_details':['brand']}, + 'Quotation': {'quotation_details':['brand']}, + 'Receivable Voucher': {'rv_details':['brand']}, + 'Sales BOM': {'fields':['new_item_brand']}, + 'Sales Order': {'sales_order_details':['brand']}, + 'Serial No': {'fields':['brand']} + }, + 'after_sale_installations': { + 'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']} + }, + 'item_batch_nos': { + 'Delivery Note': {'delivery_note_details':['batch_no']}, + 'Item': {'fields':['has_batch_no']}, + 'Purchase Receipt': {'purchase_receipt_details':['batch_no']}, + 'QA Inspection Report': {'fields':['batch_no']}, + 'Sales and Pruchase Return Wizard': {'return_details':['batch_no']}, + 'Receivable Voucher': {'rv_details':['batch_no']}, + 'Stock Entry': {'stock_entry_details':['batch_no']}, + 'Stock Ledger Entry': {'fields':['batch_no']} + }, + 'item_serial_nos': { + 'Customer Issue': {'fields':['serial_no']}, + 'Delivery Note': {'delivery_note_details':['serial_no'],'delivery_note_packing_details':['serial_no']}, + 'Installation Note': {'installed_item_details':['serial_no']}, + 'Item': {'fields':['has_serial_no']}, + 'Maintenance Schedule': {'item_maintenance_details':['serial_no'],'maintenance_schedule_details':['serial_no']}, + 'Maintenance Visit': {'maintenance_visit_details':['serial_no']}, + 'Purchase Receipt': {'purchase_receipt_details':['serial_no']}, + 'QA Inspection Report': {'fields':['item_serial_no']}, + 'Sales and Pruchase Return Wizard': {'return_details':['serial_no']}, + 'Receivable Voucher': {'rv_details':['serial_no']}, + 'Stock Entry': {'stock_entry_details':['serial_no']}, + 'Stock Ledger Entry': {'fields':['serial_no']} + }, + 'item_groups_in_details': { + 'Delivery Note': {'delivery_note_details':['item_group']}, + 'Enquiry': {'enquiry_details':['item_group']}, + 'Indent': {'indent_details':['item_group']}, + 'Item': {'fields':['item_group']}, + 'Manage Account': {'fields':['default_item_group']}, + 'Purchase Order': {'po_details':['item_group']}, + 'Purchase Receipt': {'purchase_receipt_details':['item_group']}, + 'Purchase Voucher': {'pv_details':['item_group']}, + 'Quotation': {'quotation_details':['item_group']}, + 'Receivable Voucher': {'rv_details':['item_group']}, + 'Sales BOM': {'fields':['serial_no']}, + 'Sales Order': {'sales_order_details':['item_group']}, + 'Serial No': {'fields':['item_group']}, + 'Sales Partner': {'partner_target_details':['item_group']}, + 'Sales Person': {'target_details':['item_group']}, + 'Territory': {'target_details':['item_group']} + }, + 'page_break': { + 'Delivery Note': {'delivery_note_details':['page_break'],'delivery_note_packing_details':['page_break']}, + 'Indent': {'indent_details':['page_break']}, + 'Purchase Order': {'po_details':['page_break']}, + 'Purchase Receipt': {'purchase_receipt_details':['page_break']}, + 'Purchase Voucher': {'pv_details':['page_break']}, + 'Quotation': {'quotation_details':['page_break']}, + 'Receivable Voucher': {'rv_details':['page_break']}, + 'Sales Order': {'sales_order_details':['page_break']} + }, + 'multi_currency': { + 'Delivery Note': {'fields':['currency','conversion_rate']}, + 'Payable Voucher': {'fields':['currency','conversion_rate']}, + 'POS Setting': {'fields':['currency','conversion_rate']}, + 'Purchase Order': {'fields':['currency','conversion_rate']}, + 'Purchase Receipt': {'fields':['currency','conversion_rate']}, + 'Quotation': {'fields':['currency','conversion_rate']}, + 'Receivable Voucher': {'fields':['currency','conversion_rate']}, + 'Quotation': {'fields':['currency','conversion_rate']}, + 'Item': {'ref_rate_details':['currency']}, + 'Sales BOM': {'fields':['currency']}, + 'Sales Order': {'fields':['currency','conversion_rate']}, + 'Supplier Quotation': {'fields':['currency','conversion_rate']} + }, + 'exports': { + 'Delivery Note': {'fields':['currency','conversion_rate','Note','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate',]}, + 'POS Setting': {'fields':['currency','conversion_rate']}, + 'Quotation': {'fields':['currency','conversion_rate']}, + 'Receivable Voucher': {'fields':['currency','conversion_rate']}, + 'Quotation': {'fields':['currency','conversion_rate']}, + 'Item': {'ref_rate_details':['currency']}, + 'Sales BOM': {'fields':['currency']}, + 'Sales Order': {'fields':['currency','conversion_rate']}, + 'Supplier Quotation': {'fields':['currency','conversion_rate']} + }, + 'imports': { + 'Payable Voucher': {'fields':['currency','conversion_rate']}, + 'Purchase Order': {'fields':['currency','conversion_rate']}, + 'Purchase Receipt': {'fields':['currency','conversion_rate']}, + 'Receivable Voucher': {'fields':['currency','conversion_rate']}, + 'Supplier Quotation': {'fields':['currency','conversion_rate']} + } + +} + +$(document).bind('form_refresh', function() { + for(sys_feat in sys_defaults) + { + if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists + { + if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat]) + { + for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype]) + { + if(fort=='fields') + hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]); + else + { + for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]) + if(cur_frm.fields_dict[fort]) + cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false); + else + alert('Grid "'+fort+'" does not exists'); + } + } + } + } + } +}) From d1a2cea37661f1c4e64e3ca9e0888f723da03ca8 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Tue, 30 Aug 2011 09:33:29 +0530 Subject: [PATCH 03/37] Feature Setup added --- startup/startup.js | 706 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 706 insertions(+) create mode 100644 startup/startup.js diff --git a/startup/startup.js b/startup/startup.js new file mode 100644 index 0000000000..2e5b987fd3 --- /dev/null +++ b/startup/startup.js @@ -0,0 +1,706 @@ +if(user == 'Guest'){ + $dh(page_body.left_sidebar); +} + +var current_module; +var is_system_manager = 0; +var module_content_dict = {}; +var user_full_nm = {}; + +// check if session user is system manager +if(inList(user_roles,'System Manager')) is_system_manager = 1; + +function startup_setup() { + pscript.is_erpnext_saas = cint(locals['Control Panel']['Control Panel'].sync_with_gateway) + + + if(get_url_arg('embed')) { + // hide header, footer + $dh(page_body.banner_area); + $dh(page_body.wntoolbar); + $dh(page_body.footer); + return; + } + + if(user=='Guest' && !get_url_arg('akey')) { + if(pscript.is_erpnext_saas) { + window.location.href = 'https://www.erpnext.com'; + return; + } + } + + // page structure + // -------------- + $td(page_body.wntoolbar.body_tab,0,0).innerHTML = 'erpnext'; + $y($td(page_body.wntoolbar.body_tab,0,0), {width:'140px', color:'#FFF', paddingLeft:'8px', paddingRight:'8px', fontSize:'14px'}) + $dh(page_body.banner_area); + + // sidebar + // ------- + pscript.startup_make_sidebar(); + + // border to the body + // ------------------ + $dh(page_body.footer); + + // for logout and payment + var callback = function(r,rt) { + if(r.message){ + login_file = 'http://' + r.message; + } + else if(pscript.is_erpnext_saas) { + login_file = 'https://www.erpnext.com'; + } + // setup toolbar + pscript.startup_setup_toolbar(); + } + $c_obj('Home Control', 'get_login_url', '', callback); +} + +// ==================================================================== + +pscript.startup_make_sidebar = function() { + $y(page_body.left_sidebar, {width:(100/6)+'%', paddingTop:'8px'}); + + var callback = function(r,rt) { + // menu + var ml = r.message; + + // clear + page_body.left_sidebar.innerHTML = ''; + + for(var m=0; mNote: These changes will apply to all users!', ml, update_order, 1); + } + $c_obj('Home Control', 'get_module_order', '', callback) + +} + +// ==================================================================== + +pscript.startup_setup_toolbar = function() { + var menu_tab = page_body.wntoolbar.menu_table_right; + // Profile + // --------- + $td(menu_tab,0,0).innerHTML = ''+user_fullname+''; + + if(pscript.is_erpnext_saas){ + // Help + // -------------- + //var help_url = login_file + '#!helpdesk' + $td(menu_tab,0,1).innerHTML = 'Forum'; + + // Manage account + // -------------- + if(is_system_manager) { + $td(menu_tab,0,3).innerHTML = 'Billing'; + } + } + else{ + $dh($td(menu_tab,0,1)); + $dh($td(menu_tab,0,3)); + } + + // Live Chat Help + // -------------- + $td(menu_tab,0,2).innerHTML = 'Chat'; + + // help + // ---- + var cell = menu_tab.rows[0].insertCell(3); + cell.innerHTML = 'Help'; + $y(cell, page_body.wntoolbar.right_table_style); + +} + +// chart of accounts +// ==================================================================== +show_chart_browser = function(nm, chart_type){ + + var call_back = function(){ + if(nm == 'Sales Browser'){ + var sb_obj = new SalesBrowser(); + sb_obj.set_val(chart_type); + } + else if(nm == 'Accounts Browser') + pscript.make_chart(chart_type); + } + loadpage(nm,call_back); +} + + +// Module Page +// ==================================================================== + +ModulePage = function(parent, module_name, module_label, help_page, callback) { + this.parent = parent; + + // add to current page + page_body.cur_page.module_page = this; + + this.wrapper = $a(parent,'div'); + this.module_name = module_name; + this.transactions = []; + this.page_head = new PageHeader(this.wrapper, module_label); + + if(help_page) { + var btn = this.page_head.add_button('Help', function() { loadpage(this.help_page) }, 1, 'ui-icon-help') + btn.help_page = help_page; + } + + if(callback) this.callback = function(){ callback(); } +} + + +// get plural +// ==================================================================== + +get_plural = function(str){ + if(str.charAt(str.length-1).toLowerCase() == 'y') return str.substr(0, str.length-1) + 'ies' + else return str + 's'; +} + +// set user fullname +// ==================================================================== +pscript.set_user_fullname = function(ele,username,get_latest){ + + var set_it = function(){ + if(ele) + ele.innerHTML = user_full_nm[username]; + } + + if(get_latest){ + $c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); }); + } + else{ + if(user_full_nm[username]){ + set_it(); + } + + else + $c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); }); + } +} + +// ==================================================================== +startup_setup(); + +/* features setup "Dictionary", "Script" +Dictionary Format + 'projects': { + 'Sales Order': { + 'fields':['project_name'], + 'sales_order_details':['projected_qty'] + }, + 'Purchase Order': { + 'fields':['project_name'] + } + } +// ====================================================================*/ +pscript.feature_dict = { + 'projects': { + 'Bill Of Materials': {'fields':['project_name']}, + 'Delivery Note': {'fields':['project_name']}, + 'Payable Voucher': {'fields':['project_name']}, + 'Production Order': {'fields':['project_name']}, + 'Purchase Order': {'fields':['project_name']}, + 'Purchase Receipt': {'fields':['project_name']}, + 'Receivable Voucher': {'fields':['project_name']}, + 'Sales Order': {'fields':['project_name']}, + 'Stock Entry': {'fields':['project_name']}, + 'Timesheet': {'timesheet_details':['project_name']} + }, + 'packing_details': { + 'Delivery Note': {'fields':['packing_details','print_packing_slip'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']}, + 'Sales Order': {'fields':['packing_details']} + }, + 'discounts': { + 'Delivery Note': {'delivery_note_details':['adj_rate']}, + 'Quotation': {'quotation_details':['adj_rate']}, + 'Receivable Voucher': {'rv_details':['adj_rate']}, + 'Sales Order': {'sale_order_details':['adj_rate']} + }, + 'brands': { + 'Delivery Note': {'delivery_note_details':['brand']}, + 'Enquiry': {'enquiry_details':['brand']}, + 'Indent': {'indent_details':['brand']}, + 'Item': {'fields':['brand']}, + 'Purchase Order': {'po_details':['brand']}, + 'Purchase Receipt': {'purchase_receipt_details':['brand']}, + 'Payable Voucher': {'pv_details':['brand']}, + 'Quotation': {'quotation_details':['brand']}, + 'Receivable Voucher': {'rv_details':['brand']}, + 'Sales BOM': {'fields':['new_item_brand']}, + 'Sales Order': {'sales_order_details':['brand']}, + 'Serial No': {'fields':['brand']} + }, + 'after_sale_installations': { + 'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']} + }, + 'item_batch_nos': { + 'Delivery Note': {'delivery_note_details':['batch_no']}, + 'Item': {'fields':['has_batch_no']}, + 'Purchase Receipt': {'purchase_receipt_details':['batch_no']}, + 'QA Inspection Report': {'fields':['batch_no']}, + 'Sales and Pruchase Return Wizard': {'return_details':['batch_no']}, + 'Receivable Voucher': {'rv_details':['batch_no']}, + 'Stock Entry': {'stock_entry_details':['batch_no']}, + 'Stock Ledger Entry': {'fields':['batch_no']} + }, + 'item_serial_nos': { + 'Customer Issue': {'fields':['serial_no']}, + 'Delivery Note': {'delivery_note_details':['serial_no'],'delivery_note_packing_details':['serial_no']}, + 'Installation Note': {'installed_item_details':['serial_no']}, + 'Item': {'fields':['has_serial_no']}, + 'Maintenance Schedule': {'item_maintenance_details':['serial_no'],'maintenance_schedule_details':['serial_no']}, + 'Maintenance Visit': {'maintenance_visit_details':['serial_no']}, + 'Purchase Receipt': {'purchase_receipt_details':['serial_no']}, + 'QA Inspection Report': {'fields':['item_serial_no']}, + 'Sales and Pruchase Return Wizard': {'return_details':['serial_no']}, + 'Receivable Voucher': {'rv_details':['serial_no']}, + 'Stock Entry': {'stock_entry_details':['serial_no']}, + 'Stock Ledger Entry': {'fields':['serial_no']} + }, + 'item_groups_in_details': { + 'Delivery Note': {'delivery_note_details':['item_group']}, + 'Enquiry': {'enquiry_details':['item_group']}, + 'Indent': {'indent_details':['item_group']}, + 'Item': {'fields':['item_group']}, + 'Manage Account': {'fields':['default_item_group']}, + 'Purchase Order': {'po_details':['item_group']}, + 'Purchase Receipt': {'purchase_receipt_details':['item_group']}, + 'Purchase Voucher': {'pv_details':['item_group']}, + 'Quotation': {'quotation_details':['item_group']}, + 'Receivable Voucher': {'rv_details':['item_group']}, + 'Sales BOM': {'fields':['serial_no']}, + 'Sales Order': {'sales_order_details':['item_group']}, + 'Serial No': {'fields':['item_group']}, + 'Sales Partner': {'partner_target_details':['item_group']}, + 'Sales Person': {'target_details':['item_group']}, + 'Territory': {'target_details':['item_group']} + }, + 'page_break': { + 'Delivery Note': {'delivery_note_details':['page_break'],'delivery_note_packing_details':['page_break']}, + 'Indent': {'indent_details':['page_break']}, + 'Purchase Order': {'po_details':['page_break']}, + 'Purchase Receipt': {'purchase_receipt_details':['page_break']}, + 'Purchase Voucher': {'pv_details':['page_break']}, + 'Quotation': {'quotation_details':['page_break']}, + 'Receivable Voucher': {'rv_details':['page_break']}, + 'Sales Order': {'sales_order_details':['page_break']} + }, + 'multi_currency': { + 'Delivery Note': {'fields':['currency','conversion_rate']}, + 'Payable Voucher': {'fields':['currency','conversion_rate']}, + 'POS Setting': {'fields':['currency','conversion_rate']}, + 'Purchase Order': {'fields':['currency','conversion_rate']}, + 'Purchase Receipt': {'fields':['currency','conversion_rate']}, + 'Quotation': {'fields':['currency','conversion_rate']}, + 'Receivable Voucher': {'fields':['currency','conversion_rate']}, + 'Quotation': {'fields':['currency','conversion_rate']}, + 'Item': {'ref_rate_details':['currency']}, + 'Sales BOM': {'fields':['currency']}, + 'Sales Order': {'fields':['currency','conversion_rate']}, + 'Supplier Quotation': {'fields':['currency','conversion_rate']} + }, + 'exports': { + 'Delivery Note': {'fields':['currency','conversion_rate','Note','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate',]}, + 'POS Setting': {'fields':['currency','conversion_rate']}, + 'Quotation': {'fields':['currency','conversion_rate']}, + 'Receivable Voucher': {'fields':['currency','conversion_rate']}, + 'Quotation': {'fields':['currency','conversion_rate']}, + 'Item': {'ref_rate_details':['currency']}, + 'Sales BOM': {'fields':['currency']}, + 'Sales Order': {'fields':['currency','conversion_rate']}, + 'Supplier Quotation': {'fields':['currency','conversion_rate']} + }, + 'imports': { + 'Payable Voucher': {'fields':['currency','conversion_rate']}, + 'Purchase Order': {'fields':['currency','conversion_rate']}, + 'Purchase Receipt': {'fields':['currency','conversion_rate']}, + 'Receivable Voucher': {'fields':['currency','conversion_rate']}, + 'Supplier Quotation': {'fields':['currency','conversion_rate']} + } + +} + +$(document).bind('form_refresh', function() { + for(sys_feat in sys_defaults) + { + if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists + { + if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat]) + { + for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype]) + { + if(fort=='fields') + hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]); + else + { + for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]) + if(cur_frm.fields_dict[fort]) + cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false); + else + alert('Grid "'+fort+'" does not exists'); + } + } + } + } + } +}) + +$(document).bind('form_refresh', function() { }) From 5ecb6933a8dafd313c7d0dac43b5fddd753691c1 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 31 Aug 2011 09:02:01 +0530 Subject: [PATCH 04/37] added features to feature setup --- .../doctype/features_setup/features_setup.txt | 91 ++++++++++++-- startup/startup.js | 114 ++++++++++-------- 2 files changed, 143 insertions(+), 62 deletions(-) diff --git a/setup/doctype/features_setup/features_setup.txt b/setup/doctype/features_setup/features_setup.txt index 491cb8d203..f95a8e7793 100644 --- a/setup/doctype/features_setup/features_setup.txt +++ b/setup/doctype/features_setup/features_setup.txt @@ -5,28 +5,28 @@ { 'creation': '2011-08-25 16:53:56', 'docstatus': 0, - 'modified': '2011-08-29 13:16:51', + 'modified': '2011-08-30 14:27:18', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1314601410', + '_last_update': '1314692719', 'colour': 'White:FFF', 'doctype': 'DocType', 'issingle': 1, 'module': 'Setup', 'name': '__common__', + 'name_case': 'Title Case', 'section_style': 'Simple', 'show_in_menu': 1, - 'version': 6 + 'version': 9 }, # These values are common for all DocField { 'doctype': 'DocField', - 'fieldtype': 'Check', 'name': '__common__', 'parent': 'Features Setup', 'parentfield': 'fields', @@ -70,6 +70,7 @@ 'description': 'Available in \nBill Of Materials, Delivery Note, Payable Voucher, Production Order, Purchase Order, Purchase Receipt, Receivable Voucher, Sales Order, Stock Entry, Timesheet', 'doctype': 'DocField', 'fieldname': 'projects', + 'fieldtype': 'Check', 'label': 'Projects' }, @@ -79,6 +80,7 @@ 'description': 'Available in Delivery Note and Sales Order', 'doctype': 'DocField', 'fieldname': 'packing_details', + 'fieldtype': 'Check', 'label': 'Packing Detials' }, @@ -88,6 +90,7 @@ 'description': 'Available in Delivery Note, Quotation, Receivable Voucher, Sales Order', 'doctype': 'DocField', 'fieldname': 'discounts', + 'fieldtype': 'Check', 'label': 'Discounts' }, @@ -97,6 +100,7 @@ 'description': 'Availble in Delivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No', 'doctype': 'DocField', 'fieldname': 'brands', + 'fieldtype': 'Check', 'label': 'Brands' }, @@ -104,20 +108,15 @@ { 'doctype': 'DocField', 'fieldname': 'after_sale_installations', + 'fieldtype': 'Check', 'label': 'After Sale Installations' }, - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'warehouses', - 'label': 'Warehouses' - }, - # DocField { 'doctype': 'DocField', 'fieldname': 'item_batch_nos', + 'fieldtype': 'Check', 'label': 'Item Batch Nos' }, @@ -125,6 +124,7 @@ { 'doctype': 'DocField', 'fieldname': 'item_searial_nos', + 'fieldtype': 'Check', 'label': 'Item Serial Nos' }, @@ -133,20 +133,85 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldname': 'page_break', + 'fieldtype': 'Check', 'label': 'Page Break' }, + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break' + }, + # DocField { 'doctype': 'DocField', 'fieldname': 'item_groups_in_groups', + 'fieldtype': 'Check', 'label': 'Item Groups in Details' }, # DocField { 'doctype': 'DocField', - 'fieldname': 'ref_rates', - 'label': 'Ref Rates' + 'fieldname': 'more_info', + 'fieldtype': 'Check', + 'label': 'More Info' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'exports', + 'fieldtype': 'Check', + 'label': 'Exports' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'imports', + 'fieldtype': 'Check', + 'label': 'Imports' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'item_advanced', + 'fieldtype': 'Check', + 'label': 'Item Advanced' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'sales_extras', + 'fieldtype': 'Check', + 'label': 'Sales Extras' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'quality', + 'fieldtype': 'Check', + 'label': 'Quality' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'manufacturing', + 'fieldtype': 'Check', + 'label': 'Manufacturing' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'pos', + 'fieldtype': 'Check', + 'label': 'Point of Sale' } ] \ No newline at end of file diff --git a/startup/startup.js b/startup/startup.js index 2e5b987fd3..046a320c43 100644 --- a/startup/startup.js +++ b/startup/startup.js @@ -571,19 +571,17 @@ pscript.feature_dict = { 'discounts': { 'Delivery Note': {'delivery_note_details':['adj_rate']}, 'Quotation': {'quotation_details':['adj_rate']}, - 'Receivable Voucher': {'rv_details':['adj_rate']}, - 'Sales Order': {'sale_order_details':['adj_rate']} + 'Receivable Voucher': {'entries':['adj_rate']}, + 'Sales Order': {'sales_order_details':['adj_rate']} }, 'brands': { 'Delivery Note': {'delivery_note_details':['brand']}, - 'Enquiry': {'enquiry_details':['brand']}, 'Indent': {'indent_details':['brand']}, 'Item': {'fields':['brand']}, 'Purchase Order': {'po_details':['brand']}, - 'Purchase Receipt': {'purchase_receipt_details':['brand']}, - 'Payable Voucher': {'pv_details':['brand']}, + 'Payable Voucher': {'entries':['brand']}, 'Quotation': {'quotation_details':['brand']}, - 'Receivable Voucher': {'rv_details':['brand']}, + 'Receivable Voucher': {'entries':['brand']}, 'Sales BOM': {'fields':['new_item_brand']}, 'Sales Order': {'sales_order_details':['brand']}, 'Serial No': {'fields':['brand']} @@ -597,13 +595,13 @@ pscript.feature_dict = { 'Purchase Receipt': {'purchase_receipt_details':['batch_no']}, 'QA Inspection Report': {'fields':['batch_no']}, 'Sales and Pruchase Return Wizard': {'return_details':['batch_no']}, - 'Receivable Voucher': {'rv_details':['batch_no']}, - 'Stock Entry': {'stock_entry_details':['batch_no']}, + 'Receivable Voucher': {'entries':['batch_no']}, + 'Stock Entry': {'mtn_details':['batch_no']}, 'Stock Ledger Entry': {'fields':['batch_no']} }, 'item_serial_nos': { 'Customer Issue': {'fields':['serial_no']}, - 'Delivery Note': {'delivery_note_details':['serial_no'],'delivery_note_packing_details':['serial_no']}, + 'Delivery Note': {'delivery_note_details':['serial_no'],'packing_details':['serial_no']}, 'Installation Note': {'installed_item_details':['serial_no']}, 'Item': {'fields':['has_serial_no']}, 'Maintenance Schedule': {'item_maintenance_details':['serial_no'],'maintenance_schedule_details':['serial_no']}, @@ -611,8 +609,8 @@ pscript.feature_dict = { 'Purchase Receipt': {'purchase_receipt_details':['serial_no']}, 'QA Inspection Report': {'fields':['item_serial_no']}, 'Sales and Pruchase Return Wizard': {'return_details':['serial_no']}, - 'Receivable Voucher': {'rv_details':['serial_no']}, - 'Stock Entry': {'stock_entry_details':['serial_no']}, + 'Receivable Voucher': {'entries':['serial_no']}, + 'Stock Entry': {'mtn_details':['serial_no']}, 'Stock Ledger Entry': {'fields':['serial_no']} }, 'item_groups_in_details': { @@ -623,9 +621,9 @@ pscript.feature_dict = { 'Manage Account': {'fields':['default_item_group']}, 'Purchase Order': {'po_details':['item_group']}, 'Purchase Receipt': {'purchase_receipt_details':['item_group']}, - 'Purchase Voucher': {'pv_details':['item_group']}, + 'Purchase Voucher': {'entries':['item_group']}, 'Quotation': {'quotation_details':['item_group']}, - 'Receivable Voucher': {'rv_details':['item_group']}, + 'Receivable Voucher': {'entries':['item_group']}, 'Sales BOM': {'fields':['serial_no']}, 'Sales Order': {'sales_order_details':['item_group']}, 'Serial No': {'fields':['item_group']}, @@ -634,48 +632,67 @@ pscript.feature_dict = { 'Territory': {'target_details':['item_group']} }, 'page_break': { - 'Delivery Note': {'delivery_note_details':['page_break'],'delivery_note_packing_details':['page_break']}, + 'Delivery Note': {'delivery_note_details':['page_break'],'packing_details':['page_break']}, 'Indent': {'indent_details':['page_break']}, 'Purchase Order': {'po_details':['page_break']}, 'Purchase Receipt': {'purchase_receipt_details':['page_break']}, - 'Purchase Voucher': {'pv_details':['page_break']}, + 'Purchase Voucher': {'entries':['page_break']}, 'Quotation': {'quotation_details':['page_break']}, - 'Receivable Voucher': {'rv_details':['page_break']}, + 'Receivable Voucher': {'entries':['page_break']}, 'Sales Order': {'sales_order_details':['page_break']} }, - 'multi_currency': { - 'Delivery Note': {'fields':['currency','conversion_rate']}, - 'Payable Voucher': {'fields':['currency','conversion_rate']}, - 'POS Setting': {'fields':['currency','conversion_rate']}, - 'Purchase Order': {'fields':['currency','conversion_rate']}, - 'Purchase Receipt': {'fields':['currency','conversion_rate']}, - 'Quotation': {'fields':['currency','conversion_rate']}, - 'Receivable Voucher': {'fields':['currency','conversion_rate']}, - 'Quotation': {'fields':['currency','conversion_rate']}, - 'Item': {'ref_rate_details':['currency']}, - 'Sales BOM': {'fields':['currency']}, - 'Sales Order': {'fields':['currency','conversion_rate']}, - 'Supplier Quotation': {'fields':['currency','conversion_rate']} - }, 'exports': { - 'Delivery Note': {'fields':['currency','conversion_rate','Note','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate',]}, - 'POS Setting': {'fields':['currency','conversion_rate']}, - 'Quotation': {'fields':['currency','conversion_rate']}, - 'Receivable Voucher': {'fields':['currency','conversion_rate']}, - 'Quotation': {'fields':['currency','conversion_rate']}, - 'Item': {'ref_rate_details':['currency']}, + 'Delivery Note': {'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate']}, + 'POS Setting': {'fields':['conversion_rate','currency']}, + 'Quotation': {'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['base_ref_rate','export_amount','export_rate']}, + 'Receivable Voucher': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['base_ref_rate','export_amount','export_rate']}, + 'Item': {'ref_rate_details':['ref_currency']}, 'Sales BOM': {'fields':['currency']}, - 'Sales Order': {'fields':['currency','conversion_rate']}, - 'Supplier Quotation': {'fields':['currency','conversion_rate']} + 'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']}, + 'Supplier Quotation': {'fields':['conversion_rate','currency']} }, 'imports': { - 'Payable Voucher': {'fields':['currency','conversion_rate']}, - 'Purchase Order': {'fields':['currency','conversion_rate']}, - 'Purchase Receipt': {'fields':['currency','conversion_rate']}, - 'Receivable Voucher': {'fields':['currency','conversion_rate']}, - 'Supplier Quotation': {'fields':['currency','conversion_rate']} + 'Payable Voucher': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['import_amount','import_rate']}, + 'Purchase Order': {'fields':['Note HTML','conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'po_details':['import_amount','import_rate']}, + 'Purchase Receipt': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['import_amount','import_rate']} + }, + 'item_advanced': { + 'Item': {'fields':['item_customer_details']} + }, + 'sales_extras': { + 'Address': {'fields':['sales_partner']}, + 'Contact': {'fields':['sales_partner']}, + 'Customer': {'fields':['sales_team']}, + 'Delivery Note': {'fields':['sales_team','Packing List']}, + 'Item': {'fields':['item_customer_details']}, + 'Receivable Voucher': {'fields':['sales_team']}, + 'Sales Order': {'fields':['sales_team','Packing List']} + }, + 'more_info': { + 'Customer': {'fields':['More Info']}, + 'Delivery Note': {'fields':['More Info']}, + 'Enquiry': {'fields':['More Info']}, + 'Indent': {'fields':['More Info']}, + 'Lead': {'fields':['More Info']}, + 'Payable Voucher': {'fields':['More Info']}, + 'Purchase Order': {'fields':['More Info']}, + 'Purchase Receipt': {'fields':['More Info']}, + 'Quotation': {'fields':['More Info']}, + 'Receivable Voucher': {'fields':['More Info']}, + 'Sales Order': {'fields':['More Info']}, + 'Serial No': {'fields':['More Info']}, + 'Supplier': {'fields':['More Info']} + }, + 'quality': { + 'Item': {'fields':['Item Inspection Criteria','inspection_required']}, + 'Purchase Receipt': {'purchase_receipt_details':['qa_no']} + }, + 'manufacturing': { + 'Item': {'fields':['Manufacturing']} + }, + 'pos': { + 'Receivable Voucher': {'fields':['is_pos']} } - } $(document).bind('form_refresh', function() { @@ -689,14 +706,13 @@ $(document).bind('form_refresh', function() { { if(fort=='fields') hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]); - else + else if(cur_frm.fields_dict[fort]) { for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]) - if(cur_frm.fields_dict[fort]) - cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false); - else - alert('Grid "'+fort+'" does not exists'); + cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false); } + else + msgprint('Grid "'+fort+'" does not exists'); } } } From 3c9a6a19e86a1eb80c5b9eb73a6c35ea93de6512 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 31 Aug 2011 12:55:41 +0530 Subject: [PATCH 05/37] Feature Setup changes, related patch, Production Order 'produced_qty' label change, item->ref_rate_details->currency fills with defaut --- patches/patch.py | 8 ++- .../production_order/production_order.txt | 51 ++++--------------- .../doctype/features_setup/features_setup.txt | 10 ++-- startup/startup.js | 8 ++- stock/doctype/item/item.js | 6 +++ .../ref_rate_detail/ref_rate_detail.txt | 20 +++----- 6 files changed, 37 insertions(+), 66 deletions(-) diff --git a/patches/patch.py b/patches/patch.py index 6bb134febe..c8b04724d1 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -2,7 +2,7 @@ # ======================== -last_patch = 351 +last_patch = 352 #------------------------------------------- @@ -268,7 +268,7 @@ def execute(patch_no): delete_doc('Custom Script', 'Profile-Client') delete_doc('Custom Script', 'Event-Client') delete_doc('Custom Script', 'File-Server') - + # reload profile with new fields for security delete_doc('DocType', 'Profile') reload_doc('core', 'doctype', 'profile') @@ -277,3 +277,7 @@ def execute(patch_no): reload_doc('stock', 'doctype', 'item_customer_detail') elif patch_no == 351: reload_doc('home', 'page', 'dashboard') + elif patch_no == 352: + reload_doc('setup', 'doctype','feature_setup') + reload_doc('stock','doctype','item') + sql("update tabDocField set label='Produced Qty',description='Updated after finished goods are transferred to FG Warehouse through Stock Entry' where parent='Production Order' and fieldname='produced_qty'") diff --git a/production/doctype/production_order/production_order.txt b/production/doctype/production_order/production_order.txt index c927edfae1..9226fd0c90 100644 --- a/production/doctype/production_order/production_order.txt +++ b/production/doctype/production_order/production_order.txt @@ -5,13 +5,14 @@ { 'creation': '2010-08-08 17:09:14', 'docstatus': 0, - 'modified': '2010-12-23 11:08:12', - 'modified_by': 'umair@iwebnotes.com', + 'modified': '2011-08-31 10:03:21', + 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { + '_last_update': '1313485457', 'colour': 'White:FFF', 'doctype': 'DocType', 'in_create': 0, @@ -20,7 +21,7 @@ 'section_style': 'Tabbed', 'server_code_error': ' ', 'show_in_menu': 0, - 'version': 179 + 'version': 180 }, # These values are common for all DocField @@ -54,7 +55,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 1, 'permlevel': 0, 'role': 'System Manager', 'submit': 1, @@ -64,7 +64,6 @@ # DocPerm { 'doctype': 'DocPerm', - 'idx': 2, 'permlevel': 1, 'role': 'All' }, @@ -75,7 +74,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 3, 'permlevel': 0, 'role': 'Production Manager', 'submit': 1, @@ -88,7 +86,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 4, 'permlevel': 0, 'role': 'Production User', 'submit': 1, @@ -99,7 +96,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 1, 'label': 'Production Order', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -112,7 +108,6 @@ 'doctype': 'DocField', 'fieldname': 'transaction_date', 'fieldtype': 'Date', - 'idx': 2, 'label': 'Transaction Date', 'oldfieldname': 'transaction_date', 'oldfieldtype': 'Date', @@ -127,7 +122,6 @@ 'doctype': 'DocField', 'fieldname': 'posting_date', 'fieldtype': 'Date', - 'idx': 3, 'label': 'Posting Date', 'oldfieldname': 'posting_date', 'oldfieldtype': 'Date', @@ -142,7 +136,6 @@ 'doctype': 'DocField', 'fieldname': 'production_item', 'fieldtype': 'Link', - 'idx': 4, 'in_filter': 1, 'label': 'Production Item', 'oldfieldname': 'production_item', @@ -158,7 +151,6 @@ 'doctype': 'DocField', 'fieldname': 'description', 'fieldtype': 'Text', - 'idx': 5, 'label': 'Description', 'oldfieldname': 'description', 'oldfieldtype': 'Text', @@ -173,14 +165,12 @@ 'doctype': 'DocField', 'fieldname': 'bom_no', 'fieldtype': 'Link', - 'idx': 7, 'label': 'BOM No', 'oldfieldname': 'bom_no', 'oldfieldtype': 'Link', 'options': 'Bill Of Materials', 'permlevel': 1, 'reqd': 1, - 'search_index': 0, 'trigger': 'Client' }, @@ -189,7 +179,6 @@ 'doctype': 'DocField', 'fieldname': 'origin', 'fieldtype': 'Select', - 'idx': 8, 'in_filter': 1, 'label': 'Origin', 'no_copy': 1, @@ -207,7 +196,6 @@ 'doctype': 'DocField', 'fieldname': 'qty', 'fieldtype': 'Currency', - 'idx': 9, 'label': 'Qty', 'oldfieldname': 'qty', 'oldfieldtype': 'Currency', @@ -221,7 +209,6 @@ 'doctype': 'DocField', 'fieldname': 'project_name', 'fieldtype': 'Link', - 'idx': 9, 'in_filter': 1, 'label': 'Project Name', 'oldfieldname': 'project_name', @@ -236,7 +223,6 @@ 'doctype': 'DocField', 'fieldname': 'amended_from', 'fieldtype': 'Data', - 'idx': 10, 'label': 'Amended From', 'oldfieldname': 'amended_from', 'oldfieldtype': 'Data', @@ -248,7 +234,6 @@ 'doctype': 'DocField', 'fieldname': 'amendment_date', 'fieldtype': 'Date', - 'idx': 11, 'label': 'Amendment Date', 'oldfieldname': 'amendment_date', 'oldfieldtype': 'Date', @@ -259,7 +244,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 12, 'oldfieldtype': 'Column Break', 'permlevel': 0 }, @@ -269,7 +253,6 @@ 'doctype': 'DocField', 'fieldname': 'stock_uom', 'fieldtype': 'Data', - 'idx': 12, 'label': 'Stock UOM', 'oldfieldname': 'stock_uom', 'oldfieldtype': 'Data', @@ -281,7 +264,6 @@ 'doctype': 'DocField', 'fieldname': 'status', 'fieldtype': 'Select', - 'idx': 13, 'in_filter': 1, 'label': 'Status', 'no_copy': 1, @@ -300,15 +282,13 @@ 'doctype': 'DocField', 'fieldname': 'fg_warehouse', 'fieldtype': 'Link', - 'idx': 14, 'in_filter': 1, 'label': 'FG Warehouse', 'oldfieldname': 'fg_warehouse', 'oldfieldtype': 'Link', 'options': 'Warehouse', 'permlevel': 0, - 'reqd': 1, - 'search_index': 0 + 'reqd': 1 }, # DocField @@ -318,15 +298,13 @@ 'doctype': 'DocField', 'fieldname': 'wip_warehouse', 'fieldtype': 'Link', - 'idx': 15, 'in_filter': 1, 'label': 'WIP Warehouse', 'oldfieldname': 'wip_warehouse', 'oldfieldtype': 'Link', 'options': 'Warehouse', 'permlevel': 0, - 'reqd': 1, - 'search_index': 0 + 'reqd': 1 }, # DocField @@ -336,7 +314,6 @@ 'doctype': 'DocField', 'fieldname': 'consider_sa_items', 'fieldtype': 'Select', - 'idx': 16, 'in_filter': 1, 'label': 'Consider SA Items', 'oldfieldname': 'consider_sa_items', @@ -349,11 +326,11 @@ # DocField { 'colour': 'White:FFF', + 'description': 'Updated after finished goods are transferred to FG Warehouse through Stock Entry', 'doctype': 'DocField', 'fieldname': 'produced_qty', 'fieldtype': 'Currency', - 'idx': 18, - 'label': 'Produced Qty (Updated after finished goods are transferred to FG Warehouse through Stock Entry)', + 'label': 'Produced Qty', 'oldfieldname': 'produced_qty', 'oldfieldtype': 'Currency', 'permlevel': 1 @@ -364,14 +341,12 @@ 'doctype': 'DocField', 'fieldname': 'company', 'fieldtype': 'Link', - 'idx': 19, 'label': 'Company', 'oldfieldname': 'company', 'oldfieldtype': 'Link', 'options': 'Company', 'permlevel': 0, - 'reqd': 1, - 'search_index': 0 + 'reqd': 1 }, # DocField @@ -379,7 +354,6 @@ 'doctype': 'DocField', 'fieldname': 'fiscal_year', 'fieldtype': 'Select', - 'idx': 20, 'in_filter': 1, 'label': 'Fiscal Year', 'oldfieldname': 'fiscal_year', @@ -393,7 +367,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 21, 'label': 'Next Steps', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -405,7 +378,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 22, 'label': 'Material Transfer', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -416,7 +388,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 23, 'oldfieldtype': 'Column Break', 'permlevel': 0 }, @@ -427,7 +398,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 24, 'label': 'Backflush', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -438,7 +408,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 25, 'oldfieldtype': 'Column Break', 'permlevel': 0 }, @@ -449,7 +418,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 26, 'label': 'Stop Production Order', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -462,7 +430,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 27, 'label': 'Unstop Production Order', 'oldfieldtype': 'Button', 'permlevel': 0, diff --git a/setup/doctype/features_setup/features_setup.txt b/setup/doctype/features_setup/features_setup.txt index f95a8e7793..ca0d2d44c6 100644 --- a/setup/doctype/features_setup/features_setup.txt +++ b/setup/doctype/features_setup/features_setup.txt @@ -5,14 +5,14 @@ { 'creation': '2011-08-25 16:53:56', 'docstatus': 0, - 'modified': '2011-08-30 14:27:18', + 'modified': '2011-08-31 09:31:39', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1314692719', + '_last_update': '1314763100', 'colour': 'White:FFF', 'doctype': 'DocType', 'issingle': 1, @@ -21,7 +21,7 @@ 'name_case': 'Title Case', 'section_style': 'Simple', 'show_in_menu': 1, - 'version': 9 + 'version': 11 }, # These values are common for all DocField @@ -107,7 +107,7 @@ # DocField { 'doctype': 'DocField', - 'fieldname': 'after_sale_installations', + 'fieldname': 'after_sales_installations', 'fieldtype': 'Check', 'label': 'After Sale Installations' }, @@ -146,7 +146,7 @@ # DocField { 'doctype': 'DocField', - 'fieldname': 'item_groups_in_groups', + 'fieldname': 'item_group_in_details', 'fieldtype': 'Check', 'label': 'Item Groups in Details' }, diff --git a/startup/startup.js b/startup/startup.js index 046a320c43..1ec66d519d 100644 --- a/startup/startup.js +++ b/startup/startup.js @@ -572,7 +572,7 @@ pscript.feature_dict = { 'Delivery Note': {'delivery_note_details':['adj_rate']}, 'Quotation': {'quotation_details':['adj_rate']}, 'Receivable Voucher': {'entries':['adj_rate']}, - 'Sales Order': {'sales_order_details':['adj_rate']} + 'Sales Order': {'sales_order_details':['adj_rate','ref_rate']} }, 'brands': { 'Delivery Note': {'delivery_note_details':['brand']}, @@ -586,7 +586,7 @@ pscript.feature_dict = { 'Sales Order': {'sales_order_details':['brand']}, 'Serial No': {'fields':['brand']} }, - 'after_sale_installations': { + 'after_sales_installations': { 'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']} }, 'item_batch_nos': { @@ -613,7 +613,7 @@ pscript.feature_dict = { 'Stock Entry': {'mtn_details':['serial_no']}, 'Stock Ledger Entry': {'fields':['serial_no']} }, - 'item_groups_in_details': { + 'item_group_in_details': { 'Delivery Note': {'delivery_note_details':['item_group']}, 'Enquiry': {'enquiry_details':['item_group']}, 'Indent': {'indent_details':['item_group']}, @@ -718,5 +718,3 @@ $(document).bind('form_refresh', function() { } } }) - -$(document).bind('form_refresh', function() { }) diff --git a/stock/doctype/item/item.js b/stock/doctype/item/item.js index 6dd7377ed7..691e25963c 100644 --- a/stock/doctype/item/item.js +++ b/stock/doctype/item/item.js @@ -110,3 +110,9 @@ cur_frm.cscript.weight_to_validate = function(doc,cdt,cdn){ cur_frm.cscript.validate = function(doc,cdt,cdn){ cur_frm.cscript.weight_to_validate(doc,cdt,cdn); } + +//===========Fill Default Currency in "Ref Rate Details==================== +cur_frm.fields_dict['ref_rate_details'].grid.onrowadd = function(doc, cdt, cdn){ + locals[cdt][cdn].ref_currency = sys_defaults.currency; + refresh_field('ref_currency',cdn,'ref_rate_details'); +} \ No newline at end of file diff --git a/stock/doctype/ref_rate_detail/ref_rate_detail.txt b/stock/doctype/ref_rate_detail/ref_rate_detail.txt index 1774b08d3a..3f9b5a7cb8 100644 --- a/stock/doctype/ref_rate_detail/ref_rate_detail.txt +++ b/stock/doctype/ref_rate_detail/ref_rate_detail.txt @@ -5,8 +5,8 @@ { 'creation': '2010-08-08 17:09:19', 'docstatus': 0, - 'modified': '2010-09-20 14:06:57', - 'modified_by': 'umair@iwebnotes.com', + 'modified': '2011-08-31 11:36:41', + 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -23,7 +23,7 @@ 'section_style': 'Tray', 'server_code_error': ' ', 'show_in_menu': 0, - 'version': 2 + 'version': 3 }, # These values are common for all DocField @@ -34,7 +34,8 @@ 'parent': 'Ref Rate Detail', 'parentfield': 'fields', 'parenttype': 'DocType', - 'permlevel': 0 + 'permlevel': 0, + 'search_index': 1 }, # DocType, Ref Rate Detail @@ -48,13 +49,12 @@ 'doctype': 'DocField', 'fieldname': 'price_list_name', 'fieldtype': 'Select', - 'idx': 1, 'label': 'Price List Name', 'oldfieldname': 'price_list_name', 'oldfieldtype': 'Select', 'options': 'link:Price List', 'reqd': 1, - 'search_index': 1 + 'trigger': 'Client' }, # DocField @@ -62,12 +62,10 @@ 'doctype': 'DocField', 'fieldname': 'ref_rate', 'fieldtype': 'Currency', - 'idx': 2, 'label': 'Ref Rate', 'oldfieldname': 'ref_rate', 'oldfieldtype': 'Currency', - 'reqd': 0, - 'search_index': 0 + 'reqd': 0 }, # DocField @@ -75,12 +73,10 @@ 'doctype': 'DocField', 'fieldname': 'ref_currency', 'fieldtype': 'Select', - 'idx': 3, 'label': 'Currency', 'oldfieldname': 'ref_currency', 'oldfieldtype': 'Select', 'options': 'link:Currency', - 'reqd': 1, - 'search_index': 1 + 'reqd': 1 } ] \ No newline at end of file From 8e8c4820cbfe4ed36b175e86c232cc2868bcf2bc Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 31 Aug 2011 15:46:29 +0530 Subject: [PATCH 06/37] Changes in patch of feature setup and added description against each feature --- patches/patch.py | 6 + .../doctype/features_setup/features_setup.txt | 271 +++++++++++------- startup/startup.js | 6 +- 3 files changed, 180 insertions(+), 103 deletions(-) diff --git a/patches/patch.py b/patches/patch.py index c8b04724d1..a7c25118c3 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -281,3 +281,9 @@ def execute(patch_no): reload_doc('setup', 'doctype','feature_setup') reload_doc('stock','doctype','item') sql("update tabDocField set label='Produced Qty',description='Updated after finished goods are transferred to FG Warehouse through Stock Entry' where parent='Production Order' and fieldname='produced_qty'") + rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null") + from webnotes.model.doc import Document + m = Document('Features Setup') + for d in rs: + m.fields[d[0]] = 1 + m.save() \ No newline at end of file diff --git a/setup/doctype/features_setup/features_setup.txt b/setup/doctype/features_setup/features_setup.txt index ca0d2d44c6..224d175a0b 100644 --- a/setup/doctype/features_setup/features_setup.txt +++ b/setup/doctype/features_setup/features_setup.txt @@ -5,14 +5,14 @@ { 'creation': '2011-08-25 16:53:56', 'docstatus': 0, - 'modified': '2011-08-31 09:31:39', + 'modified': '2011-08-31 15:05:53', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1314763100', + '_last_update': '1314783102', 'colour': 'White:FFF', 'doctype': 'DocType', 'issingle': 1, @@ -21,7 +21,7 @@ 'name_case': 'Title Case', 'section_style': 'Simple', 'show_in_menu': 1, - 'version': 11 + 'version': 16 }, # These values are common for all DocField @@ -65,6 +65,132 @@ 'role': 'Administrator' }, + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'label': 'Materials' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.', + 'doctype': 'DocField', + 'fieldname': 'item_searial_nos', + 'fieldtype': 'Check', + 'label': 'Item Serial Nos' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'To track items in sales and purchase documents with batch nos
Preferred Industry: Chemicals etc', + 'doctype': 'DocField', + 'fieldname': 'item_batch_nos', + 'fieldtype': 'Check', + 'label': 'Item Batch Nos' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'To track brand name in the following documents
\nDelivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No', + 'doctype': 'DocField', + 'fieldname': 'brands', + 'fieldtype': 'Check', + 'label': 'Brands' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': '1. To maintain the customer wise item code and to make them searchable based on their code use this option', + 'doctype': 'DocField', + 'fieldname': 'item_advanced', + 'fieldtype': 'Check', + 'label': 'Item Advanced' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order', + 'doctype': 'DocField', + 'fieldname': 'packing_details', + 'fieldtype': 'Check', + 'label': 'Packing Detials' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'To get Item Group in details table', + 'doctype': 'DocField', + 'fieldname': 'item_group_in_details', + 'fieldtype': 'Check', + 'label': 'Item Groups in Details' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'label': 'Sales and Purchase' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'All export related fields like currency, conversion rate, export total, export grand total etc are available in
\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.', + 'doctype': 'DocField', + 'fieldname': 'exports', + 'fieldtype': 'Check', + 'label': 'Exports' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'All import related fields like currency, conversion rate, import total, import grand total etc are available in
\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.', + 'doctype': 'DocField', + 'fieldname': 'imports', + 'fieldtype': 'Check', + 'label': 'Imports' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'Field available in Delivery Note, Quotation, Receivable Voucher, Sales Order', + 'doctype': 'DocField', + 'fieldname': 'discounts', + 'fieldtype': 'Check', + 'label': 'Discounts' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'To track any installation or commissioning related work after sales', + 'doctype': 'DocField', + 'fieldname': 'after_sales_installations', + 'fieldtype': 'Check', + 'label': 'After Sale Installations' + }, + # DocField { 'description': 'Available in \nBill Of Materials, Delivery Note, Payable Voucher, Production Order, Purchase Order, Purchase Receipt, Receivable Voucher, Sales Order, Stock Entry, Timesheet', @@ -77,60 +203,67 @@ # DocField { 'colour': 'White:FFF', - 'description': 'Available in Delivery Note and Sales Order', + 'description': 'If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity', 'doctype': 'DocField', - 'fieldname': 'packing_details', + 'fieldname': 'sales_extras', 'fieldtype': 'Check', - 'label': 'Packing Detials' + 'label': 'Sales Extras' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'label': 'Production' }, # DocField { 'colour': 'White:FFF', - 'description': 'Available in Delivery Note, Quotation, Receivable Voucher, Sales Order', + 'description': 'If you involve in manufacturing activity
\nEnables item Is Manufactured', 'doctype': 'DocField', - 'fieldname': 'discounts', + 'fieldname': 'manufacturing', 'fieldtype': 'Check', - 'label': 'Discounts' + 'label': 'Manufacturing' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break' }, # DocField { 'colour': 'White:FFF', - 'description': 'Availble in Delivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No', + 'description': 'If you follow Quality Inspection
\nEnables item QA Required and QA No in Purchase Receipt', 'doctype': 'DocField', - 'fieldname': 'brands', + 'fieldname': 'quality', 'fieldtype': 'Check', - 'label': 'Brands' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'after_sales_installations', - 'fieldtype': 'Check', - 'label': 'After Sale Installations' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'item_batch_nos', - 'fieldtype': 'Check', - 'label': 'Item Batch Nos' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'item_searial_nos', - 'fieldtype': 'Check', - 'label': 'Item Serial Nos' + 'label': 'Quality' }, # DocField { 'colour': 'White:FFF', + 'description': 'To enable Point of Sale features', + 'doctype': 'DocField', + 'fieldname': 'pos', + 'fieldtype': 'Check', + 'label': 'Point of Sale' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'label': 'Miscelleneous' + }, + + # DocField + { + 'colour': 'White:FFF', + 'description': 'If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page', 'doctype': 'DocField', 'fieldname': 'page_break', 'fieldtype': 'Check', @@ -145,73 +278,11 @@ # DocField { - 'doctype': 'DocField', - 'fieldname': 'item_group_in_details', - 'fieldtype': 'Check', - 'label': 'Item Groups in Details' - }, - - # DocField - { + 'colour': 'White:FFF', + 'description': 'Enables More Info. in all documents', 'doctype': 'DocField', 'fieldname': 'more_info', 'fieldtype': 'Check', 'label': 'More Info' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'exports', - 'fieldtype': 'Check', - 'label': 'Exports' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'imports', - 'fieldtype': 'Check', - 'label': 'Imports' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'item_advanced', - 'fieldtype': 'Check', - 'label': 'Item Advanced' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'sales_extras', - 'fieldtype': 'Check', - 'label': 'Sales Extras' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'quality', - 'fieldtype': 'Check', - 'label': 'Quality' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'manufacturing', - 'fieldtype': 'Check', - 'label': 'Manufacturing' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'pos', - 'fieldtype': 'Check', - 'label': 'Point of Sale' } ] \ No newline at end of file diff --git a/startup/startup.js b/startup/startup.js index 1ec66d519d..942f4effc5 100644 --- a/startup/startup.js +++ b/startup/startup.js @@ -648,13 +648,13 @@ pscript.feature_dict = { 'Receivable Voucher': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['base_ref_rate','export_amount','export_rate']}, 'Item': {'ref_rate_details':['ref_currency']}, 'Sales BOM': {'fields':['currency']}, - 'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']}, - 'Supplier Quotation': {'fields':['conversion_rate','currency']} + 'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']} }, 'imports': { 'Payable Voucher': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['import_amount','import_rate']}, 'Purchase Order': {'fields':['Note HTML','conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'po_details':['import_amount','import_rate']}, - 'Purchase Receipt': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['import_amount','import_rate']} + 'Purchase Receipt': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['import_amount','import_rate']}, + 'Supplier Quotation': {'fields':['conversion_rate','currency']} }, 'item_advanced': { 'Item': {'fields':['item_customer_details']} From c63e62e8835b01f0dc167f30c03777d70c9a172a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2011 14:44:15 +0530 Subject: [PATCH 07/37] reload salary manager --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 8c4c9dd113..14d7c926cb 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 352 +last_patch = 353 #------------------------------------------- @@ -288,3 +288,5 @@ def execute(patch_no): ch = addchild(dt_obj.doc, 'formats', 'DocFormat', 1) ch.format = 'Delivery Note Packing List Wise' ch.save(1) + elif patch_no == 353: + reload_doc('hr', 'doctype', 'salary_manager') From 8c2618c27accc2fab77c1c84df132cb55d0f4413 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2011 17:43:32 +0530 Subject: [PATCH 08/37] delete salary control panel and reload salary slip --- patches/patch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 14d7c926cb..0c821842ae 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 353 +last_patch = 354 #------------------------------------------- @@ -290,3 +290,6 @@ def execute(patch_no): ch.save(1) elif patch_no == 353: reload_doc('hr', 'doctype', 'salary_manager') + elif patch_no == 354: + reload_doc('hr', 'doctype', 'salary_slip') + delete_doc('DocType', 'Salary Control Panel') From 343e10586b71957ea1a968ad64b2373303a3d411 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2011 17:45:13 +0530 Subject: [PATCH 09/37] fixed sal slip email format --- hr/doctype/salary_slip/salary_slip.py | 69 ++++++++++++++------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/hr/doctype/salary_slip/salary_slip.py b/hr/doctype/salary_slip/salary_slip.py index 6a1705054e..3a42dca806 100644 --- a/hr/doctype/salary_slip/salary_slip.py +++ b/hr/doctype/salary_slip/salary_slip.py @@ -182,24 +182,24 @@ class DocType(TransactionBase): earn_table = '' ded_table = '' if earn_ret: - earn_table += "" + earn_table += "
" for e in earn_ret: if not e[1]: - earn_table +=''%(cstr(e[0])) + earn_table +=''%(cstr(e[0])) else: - earn_table +=''%(cstr(e[0]),cstr(e[1])) + earn_table +=''%(cstr(e[0]),cstr(e[1])) earn_table += '
%s0.00
%s0.00
%s%s
%s%s
' if ded_ret: - ded_table += "" + ded_table += "
" for d in ded_ret: if not d[1]: - ded_table +=''%(cstr(d[0])) + ded_table +='%s'%(cstr(d[0])) else: - ded_table +=''%(cstr(d[0]),cstr(d[1])) + ded_table +=''%(cstr(d[0]),cstr(d[1])) ded_table += '
%s0.00
0.00
%s%s
%s%s
' letter_head = sql("select value from `tabSingles` where field = 'letter_head' and doctype = 'Control Panel'") @@ -210,57 +210,58 @@ class DocType(TransactionBase): msg = '''
%s
- + - - + + - - - -

Salary Slip

Salary Slip

Employee Code : %sEmployee Name : %sEmployee Code : %sEmployee Name : %s
Month : %sFiscal Year : %s
- - - - - + + - - - + + + + + + + + + + - - + +
Department : %sBranch : %sDesignation : %sMonth : %sFiscal Year : %s
Grade : %sBank Account No. : %sBank Name : %sDepartment : %sBranch : %s
Designation : %sGrade : %s
Bank Account No. : %sBank Name : %s
Arrear Amount : %sPayment days : %sArrear Amount : %sPayment days : %s
- +
- - + + - - + +
EarningDeductionEarningsDeductions
%s%s%s%s
- +
- - + + - + Net Pay : + - + -
Gross Pay : %sTotal Deduction : %sGross Pay : %sTotal Deduction : %s
Net Pay : %s%s
Net Pay(in words) : %sNet Pay(in words) : %s
'''%(cstr(letter_head[0][0]),cstr(self.doc.employee), cstr(self.doc.employee_name), cstr(self.doc.month), cstr(self.doc.fiscal_year), cstr(self.doc.department), cstr(self.doc.branch), cstr(self.doc.designation), cstr(self.doc.grade), cstr(self.doc.bank_account_no), cstr(self.doc.bank_name), cstr(self.doc.arrear_amount), cstr(self.doc.payment_days), earn_table, ded_table, cstr(self.doc.gross_pay), cstr(self.doc.total_deduction), cstr(self.doc.net_pay), cstr(self.doc.total_in_words)) + '''%(cstr(letter_head[0][0]),cstr(self.doc.employee), cstr(self.doc.employee_name), cstr(self.doc.month), cstr(self.doc.fiscal_year), cstr(self.doc.department), cstr(self.doc.branch), cstr(self.doc.designation), cstr(self.doc.grade), cstr(self.doc.bank_account_no), cstr(self.doc.bank_name), cstr(self.doc.arrear_amount), cstr(self.doc.payment_days), earn_table, ded_table, cstr(flt(self.doc.gross_pay)), cstr(flt(self.doc.total_deduction)), cstr(flt(self.doc.net_pay)), cstr(self.doc.total_in_words)) sendmail([receiver], sender='automail@erpnext.com', subject=subj, parts=[['text/plain', msg]]) else: msgprint("Company Email ID not found.") From e91fa64e58c0874ae50e89933e027f9beec0aa45 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 5 Sep 2011 14:21:46 +0530 Subject: [PATCH 10/37] fixed error in receivable voucher (fetching pos warehosue) --- accounts/doctype/receivable_voucher/receivable_voucher.py | 1 + 1 file changed, 1 insertion(+) diff --git a/accounts/doctype/receivable_voucher/receivable_voucher.py b/accounts/doctype/receivable_voucher/receivable_voucher.py index 267ea9212f..f26374a382 100644 --- a/accounts/doctype/receivable_voucher/receivable_voucher.py +++ b/accounts/doctype/receivable_voucher/receivable_voucher.py @@ -580,6 +580,7 @@ class DocType(TransactionBase): # Get Warehouse def get_warehouse(self): w = sql("select warehouse from `tabPOS Setting` where ifnull(user,'') = '%s' and company = '%s'" % (session['user'], self.doc.company)) + w = w and w[0][0] or '' if not w: ps = sql("select name, warehouse from `tabPOS Setting` where ifnull(user,'') = '' and company = '%s'" % self.doc.company) if not ps: From f90f6739035472650fd304dad5fec2961ee70421 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 6 Sep 2011 15:25:19 +0530 Subject: [PATCH 11/37] validation logic changed in SO-RV mapper --- .../Sales Order-Receivable Voucher.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt b/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt index f1f77101b3..78431f574f 100644 --- a/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt +++ b/accounts/DocType Mapper/Sales Order-Receivable Voucher/Sales Order-Receivable Voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:36', 'docstatus': 0, - 'modified': '2011-08-08 16:56:40', + 'modified': '2011-08-31 16:53:11', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -31,7 +31,7 @@ # These values are common for all DocType Mapper { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'from_doctype': 'Sales Order', 'module': 'Accounts', 'name': '__common__', @@ -41,7 +41,7 @@ # DocType Mapper, Sales Order-Receivable Voucher { - 'doctype': 'DocType Mapper', + 'doctype': u'DocType Mapper', 'name': 'Sales Order-Receivable Voucher' }, @@ -128,7 +128,7 @@ 'match_id': 1, 'to_field': 'entries', 'to_table': 'RV Detail', - 'validation_logic': 'amount > ifnull(billed_amt, 0) and docstatus = 1' + 'validation_logic': 'docstatus = 1' }, # Table Mapper Detail From 8ccaed3e2d1bc13742f87d2e236b8105768d4675 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 7 Sep 2011 11:26:17 +0530 Subject: [PATCH 12/37] added feature setup to setup list --- setup/page/setup/setup.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/page/setup/setup.js b/setup/page/setup/setup.js index b29e7ad9e0..7c1245ad29 100644 --- a/setup/page/setup/setup.js +++ b/setup/page/setup/setup.js @@ -172,7 +172,8 @@ SetupData = function(cnty){ ['Property Setter',1,'Property Setter','', 'Customize properties of a Form (DocType) or Field'], ['Letter Head',1,'Letter Head','','Manage different letter heads for Prints'], ['SMS Settings',3,'SMS Settings','','Integrate your personalized SMS gateway which support http web service'], - ['SMS Center',3,'SMS Center','','Send mass sms to your leads, contacts and partners'] + ['SMS Center',3,'SMS Center','','Send mass sms to your leads, contacts and partners'], + ['Features Setup',3,'Features Setup','','Displays fields based on features selected'] ]}; From 8c572e1fb10cb4582743ff4b912c9f6548f1583b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 11:41:22 +0530 Subject: [PATCH 13/37] corrected spelling mistake in patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e815865e84..f550aa9b26 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -293,7 +293,7 @@ def execute(patch_no): elif patch_no == 353: reload_doc('hr', 'doctype', 'salary_manager') elif patch_no == 354: - reload_doc('setup', 'doctype','feature_setup') + reload_doc('setup', 'doctype','features_setup') reload_doc('stock','doctype','item') sql("update tabDocField set label='Produced Qty',description='Updated after finished goods are transferred to FG Warehouse through Stock Entry' where parent='Production Order' and fieldname='produced_qty'") rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null") From 69d15deb476a850556b8f1ed1b7c141f523b6cc2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:09:51 +0530 Subject: [PATCH 14/37] fixed sql syntax --- stock/doctype/delivery_note/delivery_note.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py index e5acd163a7..00711978a8 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/stock/doctype/delivery_note/delivery_note.py @@ -444,7 +444,7 @@ class DocType(TransactionBase): def update_pack_nett_weight(self): for d in getlist(self.doclist, 'delivery_note_details'): if d.item_name: - item_wt = sql("select nett_weight from `tabItem` where item_name = '%s'" % (d.item_name)) + item_wt = sql("select nett_weight from `tabItem` where item_name = %s", (d.item_name)) d.pack_nett_wt = item_wt and flt(item_wt[0][0])*flt(d.qty) or 0 # ========================================== From 9e79aa814a0affb9ab881a201f564c4efabd6ad4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:12:05 +0530 Subject: [PATCH 15/37] default_print_format added in doctype --- patches/patch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/patch.py b/patches/patch.py index f550aa9b26..906e039b0f 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 355 +last_patch = 356 #------------------------------------------- @@ -305,4 +305,6 @@ def execute(patch_no): elif patch_no == 355: reload_doc('hr', 'doctype', 'salary_slip') delete_doc('DocType', 'Salary Control Panel') - + elif patch_no == 356: + reload_doc('doctype', 'core', 'doctype') + sql("update `tabDocType` set default_print_format = 'Standard'") From 936dcd8d988a969595d0403dc8d8f2d312e82b76 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:34:57 +0530 Subject: [PATCH 16/37] delete redundant code fields from doctype --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 906e039b0f..9d6e731a9c 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 356 +last_patch = 357 #------------------------------------------- @@ -308,3 +308,5 @@ def execute(patch_no): elif patch_no == 356: reload_doc('doctype', 'core', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard'") + elif patch_no == 357: + sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") From 93fa876c7cbd23c37e98db088371c83ce0cf3d01 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 15:54:22 +0530 Subject: [PATCH 17/37] patch fixed --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 9d6e731a9c..e4b38d0f62 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -307,6 +307,6 @@ def execute(patch_no): delete_doc('DocType', 'Salary Control Panel') elif patch_no == 356: reload_doc('doctype', 'core', 'doctype') - sql("update `tabDocType` set default_print_format = 'Standard'") + sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") From 332d56db387db1aafe751e87b0e793f1ebaf9631 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:05:29 +0530 Subject: [PATCH 18/37] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e4b38d0f62..e5586f8bc8 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -306,7 +306,7 @@ def execute(patch_no): reload_doc('hr', 'doctype', 'salary_slip') delete_doc('DocType', 'Salary Control Panel') elif patch_no == 356: - reload_doc('doctype', 'core', 'doctype') + reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") From c6b506158b36aed51d479c1c45c419c54e9c4540 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:06:42 +0530 Subject: [PATCH 19/37] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e4b38d0f62..e5586f8bc8 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -306,7 +306,7 @@ def execute(patch_no): reload_doc('hr', 'doctype', 'salary_slip') delete_doc('DocType', 'Salary Control Panel') elif patch_no == 356: - reload_doc('doctype', 'core', 'doctype') + reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") From 1477f23b4c3e724a5a12fcab31eb8c8c01a2301e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:09:41 +0530 Subject: [PATCH 20/37] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e5586f8bc8..6ca01714f7 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -309,4 +309,4 @@ def execute(patch_no): reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: - sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") + sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") From 99c1edc86f1b9bb0a55373bf7437340270c29a5f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:10:25 +0530 Subject: [PATCH 21/37] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e5586f8bc8..6ca01714f7 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -309,4 +309,4 @@ def execute(patch_no): reload_doc('core', 'doctype', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: - sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") + sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") From 20551b6551183d6fe5b2653be16c881c5e5fbe3c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 16:59:58 +0530 Subject: [PATCH 22/37] fixed patch --- patches/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index e4b38d0f62..21d8e2a532 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -309,4 +309,4 @@ def execute(patch_no): reload_doc('doctype', 'core', 'doctype') sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: - sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', change_log) or label = 'Template') and parent = 'DocType'") + sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") From 11e895713e56a82c4d21c5cb9f89a633f60a7659 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 17:06:03 +0530 Subject: [PATCH 23/37] escape sequence in dn query --- stock/doctype/delivery_note/delivery_note.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py index 00711978a8..6d48914429 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/stock/doctype/delivery_note/delivery_note.py @@ -443,8 +443,8 @@ class DocType(TransactionBase): # ========================================== def update_pack_nett_weight(self): for d in getlist(self.doclist, 'delivery_note_details'): - if d.item_name: - item_wt = sql("select nett_weight from `tabItem` where item_name = %s", (d.item_name)) + if d.item_code: + item_wt = sql("select nett_weight from `tabItem` where name = %s", (d.item_code)) d.pack_nett_wt = item_wt and flt(item_wt[0][0])*flt(d.qty) or 0 # ========================================== From 9f1bd9e835e90d1659210ee3fe8f6083e31a681b Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 7 Sep 2011 17:18:35 +0530 Subject: [PATCH 24/37] Flat BOM Related modifications --- .../bill_of_materials/bill_of_materials.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/production/doctype/bill_of_materials/bill_of_materials.py b/production/doctype/bill_of_materials/bill_of_materials.py index d287d2f9d5..9727a63fa8 100644 --- a/production/doctype/bill_of_materials/bill_of_materials.py +++ b/production/doctype/bill_of_materials/bill_of_materials.py @@ -499,19 +499,19 @@ class DocType: def get_child_flat_bom_items(self, item, d): child_flat_bom_items=[] - if item and (item[0]['is_sub_contracted_item'] == 'Yes' or item[0]['is_pro_applicable'] == 'Yes'): +# if item and (item[0]['is_sub_contracted_item'] == 'Yes' or item[0]['is_pro_applicable'] == 'Yes'): - child_flat_bom_items = sql("select item_code, description, qty_consumed_per_unit, stock_uom, moving_avg_rate, last_purchase_rate, standard_rate, '%s' as parent_bom, bom_mat_no, 'No' as is_pro_applicable from `tabFlat BOM Detail` where parent = '%s' and is_pro_applicable = 'No' and docstatus = 1" % ( d.bom_no, cstr(d.bom_no))) - self.cur_flat_bom_items.append([d.item_code, d.description, flt(d.qty), d.stock_uom, flt(d.moving_avg_rate), flt(d.amount_as_per_mar), flt(d.last_purchase_rate), flt(d.amount_as_per_lpr), flt(d.standard_rate), flt(d.amount_as_per_sr), flt(d.qty_consumed_per_unit), (item[0]['is_sub_contracted_item'] == 'Yes') and d.parent or d.bom_no, d.name, (item[0]['is_sub_contracted_item'] == 'Yes') and 'No' or 'Yes']) + child_flat_bom_items = sql("select item_code, description, qty_consumed_per_unit, stock_uom, moving_avg_rate, last_purchase_rate, standard_rate, '%s' as parent_bom, bom_mat_no, 'No' as is_pro_applicable from `tabFlat BOM Detail` where parent = '%s' and is_pro_applicable = 'No' and docstatus = 1" % ( d.bom_no, cstr(d.bom_no))) + self.cur_flat_bom_items.append([d.item_code, d.description, flt(d.qty), d.stock_uom, flt(d.moving_avg_rate), flt(d.amount_as_per_mar), flt(d.last_purchase_rate), flt(d.amount_as_per_lpr), flt(d.standard_rate), flt(d.amount_as_per_sr), flt(d.qty_consumed_per_unit), (item[0]['is_sub_contracted_item'] == 'Yes') and d.parent or d.bom_no, d.name, (item[0]['is_sub_contracted_item'] == 'Yes') and 'No' or 'Yes']) + return child_flat_bom_items - else: - child_flat_bom_items = sql("select item_code, description, qty_consumed_per_unit, stock_uom, moving_avg_rate, last_purchase_rate, standard_rate, if(parent_bom = '%s', '%s', parent_bom) as parent_bom, bom_mat_no, is_pro_applicable from `tabFlat BOM Detail` where parent = '%s' and docstatus = 1" % ( d.bom_no, d.parent, cstr(d.bom_no))) +# else: +# child_flat_bom_items = sql("select item_code, description, qty_consumed_per_unit, stock_uom, moving_avg_rate, last_purchase_rate, standard_rate, if(parent_bom = '%s', '%s', parent_bom) as parent_bom, bom_mat_no, is_pro_applicable from `tabFlat BOM Detail` where parent = '%s' and docstatus = 1" % ( d.bom_no, d.parent, cstr(d.bom_no))) - if not child_flat_bom_items: - msgprint("Please Submit Child BOM := %s first." % cstr(d.bom_no)) - raise Exception - else: - return child_flat_bom_items +# if not child_flat_bom_items: +# msgprint("Please Submit Child BOM := %s first." % cstr(d.bom_no)) +# raise Exception +# else:""" # Get Current Flat BOM Items From 1dbd2cd7eb91691d863027d852a79ecfd33342c6 Mon Sep 17 00:00:00 2001 From: Brahma K Date: Wed, 7 Sep 2011 17:37:39 +0530 Subject: [PATCH 25/37] Delivery Note: Packing relate fields are hidden in print, PO No and PO Date moved up --- stock/doctype/delivery_note/delivery_note.txt | 174 ++++-------------- .../delivery_note_detail.txt | 78 +++----- 2 files changed, 61 insertions(+), 191 deletions(-) diff --git a/stock/doctype/delivery_note/delivery_note.txt b/stock/doctype/delivery_note/delivery_note.txt index 1ab19e070c..a3897ec17b 100644 --- a/stock/doctype/delivery_note/delivery_note.txt +++ b/stock/doctype/delivery_note/delivery_note.txt @@ -5,7 +5,7 @@ { 'creation': '2011-04-18 15:58:20', 'docstatus': 0, - 'modified': '2011-08-23 15:26:57', + 'modified': '2011-09-07 17:36:34', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -21,8 +21,9 @@ # These values are common for all DocType { - '_last_update': '1313665263', + '_last_update': '1314093417', 'colour': 'White:FFF', + 'default_print_format': 'Standard', 'doctype': 'DocType', 'document_type': 'Transaction', 'in_create': 0, @@ -36,7 +37,7 @@ 'show_in_menu': 0, 'subject': 'To %(customer_name)s on %(transaction_date)s | %(per_billed)s% billed', 'tag_fields': 'billing_status', - 'version': 449 + 'version': 450 }, # These values are common for all DocFormat @@ -71,7 +72,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 1, 'permlevel': 0, 'role': 'Material User', 'submit': 1, @@ -84,7 +84,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 2, 'permlevel': 0, 'role': 'Sales User', 'submit': 1, @@ -97,7 +96,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 3, 'permlevel': 0, 'role': 'Material Master Manager', 'submit': 1, @@ -110,7 +108,6 @@ 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', - 'idx': 4, 'permlevel': 0, 'role': 'Material Manager', 'submit': 1, @@ -120,7 +117,6 @@ # DocPerm { 'doctype': 'DocPerm', - 'idx': 5, 'permlevel': 1, 'role': 'All' }, @@ -128,21 +124,18 @@ # DocPerm { 'doctype': 'DocPerm', - 'idx': 6, 'permlevel': 2, 'role': 'All' }, # DocFormat { - 'doctype': 'DocFormat', - 'idx': 1 + 'doctype': 'DocFormat' }, # DocFormat { - 'doctype': 'DocFormat', - 'idx': 2 + 'doctype': 'DocFormat' }, # DocField @@ -150,7 +143,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 1, 'label': 'Basic Info', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -160,7 +152,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 2, 'oldfieldtype': 'Column Break', 'permlevel': 0, 'trigger': 'Client', @@ -174,7 +165,6 @@ 'doctype': 'DocField', 'fieldname': 'naming_series', 'fieldtype': 'Select', - 'idx': 3, 'label': 'Series', 'no_copy': 1, 'oldfieldname': 'naming_series', @@ -190,7 +180,6 @@ 'doctype': 'DocField', 'fieldname': 'customer', 'fieldtype': 'Link', - 'idx': 4, 'in_filter': 1, 'label': 'Customer', 'oldfieldname': 'customer', @@ -208,7 +197,6 @@ 'doctype': 'DocField', 'fieldname': 'customer_address', 'fieldtype': 'Link', - 'idx': 5, 'in_filter': 1, 'label': 'Shipping Address', 'options': 'Address', @@ -221,7 +209,6 @@ 'doctype': 'DocField', 'fieldname': 'contact_person', 'fieldtype': 'Link', - 'idx': 6, 'in_filter': 1, 'label': 'Contact Person', 'options': 'Contact', @@ -234,7 +221,6 @@ 'doctype': 'DocField', 'fieldname': 'customer_name', 'fieldtype': 'Data', - 'idx': 7, 'label': 'Customer Name', 'permlevel': 1 }, @@ -244,7 +230,6 @@ 'doctype': 'DocField', 'fieldname': 'address_display', 'fieldtype': 'Small Text', - 'idx': 8, 'label': 'Shipping Address', 'permlevel': 1 }, @@ -254,7 +239,6 @@ 'doctype': 'DocField', 'fieldname': 'contact_display', 'fieldtype': 'Small Text', - 'idx': 9, 'label': 'Contact', 'permlevel': 1 }, @@ -264,7 +248,6 @@ 'doctype': 'DocField', 'fieldname': 'contact_mobile', 'fieldtype': 'Text', - 'idx': 10, 'label': 'Mobile No', 'permlevel': 1 }, @@ -274,7 +257,6 @@ 'doctype': 'DocField', 'fieldname': 'contact_email', 'fieldtype': 'Text', - 'idx': 11, 'label': 'Contact Email', 'permlevel': 1, 'print_hide': 1 @@ -284,7 +266,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 12, 'oldfieldtype': 'Column Break', 'permlevel': 0 }, @@ -297,7 +278,6 @@ 'doctype': 'DocField', 'fieldname': 'transaction_date', 'fieldtype': 'Date', - 'idx': 13, 'in_filter': 1, 'label': 'Voucher Date', 'no_copy': 1, @@ -316,7 +296,6 @@ 'doctype': 'DocField', 'fieldname': 'status', 'fieldtype': 'Select', - 'idx': 14, 'in_filter': 1, 'label': 'Status', 'no_copy': 1, @@ -338,7 +317,6 @@ 'doctype': 'DocField', 'fieldname': 'per_billed', 'fieldtype': 'Currency', - 'idx': 15, 'in_filter': 1, 'label': '% Amount Billed', 'no_copy': 1, @@ -357,7 +335,6 @@ 'doctype': 'DocField', 'fieldname': 'per_installed', 'fieldtype': 'Currency', - 'idx': 16, 'in_filter': 1, 'label': '% Installed', 'no_copy': 1, @@ -368,13 +345,42 @@ 'search_index': 1 }, + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'po_no', + 'fieldtype': 'Data', + 'hidden': 1, + 'label': 'P.O. No', + 'no_copy': 0, + 'oldfieldname': 'po_no', + 'oldfieldtype': 'Data', + 'permlevel': 1, + 'print_hide': 1, + 'width': '100px' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'po_date', + 'fieldtype': 'Data', + 'hidden': 1, + 'label': 'P.O. Date', + 'no_copy': 0, + 'oldfieldname': 'po_date', + 'oldfieldtype': 'Data', + 'permlevel': 1, + 'print_hide': 1, + 'width': '100px' + }, + # DocField { 'allow_on_submit': 0, 'doctype': 'DocField', 'fieldname': 'amended_from', 'fieldtype': 'Data', - 'idx': 17, 'label': 'Amended From', 'no_copy': 1, 'oldfieldname': 'amended_from', @@ -390,7 +396,6 @@ 'doctype': 'DocField', 'fieldname': 'amendment_date', 'fieldtype': 'Date', - 'idx': 18, 'label': 'Amendment Date', 'no_copy': 1, 'oldfieldname': 'amendment_date', @@ -406,7 +411,6 @@ 'fieldname': 'territory', 'fieldtype': 'Link', 'hidden': 0, - 'idx': 19, 'in_filter': 1, 'label': 'Territory', 'options': 'Territory', @@ -421,7 +425,6 @@ 'doctype': 'DocField', 'fieldname': 'customer_group', 'fieldtype': 'Link', - 'idx': 20, 'in_filter': 1, 'label': 'Customer Group', 'options': 'Customer Group', @@ -434,7 +437,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 21, 'label': 'Transporter Info', 'permlevel': 0 }, @@ -445,7 +447,6 @@ 'doctype': 'DocField', 'fieldname': 'transporter_name', 'fieldtype': 'Data', - 'idx': 22, 'label': 'Transporter Name', 'no_copy': 0, 'oldfieldname': 'transporter_name', @@ -464,7 +465,6 @@ 'doctype': 'DocField', 'fieldname': 'lr_no', 'fieldtype': 'Data', - 'idx': 23, 'label': 'LR No', 'no_copy': 0, 'oldfieldname': 'lr_no', @@ -483,7 +483,6 @@ 'doctype': 'DocField', 'fieldname': 'lr_date', 'fieldtype': 'Date', - 'idx': 24, 'label': 'LR Date', 'no_copy': 0, 'oldfieldname': 'lr_date', @@ -497,7 +496,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 25, 'permlevel': 0, 'width': '50%' }, @@ -507,7 +505,6 @@ 'doctype': 'DocField', 'fieldname': 'challan_no', 'fieldtype': 'Data', - 'idx': 26, 'label': 'Challan No', 'oldfieldname': 'challan_no', 'oldfieldtype': 'Data', @@ -519,7 +516,6 @@ 'doctype': 'DocField', 'fieldname': 'challan_date', 'fieldtype': 'Date', - 'idx': 27, 'label': 'Challan Date', 'oldfieldname': 'challan_date', 'oldfieldtype': 'Date', @@ -531,7 +527,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 28, 'label': 'Items', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -544,7 +539,6 @@ 'doctype': 'DocField', 'fieldname': 'sales_order_no', 'fieldtype': 'Link', - 'idx': 29, 'label': 'Sales Order No', 'no_copy': 0, 'oldfieldname': 'sales_order_no', @@ -559,7 +553,6 @@ 'doctype': 'DocField', 'fieldtype': 'Button', 'hidden': 0, - 'idx': 30, 'label': 'Get Items', 'oldfieldtype': 'Button', 'options': 'pull_sales_order_details', @@ -574,7 +567,6 @@ 'doctype': 'DocField', 'fieldname': 'price_list_name', 'fieldtype': 'Select', - 'idx': 31, 'label': 'Price List', 'oldfieldname': 'price_list_name', 'oldfieldtype': 'Select', @@ -589,7 +581,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 32, 'permlevel': 0, 'width': '50%' }, @@ -601,7 +592,6 @@ 'doctype': 'DocField', 'fieldname': 'currency', 'fieldtype': 'Select', - 'idx': 33, 'label': 'Currency', 'oldfieldname': 'currency', 'oldfieldtype': 'Select', @@ -619,7 +609,6 @@ 'doctype': 'DocField', 'fieldname': 'conversion_rate', 'fieldtype': 'Currency', - 'idx': 34, 'label': 'Conversion Rate', 'no_copy': 0, 'oldfieldname': 'conversion_rate', @@ -633,7 +622,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 35, 'permlevel': 0 }, @@ -642,7 +630,6 @@ 'doctype': 'DocField', 'fieldname': 'delivery_note_details', 'fieldtype': 'Table', - 'idx': 36, 'label': 'Delivery Note Details', 'no_copy': 0, 'oldfieldname': 'delivery_note_details', @@ -657,7 +644,6 @@ 'doctype': 'DocField', 'fieldname': 'net_total', 'fieldtype': 'Currency', - 'idx': 37, 'label': 'Net Total*', 'no_copy': 0, 'oldfieldname': 'net_total', @@ -672,7 +658,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 38, 'label': 'Re-Calculate Values', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -683,7 +668,6 @@ { 'doctype': 'DocField', 'fieldtype': 'HTML', - 'idx': 39, 'label': 'Note', 'oldfieldtype': 'HTML', 'options': 'NOTE :* In Base Currency', @@ -696,7 +680,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 40, 'label': 'Taxes', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -709,7 +692,6 @@ 'doctype': 'DocField', 'fieldname': 'charge', 'fieldtype': 'Link', - 'idx': 41, 'label': 'Charge', 'oldfieldname': 'charge', 'oldfieldtype': 'Link', @@ -722,7 +704,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 42, 'label': 'Get Charges', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -735,7 +716,6 @@ 'doctype': 'DocField', 'fieldname': 'other_charges', 'fieldtype': 'Table', - 'idx': 43, 'label': 'Other Charges', 'no_copy': 0, 'oldfieldname': 'other_charges', @@ -749,7 +729,6 @@ 'doctype': 'DocField', 'fieldname': 'other_charges_total', 'fieldtype': 'Currency', - 'idx': 44, 'label': 'Charges Total', 'oldfieldname': 'other_charges_total', 'oldfieldtype': 'Currency', @@ -762,7 +741,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 45, 'label': 'Calculate Charges', 'oldfieldtype': 'Button', 'permlevel': 0, @@ -774,7 +752,6 @@ { 'doctype': 'DocField', 'fieldtype': 'HTML', - 'idx': 46, 'label': 'Other Charges Calculation', 'oldfieldtype': 'HTML', 'permlevel': 0 @@ -785,7 +762,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 47, 'label': 'Totals', 'oldfieldtype': 'Section Break', 'permlevel': 0, @@ -797,7 +773,6 @@ 'doctype': 'DocField', 'fieldname': 'grand_total', 'fieldtype': 'Currency', - 'idx': 48, 'label': 'Grand Total', 'no_copy': 0, 'oldfieldname': 'grand_total', @@ -813,7 +788,6 @@ 'doctype': 'DocField', 'fieldname': 'rounded_total', 'fieldtype': 'Currency', - 'idx': 49, 'label': 'Rounded Total', 'no_copy': 0, 'oldfieldname': 'rounded_total', @@ -830,7 +804,6 @@ 'doctype': 'DocField', 'fieldname': 'in_words', 'fieldtype': 'Data', - 'idx': 50, 'label': 'In Words', 'no_copy': 0, 'oldfieldname': 'in_words', @@ -844,7 +817,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 51, 'oldfieldtype': 'Column Break', 'permlevel': 0 }, @@ -854,7 +826,6 @@ 'doctype': 'DocField', 'fieldname': 'grand_total_export', 'fieldtype': 'Currency', - 'idx': 52, 'label': 'Grand Total (Export)', 'no_copy': 0, 'oldfieldname': 'grand_total_export', @@ -870,7 +841,6 @@ 'doctype': 'DocField', 'fieldname': 'rounded_total_export', 'fieldtype': 'Currency', - 'idx': 53, 'label': 'Rounded Total (Export)', 'no_copy': 0, 'oldfieldname': 'rounded_total_export', @@ -887,7 +857,6 @@ 'doctype': 'DocField', 'fieldname': 'in_words_export', 'fieldtype': 'Data', - 'idx': 54, 'label': 'In Words (Export)', 'no_copy': 0, 'oldfieldname': 'in_words_export', @@ -901,7 +870,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 55, 'label': 'Terms', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -912,7 +880,6 @@ 'doctype': 'DocField', 'fieldname': 'tc_name', 'fieldtype': 'Link', - 'idx': 56, 'label': 'Select Terms', 'oldfieldname': 'tc_name', 'oldfieldtype': 'Link', @@ -926,7 +893,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 57, 'label': 'Get Terms', 'oldfieldtype': 'Button', 'options': 'get_tc_details', @@ -939,7 +905,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'HTML', - 'idx': 58, 'label': 'Terms HTML', 'oldfieldtype': 'HTML', 'options': 'You can add Terms and Notes that will be printed in the Transaction', @@ -953,7 +918,6 @@ 'doctype': 'DocField', 'fieldname': 'terms', 'fieldtype': 'Text Editor', - 'idx': 59, 'label': 'Term Details', 'oldfieldname': 'terms', 'oldfieldtype': 'Text Editor', @@ -966,7 +930,6 @@ 'description': 'Filling in Additional Information about the Delivery Note will help you analyze your data better.', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 60, 'label': 'More Info', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -979,7 +942,6 @@ 'doctype': 'DocField', 'fieldname': 'company', 'fieldtype': 'Link', - 'idx': 61, 'in_filter': 1, 'label': 'Company', 'oldfieldname': 'company', @@ -997,7 +959,6 @@ 'doctype': 'DocField', 'fieldname': 'fiscal_year', 'fieldtype': 'Select', - 'idx': 62, 'in_filter': 1, 'label': 'Fiscal Year', 'oldfieldname': 'fiscal_year', @@ -1018,7 +979,6 @@ 'doctype': 'DocField', 'fieldname': 'posting_date', 'fieldtype': 'Date', - 'idx': 63, 'in_filter': 1, 'label': 'Posting Date', 'no_copy': 1, @@ -1038,7 +998,6 @@ 'doctype': 'DocField', 'fieldname': 'posting_time', 'fieldtype': 'Time', - 'idx': 64, 'in_filter': 0, 'label': 'Posting Time', 'oldfieldname': 'posting_time', @@ -1057,7 +1016,6 @@ 'doctype': 'DocField', 'fieldname': 'project_name', 'fieldtype': 'Link', - 'idx': 65, 'in_filter': 1, 'label': 'Project Name', 'oldfieldname': 'project_name', @@ -1076,7 +1034,6 @@ 'fieldname': 'to_warehouse', 'fieldtype': 'Link', 'hidden': 0, - 'idx': 66, 'label': 'To Warehouse', 'no_copy': 1, 'oldfieldname': 'to_warehouse', @@ -1090,7 +1047,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 67, 'oldfieldtype': 'Column Break', 'permlevel': 0, 'width': '50%' @@ -1102,7 +1058,6 @@ 'fieldname': 'billing_status', 'fieldtype': 'Select', 'hidden': 1, - 'idx': 68, 'label': 'Billing Status', 'no_copy': 1, 'options': '\nNot Billed\nPartly Billed\nFully Billed', @@ -1116,51 +1071,17 @@ 'fieldname': 'installation_status', 'fieldtype': 'Select', 'hidden': 1, - 'idx': 69, 'label': 'Installation Status', 'permlevel': 0, 'print_hide': 1 }, - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'po_no', - 'fieldtype': 'Data', - 'hidden': 1, - 'idx': 70, - 'label': 'P.O. No', - 'no_copy': 0, - 'oldfieldname': 'po_no', - 'oldfieldtype': 'Data', - 'permlevel': 1, - 'print_hide': 1, - 'width': '100px' - }, - - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'po_date', - 'fieldtype': 'Data', - 'hidden': 1, - 'idx': 71, - 'label': 'P.O. Date', - 'no_copy': 0, - 'oldfieldname': 'po_date', - 'oldfieldtype': 'Data', - 'permlevel': 1, - 'print_hide': 1, - 'width': '100px' - }, - # DocField { 'allow_on_submit': 1, 'doctype': 'DocField', 'fieldname': 'letter_head', 'fieldtype': 'Select', - 'idx': 72, 'label': 'Letter Head', 'oldfieldname': 'letter_head', 'oldfieldtype': 'Link', @@ -1174,7 +1095,6 @@ 'doctype': 'DocField', 'fieldname': 'source', 'fieldtype': 'Select', - 'idx': 73, 'label': 'Source', 'oldfieldname': 'source', 'oldfieldtype': 'Select', @@ -1190,7 +1110,6 @@ 'doctype': 'DocField', 'fieldname': 'campaign', 'fieldtype': 'Link', - 'idx': 74, 'label': 'Campaign', 'oldfieldname': 'campaign', 'oldfieldtype': 'Link', @@ -1206,7 +1125,6 @@ 'doctype': 'DocField', 'fieldname': 'select_print_heading', 'fieldtype': 'Link', - 'idx': 75, 'label': 'Select Print Heading', 'no_copy': 1, 'oldfieldname': 'select_print_heading', @@ -1224,7 +1142,6 @@ 'doctype': 'DocField', 'fieldname': 'print_without_amount', 'fieldtype': 'Check', - 'idx': 76, 'label': 'Print Without Amount', 'oldfieldname': 'print_without_amount', 'oldfieldtype': 'Check', @@ -1238,7 +1155,6 @@ 'doctype': 'DocField', 'fieldname': 'instructions', 'fieldtype': 'Text', - 'idx': 77, 'label': 'Instructions', 'oldfieldname': 'instructions', 'oldfieldtype': 'Text', @@ -1253,7 +1169,6 @@ 'fieldname': 'cancel_reason', 'fieldtype': 'Data', 'hidden': 0, - 'idx': 78, 'label': 'Cancel Reason', 'no_copy': 1, 'oldfieldname': 'cancel_reason', @@ -1269,7 +1184,6 @@ 'fieldname': 'excise_page', 'fieldtype': 'Data', 'hidden': 1, - 'idx': 79, 'label': 'Excise Page Number', 'oldfieldname': 'excise_page', 'oldfieldtype': 'Data', @@ -1282,7 +1196,6 @@ 'colour': 'White:FFF', 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 80, 'label': 'Sales Team', 'oldfieldtype': 'Section Break', 'permlevel': 0, @@ -1293,7 +1206,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 81, 'permlevel': 0, 'width': '50%' }, @@ -1303,7 +1215,6 @@ 'doctype': 'DocField', 'fieldname': 'sales_partner', 'fieldtype': 'Link', - 'idx': 82, 'label': 'Sales Partner', 'no_copy': 0, 'oldfieldname': 'sales_partner', @@ -1320,7 +1231,6 @@ 'doctype': 'DocField', 'fieldname': 'commission_rate', 'fieldtype': 'Currency', - 'idx': 83, 'label': 'Commission Rate (%)', 'no_copy': 0, 'oldfieldname': 'commission_rate', @@ -1337,7 +1247,6 @@ 'doctype': 'DocField', 'fieldname': 'total_commission', 'fieldtype': 'Currency', - 'idx': 84, 'label': 'Total Commission', 'no_copy': 0, 'oldfieldname': 'total_commission', @@ -1351,7 +1260,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Column Break', - 'idx': 85, 'permlevel': 0, 'width': '50%' }, @@ -1361,7 +1269,6 @@ 'doctype': 'DocField', 'fieldname': 'sales_team', 'fieldtype': 'Table', - 'idx': 86, 'label': 'Sales Team1', 'oldfieldname': 'sales_team', 'oldfieldtype': 'Table', @@ -1375,7 +1282,6 @@ 'doctype': 'DocField', 'fieldtype': 'Section Break', 'hidden': 1, - 'idx': 87, 'label': 'Supplier Details', 'oldfieldtype': 'Section Break', 'options': 'Simple', @@ -1388,7 +1294,6 @@ 'fieldname': 'supplier', 'fieldtype': 'Link', 'hidden': 1, - 'idx': 88, 'label': 'Supplier', 'oldfieldname': 'supplier', 'oldfieldtype': 'Link', @@ -1403,7 +1308,6 @@ 'fieldname': 'supplier_address', 'fieldtype': 'Text', 'hidden': 1, - 'idx': 89, 'label': 'Supplier Address', 'oldfieldname': 'supplier_address', 'oldfieldtype': 'Text', @@ -1418,7 +1322,6 @@ 'fieldname': 'purchase_receipt_no', 'fieldtype': 'Link', 'hidden': 1, - 'idx': 90, 'label': 'Purchase Receipt No', 'no_copy': 1, 'oldfieldname': 'purchase_receipt_no', @@ -1435,7 +1338,6 @@ 'fieldname': 'purchase_order_no', 'fieldtype': 'Link', 'hidden': 1, - 'idx': 91, 'label': 'Purchase Order', 'no_copy': 1, 'oldfieldname': 'purchase_order_no', @@ -1449,7 +1351,6 @@ { 'doctype': 'DocField', 'fieldtype': 'Section Break', - 'idx': 92, 'label': 'Packing List', 'oldfieldtype': 'Section Break', 'permlevel': 0 @@ -1460,7 +1361,6 @@ 'doctype': 'DocField', 'fieldname': 'packing_details', 'fieldtype': 'Table', - 'idx': 93, 'label': 'Packing Details', 'oldfieldname': 'packing_details', 'oldfieldtype': 'Table', @@ -1474,7 +1374,6 @@ 'allow_on_submit': 1, 'doctype': 'DocField', 'fieldtype': 'Button', - 'idx': 94, 'label': 'Repair Delivery Note', 'oldfieldtype': 'Button', 'options': 'repair_delivery_note', @@ -1488,7 +1387,6 @@ 'fieldname': 'print_packing_slip', 'fieldtype': 'Text', 'hidden': 1, - 'idx': 95, 'in_filter': 0, 'label': 'Print Packing Slip', 'permlevel': 0, diff --git a/stock/doctype/delivery_note_detail/delivery_note_detail.txt b/stock/doctype/delivery_note_detail/delivery_note_detail.txt index a8fea209c4..be7b98f771 100644 --- a/stock/doctype/delivery_note_detail/delivery_note_detail.txt +++ b/stock/doctype/delivery_note_detail/delivery_note_detail.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:08:58', 'docstatus': 0, - 'modified': '2011-08-22 12:11:51', + 'modified': '2011-09-07 17:34:13', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -21,7 +21,7 @@ 'section_style': 'Tray', 'server_code_error': ' ', 'show_in_menu': 0, - 'version': 38 + 'version': 40 }, # These values are common for all DocField @@ -44,7 +44,6 @@ 'doctype': 'DocField', 'fieldname': 'item_code', 'fieldtype': 'Link', - 'idx': 1, 'in_filter': 1, 'label': 'Item Code', 'oldfieldname': 'item_code', @@ -63,7 +62,6 @@ 'doctype': 'DocField', 'fieldname': 'item_name', 'fieldtype': 'Data', - 'idx': 2, 'label': 'Item Name', 'oldfieldname': 'item_name', 'oldfieldtype': 'Data', @@ -78,7 +76,6 @@ 'doctype': 'DocField', 'fieldname': 'description', 'fieldtype': 'Small Text', - 'idx': 3, 'label': 'Description', 'oldfieldname': 'description', 'oldfieldtype': 'Small Text', @@ -87,12 +84,26 @@ 'width': '300px' }, + # DocField + { + 'default': '0.00', + 'doctype': 'DocField', + 'fieldname': 'qty', + 'fieldtype': 'Currency', + 'label': 'Quantity', + 'oldfieldname': 'qty', + 'oldfieldtype': 'Currency', + 'permlevel': 0, + 'reqd': 1, + 'trigger': 'Client', + 'width': '100px' + }, + # DocField { 'doctype': 'DocField', 'fieldname': 'stock_uom', 'fieldtype': 'Data', - 'idx': 4, 'label': 'UOM', 'oldfieldname': 'stock_uom', 'oldfieldtype': 'Data', @@ -102,29 +113,12 @@ 'width': '50px' }, - # DocField - { - 'default': '0.00', - 'doctype': 'DocField', - 'fieldname': 'qty', - 'fieldtype': 'Currency', - 'idx': 5, - 'label': 'Quantity', - 'oldfieldname': 'qty', - 'oldfieldtype': 'Currency', - 'permlevel': 0, - 'reqd': 1, - 'trigger': 'Client', - 'width': '100px' - }, - # DocField { 'default': '0.00', 'doctype': 'DocField', 'fieldname': 'ref_rate', 'fieldtype': 'Currency', - 'idx': 6, 'label': 'Ref Rate', 'no_copy': 0, 'oldfieldname': 'ref_rate', @@ -142,7 +136,6 @@ 'doctype': 'DocField', 'fieldname': 'adj_rate', 'fieldtype': 'Float', - 'idx': 7, 'label': 'Discount (%)', 'oldfieldname': 'adj_rate', 'oldfieldtype': 'Float', @@ -157,7 +150,6 @@ 'doctype': 'DocField', 'fieldname': 'export_rate', 'fieldtype': 'Currency', - 'idx': 8, 'label': 'Rate', 'oldfieldname': 'export_rate', 'oldfieldtype': 'Currency', @@ -173,7 +165,6 @@ 'doctype': 'DocField', 'fieldname': 'export_amount', 'fieldtype': 'Currency', - 'idx': 9, 'label': 'Amount', 'oldfieldname': 'export_amount', 'oldfieldtype': 'Currency', @@ -188,7 +179,6 @@ 'doctype': 'DocField', 'fieldname': 'base_ref_rate', 'fieldtype': 'Currency', - 'idx': 10, 'label': 'Ref Rate*', 'oldfieldname': 'base_ref_rate', 'oldfieldtype': 'Currency', @@ -203,7 +193,6 @@ 'doctype': 'DocField', 'fieldname': 'basic_rate', 'fieldtype': 'Currency', - 'idx': 11, 'label': 'Rate*', 'oldfieldname': 'basic_rate', 'oldfieldtype': 'Currency', @@ -219,7 +208,6 @@ 'doctype': 'DocField', 'fieldname': 'amount', 'fieldtype': 'Currency', - 'idx': 12, 'label': 'Amount*', 'oldfieldname': 'amount', 'oldfieldtype': 'Currency', @@ -234,7 +222,6 @@ 'doctype': 'DocField', 'fieldname': 'warehouse', 'fieldtype': 'Link', - 'idx': 13, 'label': 'Warehouse', 'oldfieldname': 'warehouse', 'oldfieldtype': 'Link', @@ -250,7 +237,6 @@ 'doctype': 'DocField', 'fieldname': 'serial_no', 'fieldtype': 'Text', - 'idx': 14, 'in_filter': 1, 'label': 'Serial No', 'no_copy': 1, @@ -266,7 +252,6 @@ 'doctype': 'DocField', 'fieldname': 'batch_no', 'fieldtype': 'Link', - 'idx': 15, 'label': 'Batch No', 'oldfieldname': 'batch_no', 'oldfieldtype': 'Link', @@ -280,7 +265,6 @@ 'doctype': 'DocField', 'fieldname': 'item_group', 'fieldtype': 'Link', - 'idx': 16, 'label': 'Item Group', 'oldfieldname': 'item_group', 'oldfieldtype': 'Link', @@ -294,7 +278,6 @@ 'doctype': 'DocField', 'fieldname': 'brand', 'fieldtype': 'Link', - 'idx': 17, 'label': 'Brand Name', 'oldfieldname': 'brand', 'oldfieldtype': 'Link', @@ -309,9 +292,9 @@ 'doctype': 'DocField', 'fieldname': 'pack_no', 'fieldtype': 'Data', - 'idx': 18, 'label': 'Pack No', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -319,9 +302,9 @@ 'doctype': 'DocField', 'fieldname': 'pack_gross_wt', 'fieldtype': 'Float', - 'idx': 19, 'label': 'Pack Gross Wt', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -329,10 +312,10 @@ 'doctype': 'DocField', 'fieldname': 'weight_uom', 'fieldtype': 'Link', - 'idx': 20, 'label': 'Weight UOM', 'options': 'UOM', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -340,9 +323,9 @@ 'doctype': 'DocField', 'fieldname': 'pack_nett_wt', 'fieldtype': 'Float', - 'idx': 21, 'label': 'Pack Nett Wt', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -350,7 +333,6 @@ 'doctype': 'DocField', 'fieldname': 'no_of_packs', 'fieldtype': 'Int', - 'idx': 22, 'label': 'No of Packs', 'oldfieldname': 'no_of_packs', 'oldfieldtype': 'Int', @@ -364,7 +346,6 @@ 'doctype': 'DocField', 'fieldname': 'pack_unit', 'fieldtype': 'Data', - 'idx': 23, 'label': 'Pack Unit', 'oldfieldname': 'pack_unit', 'oldfieldtype': 'Data', @@ -378,7 +359,6 @@ 'doctype': 'DocField', 'fieldname': 'installed_qty', 'fieldtype': 'Currency', - 'idx': 24, 'label': 'Installed Qty', 'no_copy': 1, 'oldfieldname': 'installed_qty', @@ -393,7 +373,6 @@ 'doctype': 'DocField', 'fieldname': 'actual_qty', 'fieldtype': 'Currency', - 'idx': 25, 'label': 'Available Qty at Warehouse', 'no_copy': 1, 'oldfieldname': 'actual_qty', @@ -408,7 +387,6 @@ 'doctype': 'DocField', 'fieldname': 'billed_amt', 'fieldtype': 'Currency', - 'idx': 26, 'label': 'Billed Amt', 'no_copy': 1, 'permlevel': 1, @@ -423,7 +401,6 @@ 'fieldname': 'prevdoc_docname', 'fieldtype': 'Data', 'hidden': 0, - 'idx': 27, 'in_filter': 1, 'label': 'Against Document No', 'no_copy': 1, @@ -441,7 +418,6 @@ 'fieldname': 'prevdoc_doctype', 'fieldtype': 'Data', 'hidden': 1, - 'idx': 28, 'in_filter': 1, 'label': 'Document Type', 'oldfieldname': 'prevdoc_doctype', @@ -458,7 +434,6 @@ 'fieldname': 'prevdoc_date', 'fieldtype': 'Date', 'hidden': 1, - 'idx': 29, 'in_filter': 1, 'label': 'Against Document Date', 'oldfieldname': 'prevdoc_date', @@ -473,7 +448,6 @@ 'fieldname': 'prevdoc_detail_docname', 'fieldtype': 'Data', 'hidden': 1, - 'idx': 30, 'in_filter': 1, 'label': 'Against Document Detail No', 'oldfieldname': 'prevdoc_detail_docname', @@ -490,7 +464,6 @@ 'fieldname': 'item_tax_rate', 'fieldtype': 'Small Text', 'hidden': 1, - 'idx': 31, 'label': 'Item Tax Rate', 'oldfieldname': 'item_tax_rate', 'oldfieldtype': 'Small Text', @@ -504,7 +477,6 @@ 'doctype': 'DocField', 'fieldname': 'page_break', 'fieldtype': 'Check', - 'idx': 32, 'label': 'Page Break', 'oldfieldname': 'page_break', 'oldfieldtype': 'Check', From 99f27cbdc4f30ef210c5a76f000707ef7d5afa4d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 17:42:05 +0530 Subject: [PATCH 26/37] reload delivery note and dn detail --- patches/patch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 6ca01714f7..f2748196f5 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 357 +last_patch = 358 #------------------------------------------- @@ -310,3 +310,6 @@ def execute(patch_no): sql("update `tabDocType` set default_print_format = 'Standard' where name = 'Delivery Note'") elif patch_no == 357: sql("delete from `tabDocField` where (fieldname in ('client_string', 'server_code_error', 'server_code_compiled', 'server_code', 'server_code_core', 'client_script', 'client_script_core', 'dt_template', 'change_log') or label = 'Template') and parent = 'DocType'") + elif patch_no == 358: + reload_doc('stock', 'doctype', 'delivery_note') + reload_doc('stock', 'doctype', 'delivery_note_detail') From 3fe30954f2de9cad9b72018b3ae795cff3a42702 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2011 19:26:12 +0530 Subject: [PATCH 27/37] on rename of company set company default_value --- setup/doctype/company/company.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/doctype/company/company.py b/setup/doctype/company/company.py index 783a158588..a2e333d41c 100644 --- a/setup/doctype/company/company.py +++ b/setup/doctype/company/company.py @@ -248,4 +248,7 @@ class DocType: # on rename # --------- def on_rename(self,newdn,olddn): - sql("update `tabCompany` set company_name = '%s' where name = '%s'" %(newdn,olddn)) + sql("update `tabCompany` set company_name = '%s' where name = '%s'" %(newdn,olddn)) + sql("update `tabSingles` set value = %s where doctype='Manage Account' and field = 'default_company' and value = %s", (newdn, olddn)) + if get_defaults('company') == olddn: + set_default('company', newdn) From 94afaa8697a1f69fd11afdc497c547a821991e9e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 11:37:50 +0530 Subject: [PATCH 28/37] removed single quote from sql query --- .../authorization_control.py | 332 +++++++++--------- 1 file changed, 165 insertions(+), 167 deletions(-) diff --git a/setup/doctype/authorization_control/authorization_control.py b/setup/doctype/authorization_control/authorization_control.py index 4036ecf594..cce90422e1 100644 --- a/setup/doctype/authorization_control/authorization_control.py +++ b/setup/doctype/authorization_control/authorization_control.py @@ -18,179 +18,177 @@ convert_to_lists = webnotes.conn.convert_to_lists from utilities.transaction_base import TransactionBase class DocType(TransactionBase): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl + def __init__(self, d, dl): + self.doc, self.doclist = d, dl - # Get Names of all Approving Users and Roles - # ------------------------------------------- - def get_appr_user_role(self, det, doctype_name, total, based_on, condition, item, company): - amt_list, appr_users, appr_roles = [], [], [] - users, roles = '','' - if det: - for x in det: - amt_list.append(flt(x[0])) - max_amount = max(amt_list) - - app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = '%s' and (value = '%s' or value > '%s') and docstatus != 2 and based_on = '%s' and company = '%s' %s" % (doctype_name, flt(max_amount), total, based_on, company, condition)) - if not app_dtl: - app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = '%s' and (value = '%s' or value > '%s') and docstatus != 2 and based_on = '%s' and ifnull(company,'') = '' %s" % (doctype_name, flt(max_amount), total, based_on, condition)) - for d in app_dtl: - if(d[0]): appr_users.append(d[0]) - if(d[1]): appr_roles.append(d[1]) - - if not has_common(appr_roles, webnotes.user.get_roles()) and not has_common(appr_users, session['user']): - msg, add_msg = '','' - if max_amount: - dcc = TransactionBase().get_company_currency(self.doc.company) - if based_on == 'Grand Total': msg = "since Grand Total exceeds %s. %s" % (dcc, flt(max_amount)) - elif based_on == 'Itemwise Discount': msg = "since Discount exceeds %s for Item Code : %s" % (cstr(max_amount)+'%', item) - elif based_on == 'Average Discount' or based_on == 'Customerwise Discount': msg = "since Discount exceeds %s" % (cstr(max_amount)+'%') - - if appr_users: add_msg = "Users : "+cstr(appr_users) - if appr_roles: add_msg = "Roles : "+cstr(appr_roles) - if appr_users and appr_roles: add_msg = "Users : "+cstr(appr_users)+" or "+"Roles : "+cstr(appr_roles) - msgprint("You do not have an authority to submit this %s %s. Please send for approval to %s" % (doctype_name, msg, add_msg)) - raise Exception + # Get Names of all Approving Users and Roles + # ------------------------------------------- + def get_appr_user_role(self, det, doctype_name, total, based_on, condition, item, company): + amt_list, appr_users, appr_roles = [], [], [] + users, roles = '','' + if det: + for x in det: + amt_list.append(flt(x[0])) + max_amount = max(amt_list) + + app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and company = %s %s", (doctype_name, flt(max_amount), total, based_on, company, condition)) + if not app_dtl: + app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and ifnull(company,'') = '' %s", (doctype_name, flt(max_amount), total, based_on, condition)) + for d in app_dtl: + if(d[0]): appr_users.append(d[0]) + if(d[1]): appr_roles.append(d[1]) + + if not has_common(appr_roles, webnotes.user.get_roles()) and not has_common(appr_users, session['user']): + msg, add_msg = '','' + if max_amount: + dcc = TransactionBase().get_company_currency(self.doc.company) + if based_on == 'Grand Total': msg = "since Grand Total exceeds %s. %s" % (dcc, flt(max_amount)) + elif based_on == 'Itemwise Discount': msg = "since Discount exceeds %s for Item Code : %s" % (cstr(max_amount)+'%', item) + elif based_on == 'Average Discount' or based_on == 'Customerwise Discount': msg = "since Discount exceeds %s" % (cstr(max_amount)+'%') + + if appr_users: add_msg = "Users : "+cstr(appr_users) + if appr_roles: add_msg = "Roles : "+cstr(appr_roles) + if appr_users and appr_roles: add_msg = "Users : "+cstr(appr_users)+" or "+"Roles : "+cstr(appr_roles) + msgprint("You do not have an authority to submit this %s %s. Please send for approval to %s" % (doctype_name, msg, add_msg)) + raise Exception - # Check if authorization rule is set specific to user - # ---------------------------------------------------- - def validate_auth_rule(self, doctype_name, total, based_on, cond, company, item = ''): - chk = 1 - add_cond1,add_cond2 = '','' - if based_on == 'Itemwise Discount': - add_cond1 += " and master_name = '"+cstr(item)+"'" - itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = '%s' and value <= '%s' and based_on = '%s' and company = '%s' and docstatus != 2 %s %s" % (doctype_name, total, based_on, company, cond, add_cond1)) - if not itemwise_exists: - itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = '%s' and value <= '%s' and based_on = '%s' and ifnull(company,'') = '' and docstatus != 2 %s %s" % (doctype_name, total, based_on, cond, add_cond1)) - if itemwise_exists: - self.get_appr_user_role(itemwise_exists, doctype_name, total, based_on, cond+add_cond1, item,company) - chk = 0 - if chk == 1: - if based_on == 'Itemwise Discount': add_cond2 += " and ifnull(master_name,'') = ''" - appr = sql("select value from `tabAuthorization Rule` where transaction = '%s' and value <= '%s' and based_on = '%s' and company = '%s' and docstatus != 2 %s %s" % (doctype_name, total, based_on, company, cond, add_cond2)) - if not appr: - appr = sql("select value from `tabAuthorization Rule` where transaction = '%s' and value <= '%s' and based_on = '%s' and ifnull(company,'') = '' and docstatus != 2 %s %s" % (doctype_name, total, based_on, cond, add_cond2)) - self.get_appr_user_role(appr, doctype_name, total, based_on, cond+add_cond2, item, company) - - - # Bifurcate Authorization based on type - # -------------------------------------- - def bifurcate_based_on_type(self, doctype_name, total, av_dis, based_on, doc_obj, val, company): - add_cond = '' - auth_value = av_dis - if val == 1: add_cond += " and system_user = '"+session['user']+"'" - elif val == 2: add_cond += " and system_role IN %s" % ("('"+"','".join(webnotes.user.get_roles())+"')") - else: add_cond += " and ifnull(system_user,'') = '' and ifnull(system_role,'') = ''" - if based_on == 'Grand Total': auth_value = total - elif based_on == 'Customerwise Discount': - if doc_obj: - if doc_obj.doc.doctype == 'Receivable Voucher': customer = doc_obj.doc.customer - else: customer = doc_obj.doc.customer_name - add_cond = " and master_name = '"+cstr(customer)+"'" - if based_on == 'Itemwise Discount': - if doc_obj: - for t in getlist(doc_obj.doclist, doc_obj.fname): - self.validate_auth_rule(doctype_name, t.adj_rate, based_on, add_cond, company,t.item_code ) - else: - self.validate_auth_rule(doctype_name, auth_value, based_on, add_cond, company) + # Check if authorization rule is set specific to user + # ---------------------------------------------------- + def validate_auth_rule(self, doctype_name, total, based_on, cond, company, item = ''): + chk = 1 + add_cond1,add_cond2 = '','' + if based_on == 'Itemwise Discount': + add_cond1 += " and master_name = '"+cstr(item)+"'" + itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s", (doctype_name, total, based_on, company, cond, add_cond1)) + if not itemwise_exists: + itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s", (doctype_name, total, based_on, cond, add_cond1)) + if itemwise_exists: + self.get_appr_user_role(itemwise_exists, doctype_name, total, based_on, cond+add_cond1, item,company) + chk = 0 + if chk == 1: + if based_on == 'Itemwise Discount': add_cond2 += " and ifnull(master_name,'') = ''" + appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s", (doctype_name, total, based_on, company, cond, add_cond2)) + if not appr: + appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s", (doctype_name, total, based_on, cond, add_cond2)) + self.get_appr_user_role(appr, doctype_name, total, based_on, cond+add_cond2, item, company) + + + # Bifurcate Authorization based on type + # -------------------------------------- + def bifurcate_based_on_type(self, doctype_name, total, av_dis, based_on, doc_obj, val, company): + add_cond = '' + auth_value = av_dis + if val == 1: add_cond += " and system_user = '"+session['user']+"'" + elif val == 2: add_cond += " and system_role IN %s" % ("('"+"','".join(webnotes.user.get_roles())+"')") + else: add_cond += " and ifnull(system_user,'') = '' and ifnull(system_role,'') = ''" + if based_on == 'Grand Total': auth_value = total + elif based_on == 'Customerwise Discount': + if doc_obj: + if doc_obj.doc.doctype == 'Receivable Voucher': customer = doc_obj.doc.customer + else: customer = doc_obj.doc.customer_name + add_cond = " and master_name = '"+cstr(customer)+"'" + if based_on == 'Itemwise Discount': + if doc_obj: + for t in getlist(doc_obj.doclist, doc_obj.fname): + self.validate_auth_rule(doctype_name, t.adj_rate, based_on, add_cond, company,t.item_code ) + else: + self.validate_auth_rule(doctype_name, auth_value, based_on, add_cond, company) - # Check Approving Authority for transactions other than expense voucher and Appraisal - # ------------------------- - def validate_approving_authority(self, doctype_name,company, total, doc_obj = ''): - if doctype_name == 'Payable Voucher': doctype_name = 'Purchase Invoice' - elif doctype_name == 'Receivable Voucher': doctype_name = 'Sales Invoice' - av_dis = 0 - if doc_obj: - ref_rate, basic_rate = 0, 0 - for d in getlist(doc_obj.doclist, doc_obj.fname): - if d.base_ref_rate and d.basic_rate: - ref_rate += flt(d.base_ref_rate) - basic_rate += flt(d.basic_rate) - if ref_rate: av_dis = 100 - flt(basic_rate * 100 / ref_rate) + # Check Approving Authority for transactions other than expense voucher and Appraisal + # ------------------------- + def validate_approving_authority(self, doctype_name,company, total, doc_obj = ''): + if doctype_name == 'Payable Voucher': doctype_name = 'Purchase Invoice' + elif doctype_name == 'Receivable Voucher': doctype_name = 'Sales Invoice' + av_dis = 0 + if doc_obj: + ref_rate, basic_rate = 0, 0 + for d in getlist(doc_obj.doclist, doc_obj.fname): + if d.base_ref_rate and d.basic_rate: + ref_rate += flt(d.base_ref_rate) + basic_rate += flt(d.basic_rate) + if ref_rate: av_dis = 100 - flt(basic_rate * 100 / ref_rate) - final_based_on = ['Grand Total','Average Discount','Customerwise Discount','Itemwise Discount'] - # Individual User - # ================ - # Check for authorization set for individual user - - based_on = [x[0] for x in sql("select distinct based_on from `tabAuthorization Rule` where transaction = '%s' and system_user = '%s' and (company = '%s' or ifnull(company,'')='') and docstatus != 2" %(doctype_name, session['user'], company))] - - for d in based_on: - self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 1, company) - - # Remove user specific rules from global authorization rules - for r in based_on: - if r in final_based_on and r != 'Itemwise Discount': final_based_on.remove(r) - - # Specific Role - # =============== - # Check for authorization set on particular roles - #based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = '%s' and system_role IN %s and based_on IN %s and docstatus != 2" %(doctype_name, "('"+"','".join(session['data']['profile']['roles'])+"')", "('"+"','".join(final_based_on)+"')"))] - based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = '%s' and system_role IN %s and based_on IN %s and (company = '%s' or ifnull(company,'')='') and docstatus != 2" %(doctype_name, "('"+"','".join(webnotes.user.get_roles())+"')", "('"+"','".join(final_based_on)+"')",company))] - for d in based_on: - self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 2, company) - - # Remove role specific rules from global authorization rules - for r in based_on: - if r in final_based_on and r != 'Itemwise Discount': final_based_on.remove(r) - - # Global Rule - # ============= - # Check for global authorization - for g in final_based_on: - self.bifurcate_based_on_type(doctype_name, total, av_dis, g, doc_obj, 0, company) - - #======================================================================================================================== - # payroll related check - def get_value_based_rule(self,doctype_name,employee,total_claimed_amount,company): - val_lst =[] - val = sql("select value from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)< %s and company = %s and docstatus!=2",(doctype_name,employee,employee,total_claimed_amount,company)) - if not val: - val = sql("select value from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)< %s and ifnull(company,'') = '' and docstatus!=2",(doctype_name,employee,employee,total_claimed_amount)) + final_based_on = ['Grand Total','Average Discount','Customerwise Discount','Itemwise Discount'] + # Individual User + # ================ + # Check for authorization set for individual user + + based_on = [x[0] for x in sql("select distinct based_on from `tabAuthorization Rule` where transaction = %s and system_user = %s and (company = %s or ifnull(company,'')='') and docstatus != 2", (doctype_name, session['user'], company))] + + for d in based_on: + self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 1, company) + + # Remove user specific rules from global authorization rules + for r in based_on: + if r in final_based_on and r != 'Itemwise Discount': final_based_on.remove(r) + + # Specific Role + # =============== + # Check for authorization set on particular roles + based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = %s and system_role IN %s and based_on IN %s and (company = %s or ifnull(company,'')='') and docstatus != 2", (doctype_name, "('"+"','".join(webnotes.user.get_roles())+"')", "('"+"','".join(final_based_on)+"')",company))] + for d in based_on: + self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 2, company) + + # Remove role specific rules from global authorization rules + for r in based_on: + if r in final_based_on and r != 'Itemwise Discount': final_based_on.remove(r) + + # Global Rule + # ============= + # Check for global authorization + for g in final_based_on: + self.bifurcate_based_on_type(doctype_name, total, av_dis, g, doc_obj, 0, company) + + #======================================================================================================================== + # payroll related check + def get_value_based_rule(self,doctype_name,employee,total_claimed_amount,company): + val_lst =[] + val = sql("select value from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)< %s and company = %s and docstatus!=2",(doctype_name,employee,employee,total_claimed_amount,company)) + if not val: + val = sql("select value from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)< %s and ifnull(company,'') = '' and docstatus!=2",(doctype_name, employee, employee, total_claimed_amount)) - - if val: - val_lst = [y[0] for y in val] - else: - val_lst.append(0) - - max_val = max(val_lst) - rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and company = %s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)= %s and docstatus!=2",(doctype_name,company,employee,employee,flt(max_val)), as_dict=1) - if not rule: - rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and ifnull(company,'') = '' and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)= %s and docstatus!=2",(doctype_name,employee,employee,flt(max_val)), as_dict=1) + if val: + val_lst = [y[0] for y in val] + else: + val_lst.append(0) + + max_val = max(val_lst) + rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and company = %s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)= %s and docstatus!=2",(doctype_name,company,employee,employee,flt(max_val)), as_dict=1) + if not rule: + rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and ifnull(company,'') = '' and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(value,0)= %s and docstatus!=2",(doctype_name,employee,employee,flt(max_val)), as_dict=1) - return rule - - #--------------------------------------------------------------------------------------------------------------------- - # related to payroll module only - def get_approver_name(self, doctype_name, total, doc_obj=''): - app_user=[] - app_specific_user =[] - rule ={} - - if doc_obj: - if doctype_name == 'Expense Voucher': - rule = self.get_value_based_rule(doctype_name,doc_obj.doc.employee,doc_obj.doc.total_claimed_amount, doc_obj.doc.company) - elif doctype_name == 'Appraisal': - rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and company = %s and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee, doc_obj.doc.company),as_dict=1) - if not rule: - rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(company,'') = '' and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee),as_dict=1) - - if rule: - for m in rule: - if m['to_emp'] or m['to_designation']: - if m['approving_user']: - app_specific_user.append(m['approving_user']) - elif m['approving_role']: - user_lst = [z[0] for z in sql("select distinct t1.name from `tabProfile` t1, `tabUserRole` t2 where t2.role=%s and t2.parent=t1.name and t1.name !='Administrator' and t1.name != 'Guest' and t1.docstatus !=2",m['approving_role'])] - for x in user_lst: - if not x in app_user: - app_user.append(x) - - if len(app_specific_user) >0: - return app_specific_user - else: - return app_user + return rule + + #--------------------------------------------------------------------------------------------------------------------- + # related to payroll module only + def get_approver_name(self, doctype_name, total, doc_obj=''): + app_user=[] + app_specific_user =[] + rule ={} + + if doc_obj: + if doctype_name == 'Expense Voucher': + rule = self.get_value_based_rule(doctype_name,doc_obj.doc.employee,doc_obj.doc.total_claimed_amount, doc_obj.doc.company) + elif doctype_name == 'Appraisal': + rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and company = %s and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee, doc_obj.doc.company),as_dict=1) + if not rule: + rule = sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(company,'') = '' and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee),as_dict=1) + + if rule: + for m in rule: + if m['to_emp'] or m['to_designation']: + if m['approving_user']: + app_specific_user.append(m['approving_user']) + elif m['approving_role']: + user_lst = [z[0] for z in sql("select distinct t1.name from `tabProfile` t1, `tabUserRole` t2 where t2.role=%s and t2.parent=t1.name and t1.name !='Administrator' and t1.name != 'Guest' and t1.docstatus !=2",m['approving_role'])] + for x in user_lst: + if not x in app_user: + app_user.append(x) + + if len(app_specific_user) >0: + return app_specific_user + else: + return app_user From 410962d3f79f61081cfee597019ceee940d59e83 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 13:48:40 +0530 Subject: [PATCH 29/37] error fixed in auth control --- .../authorization_control/authorization_control.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/setup/doctype/authorization_control/authorization_control.py b/setup/doctype/authorization_control/authorization_control.py index cce90422e1..d0494301c8 100644 --- a/setup/doctype/authorization_control/authorization_control.py +++ b/setup/doctype/authorization_control/authorization_control.py @@ -32,9 +32,9 @@ class DocType(TransactionBase): amt_list.append(flt(x[0])) max_amount = max(amt_list) - app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and company = %s %s", (doctype_name, flt(max_amount), total, based_on, company, condition)) + app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and company = %s %s" % ('%s', '%s', '%s', '%s', '%s', condition), (doctype_name, flt(max_amount), total, based_on, company)) if not app_dtl: - app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and ifnull(company,'') = '' %s", (doctype_name, flt(max_amount), total, based_on, condition)) + app_dtl = sql("select approving_user, approving_role from `tabAuthorization Rule` where transaction = %s and (value = %s or value > %s) and docstatus != 2 and based_on = %s and ifnull(company,'') = '' %s" % ('%s', '%s', '%s', '%s', condition), (doctype_name, flt(max_amount), total, based_on)) for d in app_dtl: if(d[0]): appr_users.append(d[0]) if(d[1]): appr_roles.append(d[1]) @@ -61,17 +61,17 @@ class DocType(TransactionBase): add_cond1,add_cond2 = '','' if based_on == 'Itemwise Discount': add_cond1 += " and master_name = '"+cstr(item)+"'" - itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s", (doctype_name, total, based_on, company, cond, add_cond1)) + itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s" % ('%s', '%s', '%s', '%s', cond, add_cond1), (doctype_name, total, based_on, company)) if not itemwise_exists: - itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s", (doctype_name, total, based_on, cond, add_cond1)) + itemwise_exists = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s" % ('%s', '%s', '%s', cond, add_cond1), (doctype_name, total, based_on)) if itemwise_exists: self.get_appr_user_role(itemwise_exists, doctype_name, total, based_on, cond+add_cond1, item,company) chk = 0 if chk == 1: if based_on == 'Itemwise Discount': add_cond2 += " and ifnull(master_name,'') = ''" - appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s", (doctype_name, total, based_on, company, cond, add_cond2)) + appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and company = %s and docstatus != 2 %s %s" % ('%s', '%s', '%s', '%s', cond, add_cond2), (doctype_name, total, based_on, company)) if not appr: - appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s", (doctype_name, total, based_on, cond, add_cond2)) + appr = sql("select value from `tabAuthorization Rule` where transaction = %s and value <= %s and based_on = %s and ifnull(company,'') = '' and docstatus != 2 %s %s"% ('%s', '%s', '%s', cond, add_cond2), (doctype_name, total, based_on)) self.get_appr_user_role(appr, doctype_name, total, based_on, cond+add_cond2, item, company) @@ -128,7 +128,7 @@ class DocType(TransactionBase): # Specific Role # =============== # Check for authorization set on particular roles - based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = %s and system_role IN %s and based_on IN %s and (company = %s or ifnull(company,'')='') and docstatus != 2", (doctype_name, "('"+"','".join(webnotes.user.get_roles())+"')", "('"+"','".join(final_based_on)+"')",company))] + based_on = [x[0] for x in sql("select based_on from `tabAuthorization Rule` where transaction = %s and system_role IN (%s) and based_on IN (%s) and (company = %s or ifnull(company,'')='') and docstatus != 2", (doctype_name, "'"+"','".join(webnotes.user.get_roles())+"'", "'"+"','".join(final_based_on)+"'",company))] for d in based_on: self.bifurcate_based_on_type(doctype_name, total, av_dis, d, doc_obj, 2, company) From 269115f191ca19fd727fba20a1524693db912518 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 14:43:23 +0530 Subject: [PATCH 30/37] print hide packing list related flds --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index f2748196f5..f1c0fd866e 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 358 +last_patch = 359 #------------------------------------------- @@ -313,3 +313,5 @@ def execute(patch_no): elif patch_no == 358: reload_doc('stock', 'doctype', 'delivery_note') reload_doc('stock', 'doctype', 'delivery_note_detail') + elif patch_no == 359: + sql("update `tabDocField` set print_hide =1 where fieldname in ('pack_no', 'pack_gross_wt', 'weight_uom', 'pack_nett_wt') and parent = 'Delivery Note Detail'") From a06c2ceaffda6309696f547fb2a9ea05ffbad91f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 17:58:54 +0530 Subject: [PATCH 31/37] fixed null issue in update_cp --- setup/doctype/manage_account/manage_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/doctype/manage_account/manage_account.py b/setup/doctype/manage_account/manage_account.py index a0ed2fadd2..651794fa16 100644 --- a/setup/doctype/manage_account/manage_account.py +++ b/setup/doctype/manage_account/manage_account.py @@ -29,7 +29,7 @@ class DocType: set_default(defkey, defvalue) if defkey == 'fiscal_year': - ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", defvalue) + ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", cstr(defvalue)) ysd = ysd and ysd[0][0] or '' if ysd: set_default('year_start_date', ysd.strftime('%Y-%m-%d')) From 8f494265ba97896536731810016897106adc9774 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Sep 2011 19:09:39 +0530 Subject: [PATCH 32/37] fixed issue in reposting --- accounts/doctype/fiscal_year/fiscal_year.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/doctype/fiscal_year/fiscal_year.py b/accounts/doctype/fiscal_year/fiscal_year.py index 6b2dfdedec..48d7d91cde 100644 --- a/accounts/doctype/fiscal_year/fiscal_year.py +++ b/accounts/doctype/fiscal_year/fiscal_year.py @@ -133,8 +133,8 @@ class DocType: # build dict p = { - 'debit': flt(entry[2]) - ,'credit':flt(entry[3]) + 'debit': entry[4]=='No' and flt(entry[2]) or 0 + ,'credit': entry[4]=='No' and flt(entry[3]) or 0 ,'opening': entry[4]=='Yes' and diff or 0 # end date conditino only if it is not opening From f06796941790c1879b25de826e58656982e3893c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 12:14:45 +0530 Subject: [PATCH 33/37] error fixed in sales browser control --- setup/doctype/sales_browser_control/sales_browser_control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/doctype/sales_browser_control/sales_browser_control.py b/setup/doctype/sales_browser_control/sales_browser_control.py index d4c4a1316b..e9f8242450 100644 --- a/setup/doctype/sales_browser_control/sales_browser_control.py +++ b/setup/doctype/sales_browser_control/sales_browser_control.py @@ -131,7 +131,7 @@ class DocType: r = eval(args) - if r['lft'] == 0: + if r['lft'] == 0 and r['action'] != 'Create': n = sql("select lft,rgt from `tab%s` where name = '%s'"%(r['node_title'],r['nm'])) r['lft'] = n[0][0] r['rgt'] = n[0][1] @@ -212,4 +212,4 @@ class DocType: if res: msgprint("'%s' record is already exist."%(r['nm'])) return 'true' - return 'false' \ No newline at end of file + return 'false' From 14db227234d0036148052b0c13c84b3922e93f9e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 12:56:33 +0530 Subject: [PATCH 34/37] added condition of sales and service item in quotation item code get_query --- selling/doctype/quotation/quotation.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/selling/doctype/quotation/quotation.js b/selling/doctype/quotation/quotation.js index b3dcde681a..0732e45dc6 100644 --- a/selling/doctype/quotation/quotation.js +++ b/selling/doctype/quotation/quotation.js @@ -312,10 +312,11 @@ cur_frm.cscript.validate = function(doc,cdt,cdn){ //================ Last Quoted Price and Last Sold Price suggestion ====================== cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query= function(doc, cdt, cdn) { var d = locals[cdt][cdn]; + var cond = (doc.order_type == 'Maintenance')? " and tabItem.is_service_item = 'Yes'" : " and tabItem.is_sales_item = 'Yes'" if(doc.customer) return repl("SELECT i.name,i.item_code,concat('Last quoted at - ',cast(quote_rate as char)) as quote_rate,concat('Last sold at - ',cast(sales_rate as char)) as sales_rate FROM\ (\ - select item_code,name from tabItem where tabItem.%(key)s like '%s'\ + select item_code,name from tabItem where tabItem.%(key)s like '%s' %(cond)s\ )i\ left join\ (\ @@ -336,7 +337,7 @@ cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query= (\ select rd.item_code,max(voucher_date) as voucher_date from `tabRV Detail` rd, `tabReceivable Voucher` r where r.name=rd.parent and r.docstatus=1 and customer='%(cust)s' group by rd.item_code\ )m where r.item_code=m.item_code and r.voucher_date=m.voucher_date\ - )s on i.item_code=s.item_code ORDER BY item_code LIMIT 50",{cust:doc.customer}); + )s on i.item_code=s.item_code ORDER BY item_code LIMIT 50",{cust:doc.customer, cond:cond}); else - return "SELECT name, item_code FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' ORDER BY tabItem.item_code DESC LIMIT 50"; -} \ No newline at end of file + return repl("SELECT name, item_code FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' %(cond)s ORDER BY tabItem.item_code DESC LIMIT 50", {cond:cond}); +} From 56e02b70bdd892678893962b1e0691be4d226b6d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 13:04:48 +0530 Subject: [PATCH 35/37] print hide print_packing_list field in DN --- patches/patch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index f1c0fd866e..c085504ebb 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 359 +last_patch = 360 #------------------------------------------- @@ -315,3 +315,5 @@ def execute(patch_no): reload_doc('stock', 'doctype', 'delivery_note_detail') elif patch_no == 359: sql("update `tabDocField` set print_hide =1 where fieldname in ('pack_no', 'pack_gross_wt', 'weight_uom', 'pack_nett_wt') and parent = 'Delivery Note Detail'") + elif patch_no == 360: + sql("update `tabDocField` set print_hide =1 where fieldname = 'print_packing_slip' and parent = 'Delivery Note'") From 389de000d993823a572f343fb63c66c5d9b15b9f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 9 Sep 2011 13:41:36 +0530 Subject: [PATCH 36/37] Allow system manager to change other users password Also, update gateway membership type if sync_with_gateway is true --- .../company_control/company_control.py | 9 +++ home/page/my_company/my_company.js | 74 +++++++++++++++---- home/page/my_company/my_company.py | 5 +- 3 files changed, 69 insertions(+), 19 deletions(-) diff --git a/home/doctype/company_control/company_control.py b/home/doctype/company_control/company_control.py index cab8e7c17e..246b07e736 100644 --- a/home/doctype/company_control/company_control.py +++ b/home/doctype/company_control/company_control.py @@ -53,6 +53,15 @@ class DocType: pr.role = r pr.parentfield = 'userroles' pr.save(1) + + # Update Membership Type at Gateway + if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')): + if 'System Manager' in role_list : membership_type = 'Administrator' + else : membership_type = 'Member' + + import server_tools.gateway_utils + server_tools.gateway_utils.update_membership_type(cstr(arg['usr']), membership_type) + sql("delete from __SessionCache where user=%s", cstr(arg['usr'])) # Save profile diff --git a/home/page/my_company/my_company.js b/home/page/my_company/my_company.js index 9da7e9bd2d..40bf155585 100644 --- a/home/page/my_company/my_company.js +++ b/home/page/my_company/my_company.js @@ -322,7 +322,7 @@ MemberProfile = function(parent, uid, member_item) { // show securty settings this.set_security = function() { - var d = new wn.widgets.Dialog({ + var sd = new wn.widgets.Dialog({ title: 'Set User Security', width: 500, fields: [ @@ -362,30 +362,72 @@ MemberProfile = function(parent, uid, member_item) { } ] }); - d.onshow = function() { - d.set_values({ + + me.sec_dialog = sd + + sd.onshow = function() { + me.sec_dialog.set_values({ restrict_ip: me.profile.restrict_ip || '', login_before: me.profile.login_before || '', login_after: me.profile.login_after || '', new_password: '' - }) - } - d.fields_dict.update.input.onclick = function() { + }); + }; + sd.fields_dict.update.input.onclick = function() { var btn = this; this.set_working(); - var args = d.get_values(); + var args = me.sec_dialog.get_values(); args.user = me.profile.name; - $c_page('home', 'my_company', 'update_security', JSON.stringify(args), function(r,rt) { - if(r.exc) { - msgprint(r.exc); + + if (args.new_password) { + var pass_d = new wn.widgets.Dialog({ + title: 'Your Password', + width: 300, + fields: [ + { + label: 'Please Enter Your Password', + description: "Your password is required to update the concerned user's password", + fieldtype: 'Password', + fieldname: 'sys_admin_pwd', + reqd: 1 + }, + + { + label: 'Continue', + fieldtype: 'Button', + fieldname: 'continue' + } + ] + }); + + pass_d.fields_dict.continue.input.onclick = function() { + btn.pwd_dialog.hide(); + args.sys_admin_pwd = btn.pwd_dialog.get_values().sys_admin_pwd; + btn.set_working(); + me.update_security(args); btn.done_working(); - return; } - $.extend(me.profile, d.get_values()); - d.hide(); - }); - } - d.show(); + + pass_d.show(); + btn.pwd_dialog = pass_d; + btn.done_working(); + } else { + btn.done_working(); + me.update_security(args); + } + }; + sd.show(); + } + + this.update_security = function(args) { + $c_page('home', 'my_company', 'update_security', JSON.stringify(args), function(r,rt) { + if(r.exc) { + msgprint(r.exc); + return; + } + me.sec_dialog.hide(); + $.extend(me.profile, me.sec_dialog.get_values()); + }); } // delete user diff --git a/home/page/my_company/my_company.py b/home/page/my_company/my_company.py index 5d5ed800a8..3ff1482e9f 100644 --- a/home/page/my_company/my_company.py +++ b/home/page/my_company/my_company.py @@ -140,8 +140,7 @@ def update_security(args=''): if 'new_password' in args: if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')): import server_tools.gateway_utils - webnotes.msgprint(server_tools.gateway_utils.change_password('', args['new_password'])['message']) + webnotes.msgprint(server_tools.gateway_utils.change_password('', args['new_password'], args['user'], args['sys_admin_pwd'])['message']) else: webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s", (args['new_password'], args['user'])) - - webnotes.msgprint('Settings Updated') \ No newline at end of file + else: webnotes.msgprint('Settings Updated') \ No newline at end of file From 40693e319001e2290047b415ce37ae0264edc552 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Sep 2011 17:55:25 +0530 Subject: [PATCH 37/37] post_render in pv and AP report error solved --- accounts/doctype/payable_voucher/payable_voucher.js | 11 +++++++---- .../accounts_payable/accounts_payable.py | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/accounts/doctype/payable_voucher/payable_voucher.js b/accounts/doctype/payable_voucher/payable_voucher.js index 4a566d373b..e3b986d8a1 100644 --- a/accounts/doctype/payable_voucher/payable_voucher.js +++ b/accounts/doctype/payable_voucher/payable_voucher.js @@ -20,12 +20,15 @@ cur_frm.cscript.onload = function(doc,dt,dn) { } if(doc.__islocal){ - if(doc.supplier) {cur_frm.cscript.supplier(doc,dt,dn)} - hide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']); + hide_field(['supplier_address', 'contact_person', 'supplier_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email']); } - +} - if(doc.supplier) unhide_field(['supplier_address','contact_person','supplier_name','address_display','contact_display','contact_mobile','contact_email']); + +//Onload post render +//------------------------ +cur_frm.cscript.onload_post_render = function(doc, dt, dn) { + if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn); } // Refresh diff --git a/accounts/search_criteria/accounts_payable/accounts_payable.py b/accounts/search_criteria/accounts_payable/accounts_payable.py index 8c07b68b45..44daddcf3c 100644 --- a/accounts/search_criteria/accounts_payable/accounts_payable.py +++ b/accounts/search_criteria/accounts_payable/accounts_payable.py @@ -90,9 +90,13 @@ for r in res: # supplier type r.append(supp_type_dict.get(r[col_idx['Account']], '')) + if r[col_idx['Voucher Type']] == 'Payable Voucher': + r += pv_dict.get(r[col_idx['Voucher No']], ['', '', '']) + else: + r += ['', '', ''] + # if entry against Payable Voucher if r[col_idx['Against Voucher']] and r[col_idx['Voucher Type']] == 'Payable Voucher': - r += pv_dict.get(r[col_idx['Voucher No']], ['', '', '']) cond = " and ifnull(against_voucher, '') = '%s'" % r[col_idx['Against Voucher']] # if entry against JV & and not adjusted within period