more fixes to perms, floats and default enabled / disabled in search

This commit is contained in:
Rushabh Mehta 2013-01-23 10:09:28 +05:30
parent efe8102351
commit 6382a42dbe
25 changed files with 330 additions and 290 deletions

View File

@ -1,230 +1,217 @@
[ [
{ {
"owner": "Administrator", "creation": "2013-01-10 16:34:07",
"docstatus": 0, "docstatus": 0,
"creation": "2012-06-11 12:09:53", "modified": "2013-01-22 16:55:20",
"modified_by": "Administrator", "modified_by": "Administrator",
"modified": "2012-07-16 16:27:51" "owner": "Administrator"
}, },
{ {
"section_style": "Simple",
"module": "Accounts",
"doctype": "DocType",
"server_code_error": " ",
"autoname": "POS/.####", "autoname": "POS/.####",
"name": "__common__", "doctype": "DocType",
"colour": "White:FFF", "module": "Accounts",
"_last_update": "1322549700", "name": "__common__"
"show_in_menu": 0,
"version": 1
}, },
{ {
"doctype": "DocField",
"name": "__common__", "name": "__common__",
"parent": "POS Setting", "parent": "POS Setting",
"doctype": "DocField", "parentfield": "fields",
"parenttype": "DocType",
"permlevel": 0
},
{
"doctype": "DocPerm",
"name": "__common__",
"parent": "POS Setting",
"parentfield": "permissions",
"parenttype": "DocType", "parenttype": "DocType",
"permlevel": 0, "permlevel": 0,
"parentfield": "fields"
},
{
"name": "__common__",
"parent": "POS Setting",
"read": 1, "read": 1,
"doctype": "DocPerm",
"parenttype": "DocType",
"report": 1, "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 "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, "create": 1,
"doctype": "DocPerm",
"role": "System Manager", "role": "System Manager",
"doctype": "DocPerm" "write": 1
}, },
{ {
"write": 1,
"create": 1, "create": 1,
"doctype": "DocPerm",
"role": "Accounts Manager", "role": "Accounts Manager",
"doctype": "DocPerm" "write": 1
}, },
{ {
"role": "Accounts User", "doctype": "DocPerm",
"doctype": "DocPerm" "role": "Accounts User"
} }
] ]

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-21 18:19:17", "creation": "2013-01-21 18:19:17",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:56:42", "modified": "2013-01-22 16:55:20",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -238,11 +238,11 @@
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Currency", "label": "Currency",
"oldfieldname": "currency", "oldfieldname": "currency",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Currency", "options": "Currency",
"print_hide": 1 "print_hide": 1
}, },
{ {

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:08", "creation": "2013-01-10 16:34:08",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 15:03:42", "modified": "2013-01-22 16:55:23",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -319,9 +319,9 @@
"description": "Select the currency in which price list is maintained", "description": "Select the currency in which price list is maintained",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "price_list_currency", "fieldname": "price_list_currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Price List Currency", "label": "Price List Currency",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
}, },
@ -343,11 +343,11 @@
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Currency", "label": "Currency",
"oldfieldname": "currency", "oldfieldname": "currency",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
}, },

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-21 18:19:18", "creation": "2013-01-22 15:11:37",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:56:42", "modified": "2013-01-22 16:55:21",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -242,12 +242,12 @@
"description": "Supplier's currency", "description": "Supplier's currency",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Currency", "label": "Currency",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "currency", "oldfieldname": "currency",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
}, },

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:11", "creation": "2013-01-10 16:34:11",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:57:25", "modified": "2013-01-22 16:55:25",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -162,10 +162,10 @@
"description": "This currency will get fetched in Purchase transactions of this supplier", "description": "This currency will get fetched in Purchase transactions of this supplier",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "default_currency", "fieldname": "default_currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Default Currency", "label": "Default Currency",
"no_copy": 1, "no_copy": 1,
"options": "link:Currency" "options": "Currency"
}, },
{ {
"description": "Statutory info and other general information about your Supplier", "description": "Statutory info and other general information about your Supplier",

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-21 18:19:20", "creation": "2013-01-21 18:19:20",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:57:25", "modified": "2013-01-22 16:55:26",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -196,12 +196,12 @@
"description": "Supplier's currency", "description": "Supplier's currency",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Currency", "label": "Currency",
"no_copy": 0, "no_copy": 0,
"oldfieldname": "currency", "oldfieldname": "currency",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
}, },

View File

