mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
fixes to products
This commit is contained in:
@@ -5,12 +5,13 @@ erpnext.make_product_categories = function(wrapper) {
|
|||||||
wrapper.category_list = new wn.widgets.Listing({
|
wrapper.category_list = new wn.widgets.Listing({
|
||||||
parent: $(wrapper).find('.web-side-section').get(0),
|
parent: $(wrapper).find('.web-side-section').get(0),
|
||||||
query: 'select label, count(t2.name) as items, t1.item_group \
|
query: 'select label, count(t2.name) as items, t1.item_group \
|
||||||
from `tabProduct Group` t1, `tabItem` t2\
|
from `tabProduct Group` t1, `tabProduct` t2, tabItem t3\
|
||||||
where t1.parent="Products Settings" \
|
where t1.parent="Products Settings" \
|
||||||
and t2.item_group = t1.item_group \
|
and t2.item = t3.name \
|
||||||
and ifnull(t2.show_in_website, 0)=1 \
|
and t3.item_group = t1.item_group \
|
||||||
group by t2.item_group \
|
and ifnull(t2.published, 0)=1 \
|
||||||
order by t1.idx desc',
|
group by t1.item_group \
|
||||||
|
order by t1.idx',
|
||||||
hide_refresh: true,
|
hide_refresh: true,
|
||||||
render_row: function(parent, data) {
|
render_row: function(parent, data) {
|
||||||
parent.innerHTML = repl('<a href="#!products/%(label)s">%(label)s</a> (%(items)s)',
|
parent.innerHTML = repl('<a href="#!products/%(label)s">%(label)s</a> (%(items)s)',
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ erpnext.products.make_product_list = function(wrapper) {
|
|||||||
t1.page_name, t1.short_description \
|
t1.page_name, t1.short_description \
|
||||||
from tabProduct t1, tabItem t2 \
|
from tabProduct t1, tabItem t2 \
|
||||||
where t1.item = t2.name \
|
where t1.item = t2.name \
|
||||||
|
and ifnull(t1.published,0)=1 \
|
||||||
and t2.item_group="%(cat)s" \
|
and t2.item_group="%(cat)s" \
|
||||||
and t1.short_description like "%%(searchstr)s%"', args)
|
and t1.short_description like "%%(searchstr)s%"', args)
|
||||||
},
|
},
|
||||||
@@ -63,7 +64,7 @@ erpnext.products.make_product_list = function(wrapper) {
|
|||||||
<div style="float:left; width: 400px">\
|
<div style="float:left; width: 400px">\
|
||||||
<b><a href="#!%(page_name)s">%(title)s</a></b>\
|
<b><a href="#!%(page_name)s">%(title)s</a></b>\
|
||||||
<p>%(short_description)s</p></div>\
|
<p>%(short_description)s</p></div>\
|
||||||
<div style="clear: both; margin-bottom: 7px;"></div>', data);
|
<div style="clear: both; margin-bottom: 15px; border-bottom: 1px solid #AAA"></div>', data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -81,4 +82,4 @@ erpnext.products.set_group = function() {
|
|||||||
|
|
||||||
$(wrapper).find('h1').html(cat.label);
|
$(wrapper).find('h1').html(cat.label);
|
||||||
wrapper.mainlist.run();
|
wrapper.mainlist.run();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user