From 1b81badd5803302fe419baf5b25855f87b9c0e5e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 3 Apr 2012 11:27:03 +0530 Subject: [PATCH 01/14] validation changes for po item --- erpnext/buying/doctype/purchase_common/purchase_common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index ca9181f154..597eec4fde 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -227,7 +227,7 @@ class DocType(TransactionBase): if d.fields.has_key(x): d.fields[x] = f_lst[x] - item = sql("select is_stock_item, is_purchase_item from tabItem where name=%s and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now())", d.item_code) + item = sql("select is_stock_item, is_purchase_item, is_sub_contracted_item from tabItem where name=%s and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now())", d.item_code) if not item: msgprint("Item %s does not exist in Item Master." % cstr(d.item_code)) raise Exception @@ -239,9 +239,10 @@ class DocType(TransactionBase): raise Exception # validate purchase item - if not item[0][1]=='Yes': - msgprint("Item %s is not purchase item." % (d.item_code)) + if item[0][1] != 'Yes' and item[0][2] != 'Yes': + msgprint("Item %s is not a purchase item or sub-contracted item. Please check" % (d.item_code)) raise Exception + if d.fields.has_key('prevdoc_docname') and d.prevdoc_docname: # check warehouse, uom in previous doc and in current doc are same. From a6eb15df4a29a659a47341cf26b63543e016d3c0 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 3 Apr 2012 13:22:20 +0530 Subject: [PATCH 02/14] fix in earning and deduction type field tyep --- .../mar_2012/earning_deduction_type_patch.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 erpnext/patches/mar_2012/earning_deduction_type_patch.py diff --git a/erpnext/patches/mar_2012/earning_deduction_type_patch.py b/erpnext/patches/mar_2012/earning_deduction_type_patch.py new file mode 100644 index 0000000000..438b34e946 --- /dev/null +++ b/erpnext/patches/mar_2012/earning_deduction_type_patch.py @@ -0,0 +1,14 @@ +def execute(): + import webnotes + webnotes.conn.sql(""" + UPDATE `tabDocField` + SET fieldtype = 'Link', options = 'Deduction Type' + WHERE parent = 'Deduction Detail' + AND fieldname = 'd_type' + """) + webnotes.conn.sql(""" + UPDATE `tabDocField` + SET fieldtype = 'Link', options = 'Earning Type' + WHERE parent = 'Earning Detail' + AND fieldname = 'e_type' + """) From fc8bf7b1d87be5018ea79ff4c6b45cadc2334657 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 3 Apr 2012 13:49:14 +0530 Subject: [PATCH 03/14] add select type link fields in permission control --- .../setup/doctype/permission_control/permission_control.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/permission_control/permission_control.py b/erpnext/setup/doctype/permission_control/permission_control.py index 049a3f518d..bb05bec1cd 100644 --- a/erpnext/setup/doctype/permission_control/permission_control.py +++ b/erpnext/setup/doctype/permission_control/permission_control.py @@ -70,7 +70,10 @@ class DocType: ret.append(p) # fields list - fl = ['', 'owner'] + [l[0] for l in sql("select fieldname from tabDocField where parent=%s and fieldtype='Link' and ifnull(options,'')!=''", doctype)] + fl = ['', 'owner'] + [l[0] for l in sql("""\ + select fieldname from tabDocField where parent=%s + and ((fieldtype='Link' and ifnull(options,'')!='') or + (fieldtype='Select') and lcase(ifnull(options,'')) like 'link:%%')""", doctype)] return {'perms':ret, 'fields':fl} From 00ceafb42d7da5f7f318caded189d5c65206a754 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 3 Apr 2012 18:43:17 +0530 Subject: [PATCH 04/14] fix in fiscal year of email digest --- erpnext/setup/doctype/email_digest/email_digest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index ff9bf68719..fb3730cb25 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -240,7 +240,9 @@ class DocType: Adds common conditions in dictionary "args" """ start_date, end_date = self.get_start_end_dates() - fiscal_start_date = webnotes.utils.get_defaults()['year_start_date'] + fiscal_year = webnotes.utils.get_defaults()['fiscal_year'] + fiscal_start_date = webnotes.conn.get_value('Fiscal Year', fiscal_year, + 'year_start_date') if 'new' in args['type']: args.update({ From f77c940fcfc8a0c459d53a12a2dd6111ae59137e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 5 Apr 2012 16:29:02 +0530 Subject: [PATCH 05/14] fixed price list currency issue --- .../selling/doctype/sales_common/sales_common.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js index cad8ec16f7..a3470ec460 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.js +++ b/erpnext/selling/doctype/sales_common/sales_common.js @@ -157,11 +157,17 @@ cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) { args: {'price_list':doc.price_list_name, 'company': doc.company}, callback: function(r, rt) { pl_currency = r.message[0]?r.message[0]:[]; + unhide_field(['price_list_currency', 'plc_conversion_rate']); + if (pl_currency.length==1) { - if (pl_currency[0] == doc.currency) set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); - else if (pl_currency[0] = r.message[1]) set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) - hide_field(['price_list_currency', 'plc_conversion_rate']); - } else unhide_field(['price_list_currency', 'plc_conversion_rate']); + if (pl_currency[0] == doc.currency) { + set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); + hide_field(['price_list_currency', 'plc_conversion_rate']); + } else if (pl_currency[0] = r.message[1]) { + set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) + hide_field(['price_list_currency', 'plc_conversion_rate']); + } + } if (r.message[1] == doc.currency) { set_multiple(cdt, cdn, {conversion_rate:1}); From 758eed555c8f837f8938e517d70680b1c1e1e64f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 5 Apr 2012 16:45:33 +0530 Subject: [PATCH 06/14] Update erpnext/selling/doctype/sales_common/sales_common.js --- erpnext/selling/doctype/sales_common/sales_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js index a3470ec460..5dcdb69339 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.js +++ b/erpnext/selling/doctype/sales_common/sales_common.js @@ -163,7 +163,7 @@ cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) { if (pl_currency[0] == doc.currency) { set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); hide_field(['price_list_currency', 'plc_conversion_rate']); - } else if (pl_currency[0] = r.message[1]) { + } else if (pl_currency[0] == r.message[1]) { set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) hide_field(['price_list_currency', 'plc_conversion_rate']); } From 9ba2e49468f87fe1af147a8860d25de9e5cb3fde Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 5 Apr 2012 16:54:19 +0530 Subject: [PATCH 07/14] Update erpnext/selling/doctype/sales_common/sales_common.js --- erpnext/selling/doctype/sales_common/sales_common.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js index 5dcdb69339..b257d6da51 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.js +++ b/erpnext/selling/doctype/sales_common/sales_common.js @@ -160,11 +160,12 @@ cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) { unhide_field(['price_list_currency', 'plc_conversion_rate']); if (pl_currency.length==1) { + set_multiple(cdt, cdn, {price_list_currency:pl_currency[0]}); if (pl_currency[0] == doc.currency) { - set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); + set_multiple(cdt, cdn, {plc_conversion_rate:doc.conversion_rate}); hide_field(['price_list_currency', 'plc_conversion_rate']); } else if (pl_currency[0] == r.message[1]) { - set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) + set_multiple(cdt, cdn, {plc_conversion_rate:1}) hide_field(['price_list_currency', 'plc_conversion_rate']); } } From 05e4fc6eb68c8aec65fbc5e9da0900d2d9b606a4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 6 Apr 2012 15:19:02 +0530 Subject: [PATCH 08/14] Chart of account/cc link only for accounts user and account manager role in account home page --- erpnext/accounts/page/accounts_home/accounts_home.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/page/accounts_home/accounts_home.js b/erpnext/accounts/page/accounts_home/accounts_home.js index 4551db0caa..52738a83bd 100644 --- a/erpnext/accounts/page/accounts_home/accounts_home.js +++ b/erpnext/accounts/page/accounts_home/accounts_home.js @@ -19,4 +19,12 @@ pscript['onload_accounts-home'] = function(wrapper) { if(wn.control_panel.country!='India') { $('.india-specific').toggle(false); } -} \ No newline at end of file + + if(wn.boot.profile.roles.indexOf('Accounts Manager')==-1 && wn.boot.profile.roles.indexOf('Accounts User')==-1) { + $('[href*="Accounts Browser"]').each(function() { + var txt = $(this).text(); + $(this).parent().css('color', '#999').html(txt); + }); + } + +} From 7da6ebc9af429fae358c34fec3721121bf5aa755 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 6 Apr 2012 17:30:53 +0530 Subject: [PATCH 09/14] Attachment option and total invoiced amt added in c-form --- erpnext/accounts/doctype/c_form/c_form.py | 8 + erpnext/accounts/doctype/c_form/c_form.txt | 195 ++++++++++++--------- 2 files changed, 123 insertions(+), 80 deletions(-) diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index 367b27aca6..bc5ed7b2a7 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -46,6 +46,14 @@ class DocType: else: msgprint("Please enter atleast 1 invoice in the table below", raise_exception=1) + self.calculate_total_invoiced_amount() + + def calculate_total_invoiced_amount(self): + total = 0 + for d in getlist(self.doclist, 'invoice_details'): + total += flt(d.grand_total) + webnotes.conn.set(self.doc, 'total_invoiced_amount', total) + def get_invoice_details(self, invoice_no): """ Pull details from invoices for referrence """ diff --git a/erpnext/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.txt index 987bc9a7b3..2cead8913f 100644 --- a/erpnext/accounts/doctype/c_form/c_form.txt +++ b/erpnext/accounts/doctype/c_form/c_form.txt @@ -3,188 +3,223 @@ # These values are common in all dictionaries { - 'creation': '2011-12-07 16:16:16', + 'creation': '2011-12-14 11:40:47', 'docstatus': 0, - 'modified': '2011-12-07 17:50:17', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-04-06 17:29:50', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all DocType { - '_last_update': '1323255350', - 'colour': 'White:FFF', + '_last_update': u'1333712835', + 'allow_attach': 1, + 'colour': u'White:FFF', 'doctype': 'DocType', - 'module': 'Accounts', + 'max_attachments': 3, + 'module': u'Accounts', 'name': '__common__', - 'section_style': 'Simple', + 'section_style': u'Simple', 'show_in_menu': 0, - 'version': 11 + 'version': 19 }, # These values are common for all DocField { - 'doctype': 'DocField', + 'doctype': u'DocField', 'name': '__common__', - 'parent': 'C-Form', - 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0 + 'parent': u'C-Form', + 'parentfield': u'fields', + 'parenttype': u'DocType' }, # These values are common for all DocPerm { - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'name': '__common__', - 'parent': 'C-Form', - 'parentfield': 'permissions', - 'parenttype': 'DocType', + 'parent': u'C-Form', + 'parentfield': u'permissions', + 'parenttype': u'DocType', 'read': 1 }, # DocType, C-Form { 'doctype': 'DocType', - 'name': 'C-Form' + 'name': u'C-Form' }, # DocPerm { 'create': 1, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 0, - 'role': 'Accounts User', + 'role': u'Accounts User', 'write': 1 }, # DocPerm { 'create': 1, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 0, - 'role': 'Accounts Manager', + 'role': u'Accounts Manager', 'submit': 0, 'write': 1 }, # DocPerm { - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'permlevel': 1, - 'role': 'All' + 'role': u'All' }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'width': '50%' + 'doctype': u'DocField', + 'fieldtype': u'Column Break', + 'permlevel': 0, + 'width': u'50%' }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'naming_series', - 'fieldtype': 'Select', - 'label': 'Series', - 'options': '\nC-FORM/', + 'doctype': u'DocField', + 'fieldname': u'naming_series', + 'fieldtype': u'Select', + 'label': u'Series', + 'options': u'\nC-FORM/', + 'permlevel': 0, 'reqd': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'c_form_no', - 'fieldtype': 'Data', - 'label': 'C-Form No', + 'doctype': u'DocField', + 'fieldname': u'c_form_no', + 'fieldtype': u'Data', + 'label': u'C-Form No', + 'permlevel': 0, 'reqd': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'received_date', - 'fieldtype': 'Date', - 'label': 'Received Date', + 'doctype': u'DocField', + 'fieldname': u'received_date', + 'fieldtype': u'Date', + 'label': u'Received Date', + 'permlevel': 0, 'reqd': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'customer', - 'fieldtype': 'Link', - 'label': 'Customer', - 'options': 'Customer', + 'doctype': u'DocField', + 'fieldname': u'customer', + 'fieldtype': u'Link', + 'label': u'Customer', + 'options': u'Customer', + 'permlevel': 0, 'reqd': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'width': '50%' + 'doctype': u'DocField', + 'fieldtype': u'Column Break', + 'permlevel': 0, + 'width': u'50%' }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'company', - 'fieldtype': 'Select', - 'label': 'Company', - 'options': 'link:Company' + 'doctype': u'DocField', + 'fieldname': u'company', + 'fieldtype': u'Select', + 'label': u'Company', + 'options': u'link:Company', + 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'fiscal_year', - 'fieldtype': 'Select', - 'label': 'Fiscal Year', - 'options': 'link:Fiscal Year', + 'doctype': u'DocField', + 'fieldname': u'fiscal_year', + 'fieldtype': u'Select', + 'label': u'Fiscal Year', + 'options': u'link:Fiscal Year', + 'permlevel': 0, 'reqd': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'quarter', - 'fieldtype': 'Select', - 'label': 'Quarter', - 'options': '\nI\nII\nIII\nIV' + 'doctype': u'DocField', + 'fieldname': u'quarter', + 'fieldtype': u'Select', + 'label': u'Quarter', + 'options': u'\nI\nII\nIII\nIV', + 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'total_amount', - 'fieldtype': 'Currency', - 'label': 'Total Amount', + 'doctype': u'DocField', + 'fieldname': u'total_amount', + 'fieldtype': u'Currency', + 'label': u'Total Amount', + 'permlevel': 0, 'reqd': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'state', - 'fieldtype': 'Select', - 'label': 'State', - 'options': "link:State\ncountry='India'", + 'doctype': u'DocField', + 'fieldname': u'state', + 'fieldtype': u'Select', + 'label': u'State', + 'options': u"link:State\ncountry='India'", + 'permlevel': 0, 'reqd': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Section Break' + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'invoice_details', - 'fieldtype': 'Table', - 'label': 'Invoice Details', - 'options': 'C-Form Invoice Detail' + 'doctype': u'DocField', + 'fieldname': u'invoice_details', + 'fieldtype': u'Table', + 'label': u'Invoice Details', + 'options': u'C-Form Invoice Detail', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'total_invoiced_amount', + 'fieldtype': u'Currency', + 'label': u'Total Invoiced Amount', + 'permlevel': 1, + 'print_hide': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'file_list', + 'fieldtype': u'Text', + 'hidden': 1, + 'label': u'File List', + 'permlevel': 0, + 'print_hide': 1 } ] \ No newline at end of file From c63a58d4168093bd6a0fcaa2ade35966dc331748 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 6 Apr 2012 17:42:02 +0530 Subject: [PATCH 10/14] c-form reload pach --- erpnext/patches/april_2012/reload_c_form.py | 4 ++++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 erpnext/patches/april_2012/reload_c_form.py diff --git a/erpnext/patches/april_2012/reload_c_form.py b/erpnext/patches/april_2012/reload_c_form.py new file mode 100644 index 0000000000..246ea0fdb1 --- /dev/null +++ b/erpnext/patches/april_2012/reload_c_form.py @@ -0,0 +1,4 @@ +def execute(): + import webnotes + from webnotes.modules.module_manager import reload_doc + reload_doc('accounts', 'doctype', 'c_form') diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 3099456f19..cd38480100 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -222,5 +222,10 @@ patch_list = [ 'patch_file': 'so_rv_mapper_fix', 'description': 'SO-RV duplicate mapper entry removal' }, + { + 'patch_module': 'patches.april_2012', + 'patch_file': 'reload_c_form', + 'description': 'Added attchemnt option and total field' + }, ] From 3525d92cfbc0bc9c9fe28decc6626e72f9f427d0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 6 Apr 2012 17:49:25 +0530 Subject: [PATCH 11/14] c-form reload pach --- erpnext/patches/april_2012/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 erpnext/patches/april_2012/__init__.py diff --git a/erpnext/patches/april_2012/__init__.py b/erpnext/patches/april_2012/__init__.py new file mode 100644 index 0000000000..e69de29bb2 From 85eb840ab43d861fcd755a5da82351c55a51d96a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 9 Apr 2012 12:02:15 +0530 Subject: [PATCH 12/14] fix in rename dt patch --- erpnext/buying/page/buying_home/buying_home.html | 2 +- erpnext/patches/jan_mar_2012/rename_dt.py | 2 +- version.num | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/buying/page/buying_home/buying_home.html b/erpnext/buying/page/buying_home/buying_home.html index cbd347d87f..9e05045fa0 100644 --- a/erpnext/buying/page/buying_home/buying_home.html +++ b/erpnext/buying/page/buying_home/buying_home.html @@ -4,7 +4,7 @@

