From a6eb15df4a29a659a47341cf26b63543e016d3c0 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 3 Apr 2012 13:22:20 +0530 Subject: [PATCH 1/6] 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 2/6] 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 3/6] 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 4/6] 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 5/6] 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 6/6] 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']); } }