@ -2,11 +2,12 @@
{ {
"creation": "2013-01-10 16:34:13", "creation": "2013-01-10 16:34:13",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:18:28", "modified": "2013-01-22 17:36:37",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
{ {
"allow_rename": 1,
"autoname": "field:branch", "autoname": "field:branch",
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",

View File

@ -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)

View File

@ -155,4 +155,5 @@ patch_list = [
"patches.january_2013.purchase_price_list", "patches.january_2013.purchase_price_list",
"execute:webnotes.reload_doc('accounts','Print Format','Payment Receipt Voucher')", "execute:webnotes.reload_doc('accounts','Print Format','Payment Receipt Voucher')",
"patches.january_2013.update_fraction_for_usd", "patches.january_2013.update_fraction_for_usd",
"patches.january_2013.enable_currencies",
] ]

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:18", "creation": "2013-01-10 16:34:18",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 15:06:09", "modified": "2013-01-22 16:54:47",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -238,10 +238,10 @@
"description": "This currency will get fetched in Sales transactions of this customer", "description": "This currency will get fetched in Sales transactions of this customer",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "default_currency", "fieldname": "default_currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Default Currency", "label": "Default Currency",
"no_copy": 1, "no_copy": 1,
"options": "link:Currency", "options": "Currency",
"permlevel": 0 "permlevel": 0
}, },
{ {

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:19", "creation": "2013-01-10 16:34:19",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:57:22", "modified": "2013-01-22 16:55:23",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -313,9 +313,9 @@
"description": "Select the currency in which price list is maintained", "description": "Select the currency in which price list is maintained",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "price_list_currency", "fieldname": "price_list_currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Price List Currency", "label": "Price List Currency",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 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.", "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", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"in_filter": 1, "in_filter": 1,
"label": "Currency", "label": "Currency",
"oldfieldname": "currency", "oldfieldname": "currency",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 1, "reqd": 1,
"search_index": 0, "search_index": 0,

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-10 16:34:20", "creation": "2013-01-22 15:24:17",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 13:52:58", "modified": "2013-01-22 16:55:24",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -331,9 +331,9 @@
"description": "Select the currency in which price list is maintained", "description": "Select the currency in which price list is maintained",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "price_list_currency", "fieldname": "price_list_currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Price List Currency", "label": "Price List Currency",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
}, },
@ -356,11 +356,11 @@
"description": "Customer's currency", "description": "Customer's currency",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Currency", "label": "Currency",
"oldfieldname": "currency", "oldfieldname": "currency",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 1, "reqd": 1,
"width": "100px" "width": "100px"

View File

@ -213,7 +213,9 @@ class DocType:
cc = sql("select name from `tabCost Center` where cost_center_name = 'Root' and company_name = '%s'"%(self.doc.name)) cc = sql("select name from `tabCost Center` where cost_center_name = 'Root' and company_name = '%s'"%(self.doc.name))
if not cc: if not cc:
self.create_default_cost_center() 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): def on_trash(self):
""" """

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:22", "creation": "2013-01-10 16:34:22",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:55:58", "modified": "2013-01-22 16:54:47",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -86,9 +86,9 @@
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "default_currency", "fieldname": "default_currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Default Currency", "label": "Default Currency",
"options": "link:Currency", "options": "Currency",
"reqd": 1 "reqd": 1
}, },
{ {

View File

@ -1,2 +1,6 @@
cur_frm.cscript.refresh = function(doc) { 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"))
}
} }

View File

@ -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'}},
]
});

View File

