Merge branch 'master' into sales_purchase_return

This commit is contained in:
Anand Doshi 2013-03-14 12:07:39 +05:30
commit 0a1ac4090c
6 changed files with 82 additions and 32 deletions

View File

@ -210,7 +210,6 @@ patch_list = [
"execute:webnotes.delete_doc('DocType', 'Attendance Control Panel')", "execute:webnotes.delete_doc('DocType', 'Attendance Control Panel')",
"patches.march_2013.p02_get_global_default", "patches.march_2013.p02_get_global_default",
"patches.march_2013.p03_rename_blog_to_blog_post", "patches.march_2013.p03_rename_blog_to_blog_post",
"execute:webnotes.bean('Style Settings', 'Style Settings').save()",
"execute:webnotes.reload_doc('hr', 'search_criteria', 'monthly_attendance_details')", "execute:webnotes.reload_doc('hr', 'search_criteria', 'monthly_attendance_details')",
"patches.march_2013.p04_pos_update_stock_check", "patches.march_2013.p04_pos_update_stock_check",
] ]

View File

@ -166,22 +166,24 @@ pscript.feature_dict = {
'Address': {'fields':['sales_partner']}, 'Address': {'fields':['sales_partner']},
'Contact': {'fields':['sales_partner']}, 'Contact': {'fields':['sales_partner']},
'Customer': {'fields':['sales_team']}, 'Customer': {'fields':['sales_team']},
'Delivery Note': {'fields':['sales_team','Packing List']}, 'Delivery Note': {'fields':['sales_team','packing_list']},
'Item': {'fields':['item_customer_details']}, 'Item': {'fields':['item_customer_details']},
'Sales Invoice': {'fields':['sales_team']}, 'Sales Invoice': {'fields':['sales_team', 'packing_list']},
'Sales Order': {'fields':['sales_team','Packing List']} 'Sales Order': {'fields':['sales_team','packing_list']}
}, },
'fs_more_info': { 'fs_more_info': {
'Delivery Note': {'fields':['More Info']}, "Customer Issue": {"fields": ["more_info"]},
'Opportunity': {'fields':['More Info']}, 'Material Request': {'fields':['more_info']},
'Material Request': {'fields':['More Info']}, 'Lead': {'fields':['more_info']},
'Lead': {'fields':['More Info']}, 'Opportunity': {'fields':['more_info']},
'Purchase Invoice': {'fields':['More Info']}, 'Purchase Invoice': {'fields':['more_info']},
'Purchase Order': {'fields':['More Info']}, 'Purchase Order': {'fields':['more_info']},
'Purchase Receipt': {'fields':['More Info']}, 'Purchase Receipt': {'fields':['more_info']},
'Quotation': {'fields':['More Info']}, 'Supplier Quotation': {'fields':['more_info']},
'Sales Invoice': {'fields':['More Info']}, 'Quotation': {'fields':['more_info']},
'Sales Order': {'fields':['More Info']}, 'Sales Invoice': {'fields':['more_info']},
'Sales Order': {'fields':['more_info']},
'Delivery Note': {'fields':['more_info']},
}, },
'fs_quality': { 'fs_quality': {
'Item': {'fields':['Item Inspection Criteria','inspection_required']}, 'Item': {'fields':['Item Inspection Criteria','inspection_required']},
@ -199,25 +201,23 @@ pscript.feature_dict = {
} }
$(document).bind('form_refresh', function() { $(document).bind('form_refresh', function() {
for(sys_feat in sys_defaults) for(sys_feat in sys_defaults) {
{ if(sys_defaults[sys_feat]=='0'
if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists && (sys_feat in pscript.feature_dict)) { //"Features to hide" exists
{
if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat]) if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat]) {
{ for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype]) {
for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype]) if(fort=='fields') {
{
if(fort=='fields')
hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]); hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
else if(cur_frm.fields_dict[fort]) } else if(cur_frm.fields_dict[fort]) {
{
for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]) for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort])
cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false); cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false);
} } else {
else
msgprint('Grid "'+fort+'" does not exists'); msgprint('Grid "'+fort+'" does not exists');
} }
} }
} }
}
} }
}) })

View File