Buying


-

Purchase Requisition

+

Purchase Request

Request for purchase

Purchase Order

Purchase Orders given to Suppliers

diff --git a/erpnext/patches/jan_mar_2012/rename_dt.py b/erpnext/patches/jan_mar_2012/rename_dt.py index a258f73ec5..e591a87215 100644 --- a/erpnext/patches/jan_mar_2012/rename_dt.py +++ b/erpnext/patches/jan_mar_2012/rename_dt.py @@ -161,7 +161,7 @@ def update_dt_in_records(rendt): webnotes.conn.sql("update `tabGL Entry` set voucher_type = replace(voucher_type, '%s', '%s') where voucher_type = '%s'" % (d, rendt[d], d)) # Stock ledger entry - webnotes.conn.sql("update `tabStock ledger Entry` set voucher_type = replace(voucher_type, '%s', '%s') where voucher_type = '%s'" % (d, rendt[d], d)) + webnotes.conn.sql("update `tabStock Ledger Entry` set voucher_type = replace(voucher_type, '%s', '%s') where voucher_type = '%s'" % (d, rendt[d], d)) # Custom fld: options webnotes.conn.sql("update `tabCustom Field` set options = replace(options, %s, %s) where fieldtype in ('Link', 'Select')", (d, rendt[d])) diff --git a/version.num b/version.num index b6f9e0e3ae..f6e16be538 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -1495 \ No newline at end of file +1496 \ No newline at end of file From 9afb57ffb25b3eee8f8fcce8596ab433d0d76079 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 9 Apr 2012 12:23:26 +0530 Subject: [PATCH 13/14] Syntax error fix in c_form.txt --- erpnext/accounts/doctype/c_form/c_form.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.txt index e24de31d27..b404204ead 100644 --- a/erpnext/accounts/doctype/c_form/c_form.txt +++ b/erpnext/accounts/doctype/c_form/c_form.txt @@ -192,7 +192,7 @@ { 'doctype': u'DocField', 'fieldname': u'section_break0', - 'fieldtype': u'Section Break' + 'fieldtype': u'Section Break', 'permlevel': 0 }, From 859cb7260605e7510fdcf1e9c478c07c8fdaa319 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 10 Apr 2012 11:35:19 +0530 Subject: [PATCH 14/14] new favicon --- .../doctype/naming_series/naming_series.py | 38 ++++++++++++++---- erpnext/startup/startup.js | 1 + favicon.ico | Bin 318 -> 0 bytes images/favicon.ico | Bin 0 -> 1150 bytes js/all-app.js | 10 +++-- js/all-web.js | 10 +++-- js/app.js | 2 +- version.num | 2 +- 8 files changed, 47 insertions(+), 16 deletions(-) delete mode 100644 favicon.ico create mode 100644 images/favicon.ico diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index bef4987927..3b820b8231 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -19,6 +19,7 @@ import webnotes from webnotes.utils import cint, cstr from webnotes import msgprint, errprint +import webnotes.model.doctype sql = webnotes.conn.sql @@ -31,13 +32,13 @@ class DocType: #----------------------------------------------------------------------------------------------------------------------------------- def get_transactions(self): - return "\n".join([''] + [i[0] for i in sql("SELECT `tabDocField`.`parent` FROM `tabDocField`, `tabDocType` WHERE `tabDocField`.`fieldname` = 'naming_series' and `tabDocType`.module !='Recycle Bin' and `tabDocType`.name=`tabDocField`.parent order by `tabDocField`.parent")]) + return "\n".join([''] + [i[0] for i in sql("SELECT `tabDocField`.`parent` FROM `tabDocField`, `tabDocType` WHERE `tabDocField`.`fieldname` = 'naming_series' and `tabDocType`.name=`tabDocField`.parent order by `tabDocField`.parent")]) #----------------------------------------------------------------------------------------------------------------------------------- def get_options_for(self, doctype): - sr = sql("select options from `tabDocField` where parent='%s' and fieldname='naming_series'" % (doctype)) - if sr and sr[0][0]: - return sr[0][0].split("\n") + sr = webnotes.model.doctype.get_property(doctype, 'naming_series') + if sr: + return sr.split("\n") else: return [] @@ -50,7 +51,7 @@ class DocType: options = self.scrub_options_list(ol) # validate names - [self.validate_series_name(i) for i in options] + for i in options: self.validate_series_name(i) if self.doc.user_must_always_select: options = [''] + options @@ -58,8 +59,28 @@ class DocType: else: default = options[0] - # update - sql("update tabDocField set `options`=%s, `default`=%s where parent=%s and fieldname='naming_series'", ("\n".join(options), default, doctype)) + # update in property setter + prop_dict = {'options': "\n".join(options), 'default': default} + for prop in prop_dict: + ps_exists = webnotes.conn.sql("""SELECT name FROM `tabProperty Setter` + WHERE doc_type = %s AND field_name = 'naming_series' + AND property = %s""", (doctype, prop)) + if ps_exists: + ps = Document('Property Setter', ps_exists[0][0]) + ps.value = prop_dict[prop] + ps.save() + else: + ps = Document('Property Setter', fielddata = { + 'doctype_or_field': 'DocField', + 'doc_type': doctype, + 'field_name': 'naming_series', + 'property': prop, + 'value': prop_dict[prop], + 'property_type': 'Select', + 'select_doctype': doctype + }) + ps.save(1) + self.doc.set_options = "\n".join(options) #----------------------------------------------------------------------------------------------------------------------------------- @@ -73,7 +94,8 @@ class DocType: from core.doctype.doctype.doctype import DocType dt = DocType() - sr = sql("select options, parent from `tabDocField` where fieldname='naming_series' and parent != %s", self.doc.select_doc_for_series) + parent = sql("select parent from `tabDocField` where fieldname='naming_series' and parent != %s", self.doc.select_doc_for_series) + sr = ([p[0], webnotes.model.doctype.get_property(p[0], 'naming_series')] for p in parent) options = self.scrub_options_list(self.doc.set_options.split("\n")) for series in options: dt.validate_series(series, self.doc.select_doc_for_series) diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 5d7e663d42..3a51a84bbe 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -171,3 +171,4 @@ erpnext.set_user_background = function(src) { $(document).bind('startup', function() { erpnext.startup.start(); }); + diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index 794eaaf00a9b1ae997877153523175563332969a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmY+6txf|$5XXOaJyKE8Gp#}NSViiZdQ!1Tk!O|=av`Y#JP*(WL3JOYPtXK8hJvlX zAV@#~!SG?~jv1~3b~693nOTUm(lo{1egs`(ZA&ukh(r;lzgR=PUF+TQox#Z`2ao4e zs|i{8O8?=F>i(4KZi2t~VsQMe^E39!mp{LlOni|Wjc3J?ibL;1Cy-ov2u0rXBiIS~ zSgi)ZtOn~X2bY;|$(D!CnHPyIXvs3RKxBz?PDCJ{FU+cNH%glxJT>9A0aq)yeunl3 R^fv$7GMm|s?b?mq{s0BbL9GA) diff --git a/images/favicon.ico b/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..045b1bddd20462f229d5443a7d5eeba7dbd38641 GIT binary patch literal 1150 zcma)*xi3Uf6vpq^#Wq9iyGSsWN+TM7i%Ls^gosHHiEe6*h60HtA{vRUu@wqKi;k9> z-#2q^Jj}?Pm)|?*e(&Cw`@VCZb0My9*l}-jV|mWiIOnbIoa5POaf;;l`&LaE zH5$kv&}+O_ZyM=O6rrrbld(^3hBbHw={pdCbWw(Q3ZKR!c>pc~T7p{pN*7vx0)G7i zbw6agKA*W$aA>TMt6(OeEmN03rl{pXFZ6-FUH;YCSX!fL^0d=Xt$B1L>D4P)96<}L z+gREGG{F|UfwVm+hiv_eGWQz1Pj}SndnW(R19R`Gd*CXd`StQ|0(OlhawSZI_9%S; zA}|YHo2S;dD>`7r&_3mhJR3AxO_K*+lSi6Y3i9Uz-r*9uU<2fnP;b?jZ5vC|IjsQg z>lVB(FVw>j{Qd-E?JJ#sT7Lt6z0Uj)oCUQ1{3~Q$433RBS$!FYO=FI%-+3~i>3r(n gQ>X{>LFj#o94IhyB@oI#w3wXzMGPsMSZsIh3wzpgZvX%Q literal 0 HcmV?d00001 diff --git a/js/all-app.js b/js/all-app.js index 75a130b7f9..0d379fc16d 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -240,7 +240,7 @@ wn.route=function(){wn._cur_route=window.location.hash;route=wn.get_route();swit wn.views.formview.show(route[1],route[2]);break;case"Report":wn.views.reportview.show(route[1],route[2]);break;default:wn.views.pageview.show(route[0]);}} wn.get_route=function(route){if(!route) route=window.location.hash;if(route.substr(0,1)=='#')route=route.substr(1);if(route.substr(0,1)=='!')route=route.substr(1);return $.map(route.split('/'),function(r){return decodeURIComponent(r);});} -wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;} +wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;set_favicon();} wn._cur_route=null;$(window).bind('hashchange',function(){if(location.hash==wn._cur_route) return;wn.route();if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}); /* @@ -2178,7 +2178,7 @@ var setup_viewport=function(){wn.container=new wn.views.Container();if(user=='Gu user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();} $(document).trigger('startup');try{if(wn.control_panel.custom_startup_code) eval(wn.control_panel.custom_startup_code);}catch(e){errprint(e);} -var t=to_open();if(t){window.location.hash=t;}else if(home_page){loadpage(home_page);} +var t=to_open();if(t){window.location.hash=t;set_favicon();}else if(home_page){loadpage(home_page);} wn.route();$dh('startup_div');$ds('body_div');} var callback=function(r,rt){if(r.exc)console.log(r.exc);setup_globals(r);setup_viewport();} if(wn.boot){LocalDB.sync(wn.boot.docs);callback(wn.boot,'');if(wn.boot.error_messages) @@ -2205,12 +2205,16 @@ var resize_observers=[] function set_resize_observer(fn){if(resize_observers.indexOf(fn)==-1)resize_observers.push(fn);} window.onresize=function(){return;var ht=get_window_height();for(var i=0;i \ + ' +$(favicon).appendTo('head');} /* * js/app.js */ wn.app={name:'ERPNext',license:'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',source:'https://github.com/webnotes/erpnext',publisher:'Web Notes Technologies Pvt Ltd, Mumbai',copyright:'© Web Notes Technologies Pvt Ltd',version:'2.'+window._version_number} wn.modules_path='erpnext';wn.settings.no_history=true;$(document).bind('ready',function(){startup();});$(document).bind('toolbar_setup',function(){$('.brand').html('erpnext\ - ').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});}) + ').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});}); /* * erpnext/startup/startup.js */ diff --git a/js/all-web.js b/js/all-web.js index 58b748db01..90f035eb3f 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -154,7 +154,7 @@ wn.route=function(){wn._cur_route=window.location.hash;route=wn.get_route();swit wn.views.formview.show(route[1],route[2]);break;case"Report":wn.views.reportview.show(route[1],route[2]);break;default:wn.views.pageview.show(route[0]);}} wn.get_route=function(route){if(!route) route=window.location.hash;if(route.substr(0,1)=='#')route=route.substr(1);if(route.substr(0,1)=='!')route=route.substr(1);return $.map(route.split('/'),function(r){return decodeURIComponent(r);});} -wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;} +wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;set_favicon();} wn._cur_route=null;$(window).bind('hashchange',function(){if(location.hash==wn._cur_route) return;wn.route();if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}); /* @@ -1206,7 +1206,7 @@ var setup_viewport=function(){wn.container=new wn.views.Container();if(user=='Gu user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();} $(document).trigger('startup');try{if(wn.control_panel.custom_startup_code) eval(wn.control_panel.custom_startup_code);}catch(e){errprint(e);} -var t=to_open();if(t){window.location.hash=t;}else if(home_page){loadpage(home_page);} +var t=to_open();if(t){window.location.hash=t;set_favicon();}else if(home_page){loadpage(home_page);} wn.route();$dh('startup_div');$ds('body_div');} var callback=function(r,rt){if(r.exc)console.log(r.exc);setup_globals(r);setup_viewport();} if(wn.boot){LocalDB.sync(wn.boot.docs);callback(wn.boot,'');if(wn.boot.error_messages) @@ -1233,12 +1233,16 @@ var resize_observers=[] function set_resize_observer(fn){if(resize_observers.indexOf(fn)==-1)resize_observers.push(fn);} window.onresize=function(){return;var ht=get_window_height();for(var i=0;i \ + ' +$(favicon).appendTo('head');} /* * js/app.js */ wn.app={name:'ERPNext',license:'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',source:'https://github.com/webnotes/erpnext',publisher:'Web Notes Technologies Pvt Ltd, Mumbai',copyright:'© Web Notes Technologies Pvt Ltd',version:'2.'+window._version_number} wn.modules_path='erpnext';wn.settings.no_history=true;$(document).bind('ready',function(){startup();});$(document).bind('toolbar_setup',function(){$('.brand').html('erpnext\ - ').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});}) + ').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});}); /* * erpnext/startup/startup.js */ diff --git a/js/app.js b/js/app.js index f2e24bba1e..6555de0c9c 100644 --- a/js/app.js +++ b/js/app.js @@ -38,4 +38,4 @@ $(document).bind('toolbar_setup', function() { }, function() { $(this).find('.icon-home').removeClass('navbar-icon-home-hover'); }); -}) +}); diff --git a/version.num b/version.num index f6e16be538..ae6f1163f2 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -1496 \ No newline at end of file +1507 \ No newline at end of file