added number format, sent country info in boot, link options not extracted from cache

This commit is contained in:
Rushabh Mehta 2013-01-21 10:14:10 +05:30
parent 3ab6c5fca9
commit f5b04cff8b
8 changed files with 62 additions and 82 deletions

View File

@ -4,7 +4,7 @@
"docstatus": 0,
"creation": "2013-01-19 10:23:35",
"modified_by": "Administrator",
"modified": "2013-01-19 10:31:03"
"modified": "2013-01-19 10:55:55"
},
{
"read_only": 1,
@ -32,7 +32,7 @@
"doctype": "DocPerm",
"write": 1,
"parenttype": "DocType",
"report": 1,
"report": 0,
"permlevel": 0,
"parentfield": "permissions"
},

View File

@ -151,4 +151,5 @@ patch_list = [
"patches.january_2013.change_patch_structure",
"patches.january_2013.update_country_info",
"patches.january_2013.remove_tds_entry_from_gl_mapper",
"patches.january_2013.update_number_format",
]

View File

@ -1,3 +1,2 @@
cur_frm.cscript.refresh = function(doc) {
cur_frm.set_intro(doc.__islocal ? "" : "There is nothing to edit.")
}

View File

@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2013-01-17 12:30:28",
"creation": "2013-01-19 10:23:31",
"modified_by": "Administrator",
"modified": "2013-01-17 16:24:59"
"modified": "2013-01-19 11:10:45"
},
{
"read_only": 0,
@ -27,8 +27,12 @@
"name": "__common__",
"parent": "Currency",
"read": 1,
"create": 1,
"submit": 0,
"doctype": "DocPerm",
"write": 1,
"parenttype": "DocType",
"report": 1,
"permlevel": 0,
"parentfield": "permissions"
},
@ -63,18 +67,27 @@
"fieldname": "symbol",
"fieldtype": "Data"
},
{
"doctype": "DocField",
"label": "Number Format",
"fieldname": "number_format",
"fieldtype": "Data"
},
{
"cancel": 1,
"role": "Accounts Manager",
"doctype": "DocPerm"
},
{
"amend": 0,
"create": 1,
"doctype": "DocPerm",
"submit": 0,
"write": 1,
"report": 1,
"role": "System Manager",
"role": "Sales Master Manager",
"cancel": 1
},
{
"role": "All",
"doctype": "DocPerm"
"amend": 0,
"doctype": "DocPerm",
"role": "Purchase Master Manager",
"cancel": 0
}
]

View File

@ -94,7 +94,8 @@ def import_country_and_currency():
"currency_name": country.currency,
"fraction": country.currency_fraction,
"symbol": country.currency_symbol,
"fraction_units": country.currency_fraction_units
"fraction_units": country.currency_fraction_units,
"number_format": country.number_format
}).insert()
def import_defaults():

View File

@ -36,20 +36,6 @@ cur_frm.cscript.item_code = function(doc) {
if(!doc.description) cur_frm.set_value("description", doc.item_code);
}
cur_frm.cscript.hide_website_fields = function(doc) {
var website_fields_list = ['page_name', 'website_image', 'web_short_description',
'web_long_description'];
if (doc && cint(doc.show_in_website)) {
unhide_field(website_fields_list);
} else {
hide_field(website_fields_list);
}
}
cur_frm.cscript.show_in_website = function(doc, dt, dn) {
cur_frm.cscript.hide_website_fields(doc);
}
cur_frm.fields_dict['default_bom'].get_query = function(doc) {
//var d = locals[this.doctype][this.docname];
return 'SELECT DISTINCT `tabBOM`.`name` FROM `tabBOM` WHERE `tabBOM`.`item` = "' + doc.item_code + '" AND ifnull(`tabBOM`.`is_active`, 0) = 0 and `tabBOM`.docstatus != 2 AND `tabBOM`.%(key)s LIKE "%s" ORDER BY `tabBOM`.`name` LIMIT 50'

View File

@ -77,7 +77,12 @@ class DocType:
def update_website(self):
from website.utils import update_page_name
update_page_name(self.doc, self.doc.name + " " + self.doc.item_name)
if self.doc.name==self.doc.item_name:
page_name_from = self.doc.name
else:
page_name_from = self.doc.name + " " + self.doc.item_name
update_page_name(self.doc, page_name_from)
from website.helpers.product import invalidate_cache_for
invalidate_cache_for(self.doc.item_group)

View File

@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-28 11:01:35",
"creation": "2013-01-16 11:35:56",
"modified_by": "Administrator",
"modified": "2013-01-16 11:14:57"
"modified": "2013-01-19 12:09:54"
},
{
"allow_attach": 1,
@ -32,8 +32,9 @@
"read": 1,
"submit": 0,
"doctype": "DocPerm",
"report": 1,
"parenttype": "DocType",
"report": 1,
"permlevel": 0,
"parentfield": "permissions"
},
{
@ -431,6 +432,7 @@
"permlevel": 1
},
{
"read_only": 1,
"no_copy": 1,
"oldfieldtype": "Currency",
"doctype": "DocField",
@ -439,7 +441,7 @@
"fieldname": "last_purchase_rate",
"fieldtype": "Currency",
"depends_on": "eval:doc.is_purchase_item==\"Yes\"",
"permlevel": 1
"permlevel": 0
},
{
"oldfieldtype": "Currency",
@ -691,6 +693,7 @@
"permlevel": 0
},
{
"read_only": 1,
"no_copy": 1,
"oldfieldtype": "Link",
"doctype": "DocField",
@ -700,7 +703,7 @@
"fieldname": "default_bom",
"fieldtype": "Link",
"depends_on": "eval:doc.is_manufactured_item==\"Yes\"",
"permlevel": 1
"permlevel": 0
},
{
"description": "Selecting \"Yes\" will allow you to make a Production Order for this item.",
@ -765,21 +768,23 @@
"permlevel": 0
},
{
"read_only": 1,
"description": "website page link",
"depends_on": "show_in_website",
"doctype": "DocField",
"label": "Page Name",
"fieldname": "page_name",
"fieldtype": "Data",
"permlevel": 1
"permlevel": 0
},
{
"description": "Products will be sorted by weight-age in default searches. More the weight-age, higher the product will appear in the list.",
"search_index": 1,
"depends_on": "show_in_website",
"doctype": "DocField",
"label": "Weightage",
"fieldname": "weightage",
"fieldtype": "Int",
"search_index": 1,
"permlevel": 0
},
{
@ -862,57 +867,27 @@
"fieldtype": "Text Editor",
"permlevel": 0
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material Manager",
"cancel": 0
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material User",
"cancel": 0
},
{
"create": 1,
"doctype": "DocPerm",
"write": 1,
"role": "Material Master Manager",
"cancel": 1,
"permlevel": 0
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material Manager",
"cancel": 0,
"permlevel": 0
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material User",
"cancel": 0,
"permlevel": 0
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material Master Manager",
"cancel": 0,
"permlevel": 1
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material Manager",
"cancel": 0,
"permlevel": 1
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material User",
"cancel": 0,
"permlevel": 1
"cancel": 1
}
]