@ -53,11 +53,13 @@ div.outer {
border-radius: 5px; border-radius: 5px;
} }
{% else %} {% else %}
{% if doc.background_color == doc.page_background %}
div.web-footer { div.web-footer {
border-top: 1px solid #{{ get_hex_shade(doc.page_background or "ffffff", 15) }}; border-top: 1px solid #{{ get_hex_shade(doc.page_background or "ffffff", 15) }};
padding-top: 10px; padding-top: 10px;
} }
{% endif %} {% endif %}
{% endif %}
/* Bootstrap Navbar */ /* Bootstrap Navbar */
.navbar-inverse .navbar-inner { .navbar-inverse .navbar-inner {
@ -67,6 +69,14 @@ div.web-footer {
background-image: none; background-image: none;
} }
.navbar-inner {
box-shadow: none;
}
{% if doc.top_bar_background == doc.page_background %}.navbar-inner {
border-bottom: 1px solid #{{ get_hex_shade(doc.page_background or "ffffff", 15) }};
}{% endif %}
.navbar-inverse .brand, .navbar-inverse .brand,
.navbar-inverse .brand:hover, .navbar-inverse .brand:hover,
.navbar-inverse .brand:focus, .navbar-inverse .brand:focus,
@ -172,9 +182,22 @@ div.web-footer {
} }
.breadcrumb { .breadcrumb {
background-color: #{{ get_hex_shade(doc.page_background or "ffffff", 5) }}; background-color: #{{ get_hex_shade(doc.page_background or "ffffff", 10) }};
} }
.breadcrumb > li {
text-shadow: none;
}
.breadcrumb > li > .divider {
color: #{{ doc.page_text }};
}
.breadcrumb > .active {
color: #{{ doc.page_text }};
}
.table-striped tbody > tr:nth-child(odd) > td, .table-striped tbody > tr:nth-child(odd) > td,
.table-striped tbody > tr:nth-child(odd) > th { .table-striped tbody > tr:nth-child(odd) > th {
background-color: #{{ get_hex_shade(doc.page_background or "ffffff", 5) }}; background-color: #{{ get_hex_shade(doc.page_background or "ffffff", 5) }};

View File

@ -42,3 +42,13 @@ $.extend(cur_frm.cscript, {
}); });
} }
}); });
cur_frm.cscript.set_banner_from_image = function(doc) {
if(!doc.banner_image) {
msgprint(wn._("Select a Banner Image first."));
}
var src = doc.banner_image;
if(src.indexOf("/")==-1) src = "files/" + src;
cur_frm.set_value("banner_html", "<a href='/'><img src='"+ src
+"'></a>");
}

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-03-07 11:55:11", "creation": "2013-03-07 11:55:11",
"docstatus": 0, "docstatus": 0,
"modified": "2013-03-12 11:17:11", "modified": "2013-03-13 16:25:22",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -78,6 +78,20 @@
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Banner" "label": "Banner"
}, },
{
"description": "Select an image of approx width 150px with a transparent background for best results.",
"doctype": "DocField",
"fieldname": "banner_image",
"fieldtype": "Select",
"label": "Banner Image",
"options": "attach_files:"
},
{
"doctype": "DocField",
"fieldname": "set_banner_from_image",
"fieldtype": "Button",
"label": "Set Banner from Image"
},
{ {
"description": "Banner is above the Top Menu Bar.", "description": "Banner is above the Top Menu Bar.",
"doctype": "DocField", "doctype": "DocField",

View File

@ -46,6 +46,8 @@ page_settings_map = {
"writers": "website.helpers.blog.get_writers_args" "writers": "website.helpers.blog.get_writers_args"
} }
no_cache = "message"
def render(page_name): def render(page_name):
"""render html page""" """render html page"""
try: try:
@ -68,10 +70,12 @@ def get_html(page_name):
# load from cache, if auto cache clear is falsy # load from cache, if auto cache clear is falsy
if not (hasattr(conf, 'auto_cache_clear') and conf.auto_cache_clear or 0): if not (hasattr(conf, 'auto_cache_clear') and conf.auto_cache_clear or 0):
if not page_name in no_cache:
html = webnotes.cache().get_value("page:" + page_name) html = webnotes.cache().get_value("page:" + page_name)
from_cache = True from_cache = True
if not html: if not html:
webnotes.connect()
html = load_into_cache(page_name) html = load_into_cache(page_name)
from_cache = False from_cache = False