more fixes to perms, floats and default enabled / disabled in search
diff --git a/accounts/doctype/pos_setting/pos_setting.txt b/accounts/doctype/pos_setting/pos_setting.txt
index b4b946f..a91c443 100755
--- a/accounts/doctype/pos_setting/pos_setting.txt
+++ b/accounts/doctype/pos_setting/pos_setting.txt
@@ -1,230 +1,217 @@
[
{
- "owner": "Administrator",
+ "creation": "2013-01-10 16:34:07",
"docstatus": 0,
- "creation": "2012-06-11 12:09:53",
+ "modified": "2013-01-22 16:55:20",
"modified_by": "Administrator",
- "modified": "2012-07-16 16:27:51"
+ "owner": "Administrator"
},
{
- "section_style": "Simple",
- "module": "Accounts",
- "doctype": "DocType",
- "server_code_error": " ",
"autoname": "POS/.####",
- "name": "__common__",
- "colour": "White:FFF",
- "_last_update": "1322549700",
- "show_in_menu": 0,
- "version": 1
+ "doctype": "DocType",
+ "module": "Accounts",
+ "name": "__common__"
},
{
+ "doctype": "DocField",
"name": "__common__",
"parent": "POS Setting",
- "doctype": "DocField",
+ "parentfield": "fields",
+ "parenttype": "DocType",
+ "permlevel": 0
+ },
+ {
+ "doctype": "DocPerm",
+ "name": "__common__",
+ "parent": "POS Setting",
+ "parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
- "parentfield": "fields"
- },
- {
- "name": "__common__",
- "parent": "POS Setting",
"read": 1,
- "doctype": "DocPerm",
- "parenttype": "DocType",
"report": 1,
- "permlevel": 0,
- "parentfield": "permissions"
- },
- {
- "name": "POS Setting",
- "doctype": "DocType"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "User",
- "oldfieldname": "user",
- "fieldname": "user",
- "fieldtype": "Link",
- "options": "Profile"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Territory",
- "oldfieldname": "territory",
- "fieldname": "territory",
- "fieldtype": "Link",
- "reqd": 1,
- "options": "Territory"
- },
- {
- "no_copy": 1,
- "oldfieldtype": "Select",
- "doctype": "DocField",
- "label": "Series",
- "oldfieldname": "naming_series",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "reqd": 1
- },
- {
- "oldfieldtype": "Select",
- "doctype": "DocField",
- "label": "Currency",
- "oldfieldname": "currency",
- "fieldname": "currency",
- "fieldtype": "Select",
- "reqd": 1,
- "options": "link:Currency"
- },
- {
- "default": "1",
- "oldfieldtype": "Currency",
- "colour": "White:FFF",
- "doctype": "DocField",
- "label": "Conversion Rate",
- "oldfieldname": "conversion_rate",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "reqd": 1
- },
- {
- "oldfieldtype": "Select",
- "doctype": "DocField",
- "label": "Price List",
- "oldfieldname": "price_list_name",
- "fieldname": "price_list_name",
- "fieldtype": "Select",
- "reqd": 1,
- "options": "link:Price List"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Company",
- "oldfieldname": "company",
- "fieldname": "company",
- "fieldtype": "Link",
- "reqd": 1,
- "options": "Company"
- },
- {
- "oldfieldtype": "Column Break",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "doctype": "DocField"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Customer Account",
- "oldfieldname": "customer_account",
- "fieldname": "customer_account",
- "fieldtype": "Link",
- "reqd": 0,
- "options": "Account"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Cash/Bank Account",
- "oldfieldname": "cash_bank_account",
- "fieldname": "cash_bank_account",
- "fieldtype": "Link",
- "reqd": 1,
- "options": "Account"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Income Account",
- "oldfieldname": "income_account",
- "fieldname": "income_account",
- "fieldtype": "Link",
- "reqd": 1,
- "options": "Account"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "reqd": 1,
- "options": "Warehouse"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Cost Center",
- "oldfieldname": "cost_center",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "reqd": 1,
- "options": "Cost Center"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Charge",
- "oldfieldname": "charge",
- "fieldname": "charge",
- "fieldtype": "Link",
- "options": "Sales Taxes and Charges Master"
- },
- {
- "print_hide": 1,
- "oldfieldtype": "Select",
- "doctype": "DocField",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "options": "link:Letter Head"
- },
- {
- "oldfieldtype": "Link",
- "doctype": "DocField",
- "label": "Terms and Conditions",
- "oldfieldname": "tc_name",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "options": "Terms and Conditions"
- },
- {
- "oldfieldtype": "Select",
- "doctype": "DocField",
- "label": "Select Print Heading",
- "oldfieldname": "select_print_heading",
- "fieldname": "select_print_heading",
- "fieldtype": "Select",
- "options": "link:Print Heading",
- "in_filter": 0
- },
- {
- "write": 1,
- "create": 1,
- "role": "System Manager",
- "doctype": "DocPerm",
"submit": 0
},
{
- "write": 1,
+ "doctype": "DocType",
+ "name": "POS Setting"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "user",
+ "fieldtype": "Link",
+ "label": "User",
+ "oldfieldname": "user",
+ "oldfieldtype": "Link",
+ "options": "Profile"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "label": "Territory",
+ "oldfieldname": "territory",
+ "oldfieldtype": "Link",
+ "options": "Territory",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "reqd": 1
+ },
+ {
+ "default": "1",
+ "doctype": "DocField",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Conversion Rate",
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "price_list_name",
+ "fieldtype": "Select",
+ "label": "Price List",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "link:Price List",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "customer_account",
+ "fieldtype": "Link",
+ "label": "Customer Account",
+ "oldfieldname": "customer_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "reqd": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "cash_bank_account",
+ "fieldtype": "Link",
+ "label": "Cash/Bank Account",
+ "oldfieldname": "cash_bank_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "income_account",
+ "fieldtype": "Link",
+ "label": "Income Account",
+ "oldfieldname": "income_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "reqd": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "charge",
+ "fieldtype": "Link",
+ "label": "Charge",
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Master"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "link:Letter Head",
+ "print_hide": 1
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms and Conditions",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions"
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "select_print_heading",
+ "fieldtype": "Select",
+ "in_filter": 0,
+ "label": "Select Print Heading",
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Select",
+ "options": "link:Print Heading"
+ },
+ {
"create": 1,
+ "doctype": "DocPerm",
"role": "System Manager",
- "doctype": "DocPerm"
+ "write": 1
},
{
- "write": 1,
"create": 1,
+ "doctype": "DocPerm",
"role": "Accounts Manager",
- "doctype": "DocPerm"
+ "write": 1
},
{
- "role": "Accounts User",
- "doctype": "DocPerm"
+ "doctype": "DocPerm",
+ "role": "Accounts User"
}
]
\ No newline at end of file
diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.txt b/accounts/doctype/purchase_invoice/purchase_invoice.txt
index 444d1a4..49e6e1c 100755
--- a/accounts/doctype/purchase_invoice/purchase_invoice.txt
+++ b/accounts/doctype/purchase_invoice/purchase_invoice.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-21 18:19:17",
"docstatus": 0,
- "modified": "2013-01-22 14:56:42",
+ "modified": "2013-01-22 16:55:20",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -238,11 +238,11 @@
{
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Currency",
"oldfieldname": "currency",
"oldfieldtype": "Select",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1
},
{
diff --git a/accounts/doctype/sales_invoice/sales_invoice.txt b/accounts/doctype/sales_invoice/sales_invoice.txt
index dade4f5..18e5e0a 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.txt
+++ b/accounts/doctype/sales_invoice/sales_invoice.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:08",
"docstatus": 0,
- "modified": "2013-01-22 15:03:42",
+ "modified": "2013-01-22 16:55:23",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -319,9 +319,9 @@
"description": "Select the currency in which price list is maintained",
"doctype": "DocField",
"fieldname": "price_list_currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Price List Currency",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1
},
@@ -343,11 +343,11 @@
{
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Currency",
"oldfieldname": "currency",
"oldfieldtype": "Select",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1
},
diff --git a/buying/doctype/purchase_order/purchase_order.txt b/buying/doctype/purchase_order/purchase_order.txt
index 0bb0b2b..0dd2a53 100644
--- a/buying/doctype/purchase_order/purchase_order.txt
+++ b/buying/doctype/purchase_order/purchase_order.txt
@@ -1,8 +1,8 @@
[
{
- "creation": "2013-01-21 18:19:18",
+ "creation": "2013-01-22 15:11:37",
"docstatus": 0,
- "modified": "2013-01-22 14:56:42",
+ "modified": "2013-01-22 16:55:21",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -242,12 +242,12 @@
"description": "Supplier's currency",
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Currency",
"no_copy": 0,
"oldfieldname": "currency",
"oldfieldtype": "Select",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1
},
diff --git a/buying/doctype/supplier/supplier.txt b/buying/doctype/supplier/supplier.txt
index 14bd2bd..370a16e 100644
--- a/buying/doctype/supplier/supplier.txt
+++ b/buying/doctype/supplier/supplier.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:11",
"docstatus": 0,
- "modified": "2013-01-22 14:57:25",
+ "modified": "2013-01-22 16:55:25",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -162,10 +162,10 @@
"description": "This currency will get fetched in Purchase transactions of this supplier",
"doctype": "DocField",
"fieldname": "default_currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Default Currency",
"no_copy": 1,
- "options": "link:Currency"
+ "options": "Currency"
},
{
"description": "Statutory info and other general information about your Supplier",
diff --git a/buying/doctype/supplier_quotation/supplier_quotation.txt b/buying/doctype/supplier_quotation/supplier_quotation.txt
index d52fe64..6b2970b 100644
--- a/buying/doctype/supplier_quotation/supplier_quotation.txt
+++ b/buying/doctype/supplier_quotation/supplier_quotation.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-21 18:19:20",
"docstatus": 0,
- "modified": "2013-01-22 14:57:25",
+ "modified": "2013-01-22 16:55:26",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -196,12 +196,12 @@
"description": "Supplier's currency",
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Currency",
"no_copy": 0,
"oldfieldname": "currency",
"oldfieldtype": "Select",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1
},
diff --git a/hr/doctype/branch/branch.txt b/hr/doctype/branch/branch.txt
index b5eb4a3..ea20a14 100644
--- a/hr/doctype/branch/branch.txt
+++ b/hr/doctype/branch/branch.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:13",
"docstatus": 0,
- "modified": "2013-01-22 14:18:28",
+ "modified": "2013-01-22 17:36:37",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_rename": 1,
"autoname": "field:branch",
"doctype": "DocType",
"document_type": "Master",
diff --git a/patches/december_2012/enable_currencies.py b/patches/december_2012/enable_currencies.py
new file mode 100644
index 0000000..ed9860f
--- /dev/null
+++ b/patches/december_2012/enable_currencies.py
@@ -0,0 +1,16 @@
+import webnotes
+
+def execute():
+ # get all currencies
+ webnotes.reload_doc("setup", "doctype", "currency")
+ clist = [webnotes.conn.get_default("currency")]
+ for f in webnotes.conn.sql("""select parent, fieldname from tabDocField
+ where options in ('Currency', 'link:Currency')""", as_dict=1):
+ if not webnotes.conn.get_value("DocType", f.parent, "issingle"):
+ clist += [c[0] for c in webnotes.conn.sql("""select distinct `%s`
+ from `tab%s`""" % (f.fieldname, f.parent))]
+
+ clist = list(set(clist))
+ for c in clist:
+ if c:
+ webnotes.conn.sql("""update tabCurrency set `enabled`=1 where name=%s""", c)
diff --git a/patches/patch_list.py b/patches/patch_list.py
index cdaa2ad..8d40839 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -155,4 +155,5 @@
"patches.january_2013.purchase_price_list",
"execute:webnotes.reload_doc('accounts','Print Format','Payment Receipt Voucher')",
"patches.january_2013.update_fraction_for_usd",
+ "patches.january_2013.enable_currencies",
]
\ No newline at end of file
diff --git a/selling/doctype/customer/customer.txt b/selling/doctype/customer/customer.txt
index 0e0b29b..e859342 100644
--- a/selling/doctype/customer/customer.txt
+++ b/selling/doctype/customer/customer.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:18",
"docstatus": 0,
- "modified": "2013-01-22 15:06:09",
+ "modified": "2013-01-22 16:54:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -238,10 +238,10 @@
"description": "This currency will get fetched in Sales transactions of this customer",
"doctype": "DocField",
"fieldname": "default_currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Default Currency",
"no_copy": 1,
- "options": "link:Currency",
+ "options": "Currency",
"permlevel": 0
},
{
diff --git a/selling/doctype/quotation/quotation.txt b/selling/doctype/quotation/quotation.txt
index 5f7c20e..72bc7a7 100644
--- a/selling/doctype/quotation/quotation.txt
+++ b/selling/doctype/quotation/quotation.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:19",
"docstatus": 0,
- "modified": "2013-01-22 14:57:22",
+ "modified": "2013-01-22 16:55:23",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -313,9 +313,9 @@
"description": "Select the currency in which price list is maintained",
"doctype": "DocField",
"fieldname": "price_list_currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Price List Currency",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1
},
@@ -338,12 +338,12 @@
"description": "Customer's currency - If you want to select a currency that is not the default currency, then you must also specify the Currency Conversion Rate.",
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"in_filter": 1,
"label": "Currency",
"oldfieldname": "currency",
"oldfieldtype": "Select",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1,
"search_index": 0,
diff --git a/selling/doctype/sales_order/sales_order.txt b/selling/doctype/sales_order/sales_order.txt
index 47cae4a..159708c 100644
--- a/selling/doctype/sales_order/sales_order.txt
+++ b/selling/doctype/sales_order/sales_order.txt
@@ -1,8 +1,8 @@
[
{
- "creation": "2013-01-10 16:34:20",
+ "creation": "2013-01-22 15:24:17",
"docstatus": 0,
- "modified": "2013-01-22 13:52:58",
+ "modified": "2013-01-22 16:55:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -331,9 +331,9 @@
"description": "Select the currency in which price list is maintained",
"doctype": "DocField",
"fieldname": "price_list_currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Price List Currency",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1
},
@@ -356,11 +356,11 @@
"description": "Customer's currency",
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Currency",
"oldfieldname": "currency",
"oldfieldtype": "Select",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1,
"width": "100px"
diff --git a/setup/doctype/company/company.py b/setup/doctype/company/company.py
index 124c3e4..2aeb966 100644
--- a/setup/doctype/company/company.py
+++ b/setup/doctype/company/company.py
@@ -213,7 +213,9 @@
cc = sql("select name from `tabCost Center` where cost_center_name = 'Root' and company_name = '%s'"%(self.doc.name))
if not cc:
self.create_default_cost_center()
-
+
+ if self.doc.default_currency:
+ webnotes.conn.set_value("Currency", self.doc.default_currency, "enabled", 1)
def on_trash(self):
"""
diff --git a/setup/doctype/company/company.txt b/setup/doctype/company/company.txt
index fc778ce..401f920 100644
--- a/setup/doctype/company/company.txt
+++ b/setup/doctype/company/company.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:22",
"docstatus": 0,
- "modified": "2013-01-22 14:55:58",
+ "modified": "2013-01-22 16:54:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -86,9 +86,9 @@
{
"doctype": "DocField",
"fieldname": "default_currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Default Currency",
- "options": "link:Currency",
+ "options": "Currency",
"reqd": 1
},
{
diff --git a/setup/doctype/currency/currency.js b/setup/doctype/currency/currency.js
index 9a18372..cc0aeb6 100644
--- a/setup/doctype/currency/currency.js
+++ b/setup/doctype/currency/currency.js
@@ -1,2 +1,6 @@
cur_frm.cscript.refresh = function(doc) {
+ cur_frm.set_intro("");
+ if(!cur_frm.doc.enabled) {
+ cur_frm.set_intro(wn._("This Currency is disabled. Enable to use in transactions"))
+ }
}
\ No newline at end of file
diff --git a/setup/doctype/currency/currency_list.js b/setup/doctype/currency/currency_list.js
new file mode 100644
index 0000000..31eadbc
--- /dev/null
+++ b/setup/doctype/currency/currency_list.js
@@ -0,0 +1,19 @@
+wn.doclistviews['Currency'] = wn.views.ListView.extend({
+ init: function(d) {
+ this._super(d)
+ this.fields = this.fields.concat([
+ "`tabCurrency`.enabled",
+ ]);
+ this.stats = this.stats.concat(['enabled']);
+ this.order_by = "`tabCurrency`.`enabled` desc, `tabCurrency`.modified desc";
+ },
+ columns: [
+ {width: '3%', content: 'check'},
+ {width: '5%', content: 'avatar'},
+ {width: '3%', content: "enabled"},
+ {width: '70%', content: 'name'},
+ {width: '20%', content:'modified',
+ css: {'text-align': 'right', 'color': '#777'}},
+
+ ]
+});
\ No newline at end of file
diff --git a/setup/doctype/global_defaults/global_defaults.py b/setup/doctype/global_defaults/global_defaults.py
index 042b9a3..2d57e33 100644
--- a/setup/doctype/global_defaults/global_defaults.py
+++ b/setup/doctype/global_defaults/global_defaults.py
@@ -65,7 +65,11 @@
webnotes.conn.set_default('year_start_date', ysd.strftime('%Y-%m-%d'))
webnotes.conn.set_default('year_end_date', \
get_last_day(get_first_day(ysd,0,11)).strftime('%Y-%m-%d'))
-
+
+ # enable default currency
+ if self.doc.default_currency:
+ webnotes.conn.set_value("Currency", self.doc.default_currency, "enabled", 1)
+
# clear cache
webnotes.clear_cache()
diff --git a/setup/doctype/global_defaults/global_defaults.txt b/setup/doctype/global_defaults/global_defaults.txt
index 2868af4..d380eef 100644
--- a/setup/doctype/global_defaults/global_defaults.txt
+++ b/setup/doctype/global_defaults/global_defaults.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:23",
"docstatus": 0,
- "modified": "2013-01-22 14:56:02",
+ "modified": "2013-01-22 16:54:48",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -101,9 +101,9 @@
"default": "INR",
"doctype": "DocField",
"fieldname": "default_currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Default Currency",
- "options": "link:Currency",
+ "options": "Currency",
"reqd": 1
},
{
diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py
index 86cdc8e..d8227ad 100644
--- a/setup/doctype/setup_control/setup_control.py
+++ b/setup/doctype/setup_control/setup_control.py
@@ -53,6 +53,7 @@
}}
self.create_records(master_dict)
+
# Company
master_dict = {'Company': {
'company_name':args.get('company_name'),
@@ -60,6 +61,10 @@
'default_currency':args.get('currency')
}}
self.create_records(master_dict)
+
+ # enable default currency
+ webnotes.conn.set_value("Currency", args.get("currency"), "enabled", 1)
+
def_args = {
'current_fiscal_year':curr_fiscal_year,
diff --git a/setup/doctype/terms_and_conditions/terms_and_conditions.txt b/setup/doctype/terms_and_conditions/terms_and_conditions.txt
index 9aa2ba2..47a8c4c 100644
--- a/setup/doctype/terms_and_conditions/terms_and_conditions.txt
+++ b/setup/doctype/terms_and_conditions/terms_and_conditions.txt
@@ -2,11 +2,12 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-01-22 14:57:26",
+ "modified": "2013-01-22 17:36:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
+ "allow_rename": 1,
"autoname": "field:title",
"description": "Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.",
"doctype": "DocType",
diff --git a/setup/page/setup/setup.js b/setup/page/setup/setup.js
index aa75893..c0f3378 100644
--- a/setup/page/setup/setup.js
+++ b/setup/page/setup/setup.js
@@ -19,7 +19,7 @@
{
"doctype":"Currency",
"label": wn._("Currency"),
- "description": wn._("Currency Master")
+ "description": wn._("Enable / disable currencies.")
},
]
},
diff --git a/stock/doctype/delivery_note/delivery_note.txt b/stock/doctype/delivery_note/delivery_note.txt
index 3a7d9bf..6aa34b6 100644
--- a/stock/doctype/delivery_note/delivery_note.txt
+++ b/stock/doctype/delivery_note/delivery_note.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:25",
"docstatus": 0,
- "modified": "2013-01-22 14:56:00",
+ "modified": "2013-01-22 16:54:48",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -328,9 +328,9 @@
"description": "Select the currency in which price list is maintained",
"doctype": "DocField",
"fieldname": "price_list_currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Price List Currency",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"read_only": 0,
"reqd": 1
@@ -357,11 +357,11 @@
"description": "Customer's Currency",
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Currency",
"oldfieldname": "currency",
"oldfieldtype": "Select",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"read_only": 0,
"reqd": 1
diff --git a/stock/doctype/item_price/item_price.txt b/stock/doctype/item_price/item_price.txt
index eccae61..04d3a88 100644
--- a/stock/doctype/item_price/item_price.txt
+++ b/stock/doctype/item_price/item_price.txt
@@ -1,79 +1,79 @@
[
{
- "owner": "Administrator",
+ "creation": "2013-01-21 18:19:14",
"docstatus": 0,
- "creation": "2013-01-15 18:43:18",
+ "modified": "2013-01-22 16:54:49",
"modified_by": "Administrator",
- "modified": "2013-01-17 17:53:42"
+ "owner": "Administrator"
},
{
- "read_only": 0,
- "istable": 1,
"autoname": "RFD/.#####",
- "in_create": 1,
"doctype": "DocType",
+ "in_create": 1,
+ "istable": 1,
"module": "Stock",
- "name": "__common__"
+ "name": "__common__",
+ "read_only": 0
},
{
+ "doctype": "DocField",
"name": "__common__",
"parent": "Item Price",
- "doctype": "DocField",
+ "parentfield": "fields",
"parenttype": "DocType",
- "permlevel": 0,
- "parentfield": "fields"
+ "permlevel": 0
},
{
- "name": "Item Price",
- "doctype": "DocType"
+ "doctype": "DocType",
+ "name": "Item Price"
},
{
- "oldfieldtype": "Select",
"doctype": "DocField",
- "label": "Price List Name",
- "oldfieldname": "price_list_name",
"fieldname": "price_list_name",
"fieldtype": "Link",
- "search_index": 1,
- "reqd": 1,
+ "in_filter": 1,
+ "label": "Price List Name",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
"options": "Price List",
- "in_filter": 1
+ "reqd": 1,
+ "search_index": 1
},
{
- "oldfieldtype": "Currency",
"doctype": "DocField",
- "label": "Ref Rate",
- "oldfieldname": "ref_rate",
"fieldname": "ref_rate",
"fieldtype": "Currency",
- "search_index": 0,
+ "in_filter": 1,
+ "label": "Ref Rate",
+ "oldfieldname": "ref_rate",
+ "oldfieldtype": "Currency",
"reqd": 0,
- "in_filter": 1
+ "search_index": 0
},
{
- "oldfieldtype": "Select",
"doctype": "DocField",
+ "fieldname": "ref_currency",
+ "fieldtype": "Link",
+ "in_filter": 1,
"label": "Currency",
"oldfieldname": "ref_currency",
- "fieldname": "ref_currency",
- "fieldtype": "Select",
- "search_index": 1,
+ "oldfieldtype": "Select",
+ "options": "Currency",
"reqd": 1,
- "options": "link:Currency",
- "in_filter": 1
+ "search_index": 1
},
{
"description": "Allow this price in sales related forms",
"doctype": "DocField",
- "label": "For Selling",
"fieldname": "selling",
- "fieldtype": "Check"
+ "fieldtype": "Check",
+ "label": "For Selling"
},
{
"description": "Allow this price in purchase related forms",
"doctype": "DocField",
- "label": "For Buying",
"fieldname": "buying",
- "fieldtype": "Check"
+ "fieldtype": "Check",
+ "label": "For Buying"
}
]
\ No newline at end of file
diff --git a/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt b/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
index fb4483f..4e820a8 100644
--- a/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
+++ b/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:28",
"docstatus": 0,
- "modified": "2013-01-22 14:56:03",
+ "modified": "2013-01-22 16:54:49",
"modified_by": "Administrator",
"owner": "wasim@webnotestech.com"
},
@@ -67,9 +67,9 @@
{
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Currency",
- "options": "link:Currency",
+ "options": "Currency",
"reqd": 1
},
{
diff --git a/stock/doctype/purchase_receipt/purchase_receipt.txt b/stock/doctype/purchase_receipt/purchase_receipt.txt
index d70b14c..df3f6d0 100755
--- a/stock/doctype/purchase_receipt/purchase_receipt.txt
+++ b/stock/doctype/purchase_receipt/purchase_receipt.txt
@@ -1,8 +1,8 @@
[
{
- "creation": "2013-01-21 18:19:24",
+ "creation": "2013-01-22 15:24:18",
"docstatus": 0,
- "modified": "2013-01-22 14:56:43",
+ "modified": "2013-01-22 16:55:22",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -267,11 +267,11 @@
"description": "Supplier's currency",
"doctype": "DocField",
"fieldname": "currency",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Currency",
"oldfieldname": "currency",
"oldfieldtype": "Select",
- "options": "link:Currency",
+ "options": "Currency",
"print_hide": 1,
"reqd": 1
},