fixes to products

This commit is contained in:
Rushabh Mehta
2012-02-07 11:43:41 +05:30
parent f35992f695
commit 8b96b05163
4 changed files with 11 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
<div class="web-main-section">
<h1 class="products-category"></h1>
<div class="products-search">
<input name="products-search" /><button class="btn">Search</button>
<input name="products-search" /><button class="btn" style="margin-left: 7px">Search</button>
</div>
</div>
<div class="web-side-section">

View File

@@ -46,8 +46,11 @@ erpnext.products.make_product_list = function(wrapper) {
run_btn: $(wrapper).find('.products-search .btn').get(0),
hide_refresh: true,
get_query: function() {
var srch = $('input[name="products-search"]').val()
var search_cond = 'and (t1.short_description like "%%(srch)s%"\
or t1.title like "%%(srch)s%")';
args = {
searchstr: $('input[name="products-search"]').val() || '',
search_cond: srch ? repl(search_cond, {srch:srch}) : '',
cat: erpnext.products.cur_group
};
return repl('select t1.name, t1.title, t1.thumbnail_image, \
@@ -55,7 +58,7 @@ erpnext.products.make_product_list = function(wrapper) {
from tabProduct t1, tabItem t2 \
where t1.item = t2.name \
and t2.item_group="%(cat)s" \
and t1.short_description like "%%(searchstr)s%"', args)
%(search_cond)s', args)
},
render_row: function(parent, data) {
parent.innerHTML = repl('<div style="float:left; width: 115px;">\