@ -65,7 +65,11 @@ class DocType:
webnotes.conn.set_default('year_start_date', ysd.strftime('%Y-%m-%d')) webnotes.conn.set_default('year_start_date', ysd.strftime('%Y-%m-%d'))
webnotes.conn.set_default('year_end_date', \ webnotes.conn.set_default('year_end_date', \
get_last_day(get_first_day(ysd,0,11)).strftime('%Y-%m-%d')) 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 # clear cache
webnotes.clear_cache() webnotes.clear_cache()

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:23", "creation": "2013-01-10 16:34:23",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:56:02", "modified": "2013-01-22 16:54:48",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -101,9 +101,9 @@
"default": "INR", "default": "INR",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "default_currency", "fieldname": "default_currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Default Currency", "label": "Default Currency",
"options": "link:Currency", "options": "Currency",
"reqd": 1 "reqd": 1
}, },
{ {

View File

@ -53,6 +53,7 @@ class DocType:
}} }}
self.create_records(master_dict) self.create_records(master_dict)
# Company # Company
master_dict = {'Company': { master_dict = {'Company': {
'company_name':args.get('company_name'), 'company_name':args.get('company_name'),
@ -60,6 +61,10 @@ class DocType:
'default_currency':args.get('currency') 'default_currency':args.get('currency')
}} }}
self.create_records(master_dict) self.create_records(master_dict)
# enable default currency
webnotes.conn.set_value("Currency", args.get("currency"), "enabled", 1)
def_args = { def_args = {
'current_fiscal_year':curr_fiscal_year, 'current_fiscal_year':curr_fiscal_year,

View File

@ -2,11 +2,12 @@
{ {
"creation": "2013-01-10 16:34:24", "creation": "2013-01-10 16:34:24",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:57:26", "modified": "2013-01-22 17:36:24",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
{ {
"allow_rename": 1,
"autoname": "field:title", "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.", "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", "doctype": "DocType",

View File

@ -19,7 +19,7 @@ wn.module_page["Setup"] = [
{ {
"doctype":"Currency", "doctype":"Currency",
"label": wn._("Currency"), "label": wn._("Currency"),
"description": wn._("Currency Master") "description": wn._("Enable / disable currencies.")
}, },
] ]
}, },

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:25", "creation": "2013-01-10 16:34:25",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:56:00", "modified": "2013-01-22 16:54:48",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -328,9 +328,9 @@
"description": "Select the currency in which price list is maintained", "description": "Select the currency in which price list is maintained",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "price_list_currency", "fieldname": "price_list_currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Price List Currency", "label": "Price List Currency",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"read_only": 0, "read_only": 0,
"reqd": 1 "reqd": 1
@ -357,11 +357,11 @@
"description": "Customer's Currency", "description": "Customer's Currency",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Currency", "label": "Currency",
"oldfieldname": "currency", "oldfieldname": "currency",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"read_only": 0, "read_only": 0,
"reqd": 1 "reqd": 1

View File

@ -1,79 +1,79 @@
[ [
{ {
"owner": "Administrator", "creation": "2013-01-21 18:19:14",
"docstatus": 0, "docstatus": 0,
"creation": "2013-01-15 18:43:18", "modified": "2013-01-22 16:54:49",
"modified_by": "Administrator", "modified_by": "Administrator",
"modified": "2013-01-17 17:53:42" "owner": "Administrator"
}, },
{ {
"read_only": 0,
"istable": 1,
"autoname": "RFD/.#####", "autoname": "RFD/.#####",
"in_create": 1,
"doctype": "DocType", "doctype": "DocType",
"in_create": 1,
"istable": 1,
"module": "Stock", "module": "Stock",
"name": "__common__" "name": "__common__",
"read_only": 0
}, },
{ {
"doctype": "DocField",
"name": "__common__", "name": "__common__",
"parent": "Item Price", "parent": "Item Price",
"doctype": "DocField", "parentfield": "fields",
"parenttype": "DocType", "parenttype": "DocType",
"permlevel": 0, "permlevel": 0
"parentfield": "fields"
}, },
{ {
"name": "Item Price", "doctype": "DocType",
"doctype": "DocType" "name": "Item Price"
}, },
{ {
"oldfieldtype": "Select",
"doctype": "DocField", "doctype": "DocField",
"label": "Price List Name",
"oldfieldname": "price_list_name",
"fieldname": "price_list_name", "fieldname": "price_list_name",
"fieldtype": "Link", "fieldtype": "Link",
"search_index": 1, "in_filter": 1,
"reqd": 1, "label": "Price List Name",
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
"options": "Price List", "options": "Price List",
"in_filter": 1 "reqd": 1,
"search_index": 1
}, },
{ {
"oldfieldtype": "Currency",
"doctype": "DocField", "doctype": "DocField",
"label": "Ref Rate",
"oldfieldname": "ref_rate",
"fieldname": "ref_rate", "fieldname": "ref_rate",
"fieldtype": "Currency", "fieldtype": "Currency",
"search_index": 0, "in_filter": 1,
"label": "Ref Rate",
"oldfieldname": "ref_rate",
"oldfieldtype": "Currency",
"reqd": 0, "reqd": 0,
"in_filter": 1 "search_index": 0
}, },
{ {
"oldfieldtype": "Select",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "ref_currency",
"fieldtype": "Link",
"in_filter": 1,
"label": "Currency", "label": "Currency",
"oldfieldname": "ref_currency", "oldfieldname": "ref_currency",
"fieldname": "ref_currency", "oldfieldtype": "Select",
"fieldtype": "Select", "options": "Currency",
"search_index": 1,
"reqd": 1, "reqd": 1,
"options": "link:Currency", "search_index": 1
"in_filter": 1
}, },
{ {
"description": "Allow this price in sales related forms", "description": "Allow this price in sales related forms",
"doctype": "DocField", "doctype": "DocField",
"label": "For Selling",
"fieldname": "selling", "fieldname": "selling",
"fieldtype": "Check" "fieldtype": "Check",
"label": "For Selling"
}, },
{ {
"description": "Allow this price in purchase related forms", "description": "Allow this price in purchase related forms",
"doctype": "DocField", "doctype": "DocField",
"label": "For Buying",
"fieldname": "buying", "fieldname": "buying",
"fieldtype": "Check" "fieldtype": "Check",
"label": "For Buying"
} }
] ]

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:28", "creation": "2013-01-10 16:34:28",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:56:03", "modified": "2013-01-22 16:54:49",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "wasim@webnotestech.com" "owner": "wasim@webnotestech.com"
}, },
@ -67,9 +67,9 @@
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Currency", "label": "Currency",
"options": "link:Currency", "options": "Currency",
"reqd": 1 "reqd": 1
}, },
{ {

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-21 18:19:24", "creation": "2013-01-22 15:24:18",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:56:43", "modified": "2013-01-22 16:55:22",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -267,11 +267,11 @@
"description": "Supplier's currency", "description": "Supplier's currency",
"doctype": "DocField", "doctype": "DocField",
"fieldname": "currency", "fieldname": "currency",
"fieldtype": "Select", "fieldtype": "Link",
"label": "Currency", "label": "Currency",
"oldfieldname": "currency", "oldfieldname": "currency",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "link:Currency", "options": "Currency",
"print_hide": 1, "print_hide": 1,
"reqd": 1 "reqd": 1
}, },