added item specification, bugfix for form grid
diff --git a/setup/doctype/item_group/item_group.txt b/setup/doctype/item_group/item_group.txt
index 653752b..411869b 100644
--- a/setup/doctype/item_group/item_group.txt
+++ b/setup/doctype/item_group/item_group.txt
@@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
- "creation": "2012-12-06 15:57:00",
+ "creation": "2012-12-07 15:15:28",
"modified_by": "Administrator",
- "modified": "2012-12-07 14:55:49"
+ "modified": "2012-12-17 15:00:01"
},
{
"in_create": 1,
@@ -53,7 +53,6 @@
"description": "Check this if you want to show in website",
"no_copy": 0,
"search_index": 0,
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Show in Website",
"fieldname": "show_in_website",
@@ -70,15 +69,21 @@
{
"description": "Items Featured on the Item Group Page",
"depends_on": "show_in_website",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Featured Items",
"fieldname": "featured_items",
"fieldtype": "Table",
+ "hidden": 1,
"options": "Featured Item"
},
{
"doctype": "DocField",
+ "label": "Page Name",
+ "fieldname": "page_name",
+ "fieldtype": "Data"
+ },
+ {
+ "doctype": "DocField",
"fieldname": "cb0",
"fieldtype": "Column Break"
},
@@ -88,7 +93,6 @@
"doctype": "DocField",
"label": "Parent Item Group",
"oldfieldname": "parent_item_group",
- "trigger": "Client",
"fieldname": "parent_item_group",
"fieldtype": "Link",
"search_index": 0,
@@ -99,7 +103,6 @@
"description": "Only leaf nodes are allowed in transaction",
"no_copy": 0,
"oldfieldtype": "Select",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Has Child Node",
"oldfieldname": "is_group",
@@ -152,6 +155,46 @@
"report_hide": 1
},
{
+ "amend": 0,
+ "create": 0,
+ "doctype": "DocPerm",
+ "submit": 0,
+ "write": 0,
+ "cancel": 0,
+ "role": "Material Manager",
+ "permlevel": 1
+ },
+ {
+ "amend": 0,
+ "create": 0,
+ "doctype": "DocPerm",
+ "submit": 0,
+ "write": 0,
+ "cancel": 0,
+ "role": "Material Manager",
+ "permlevel": 0
+ },
+ {
+ "amend": 0,
+ "create": 0,
+ "doctype": "DocPerm",
+ "submit": 0,
+ "write": 0,
+ "cancel": 0,
+ "role": "Material User",
+ "permlevel": 1
+ },
+ {
+ "amend": 0,
+ "create": 0,
+ "doctype": "DocPerm",
+ "submit": 0,
+ "write": 0,
+ "cancel": 0,
+ "role": "Material User",
+ "permlevel": 0
+ },
+ {
"create": 1,
"doctype": "DocPerm",
"write": 1,
@@ -166,45 +209,5 @@
"role": "Material Master Manager",
"cancel": 1,
"permlevel": 0
- },
- {
- "amend": 0,
- "create": 0,
- "doctype": "DocPerm",
- "submit": 0,
- "write": 0,
- "role": "Material Manager",
- "cancel": 0,
- "permlevel": 1
- },
- {
- "amend": 0,
- "create": 0,
- "doctype": "DocPerm",
- "submit": 0,
- "write": 0,
- "role": "Material Manager",
- "cancel": 0,
- "permlevel": 0
- },
- {
- "amend": 0,
- "create": 0,
- "doctype": "DocPerm",
- "submit": 0,
- "write": 0,
- "role": "Material User",
- "cancel": 0,
- "permlevel": 1
- },
- {
- "amend": 0,
- "create": 0,
- "doctype": "DocPerm",
- "submit": 0,
- "write": 0,
- "role": "Material User",
- "cancel": 0,
- "permlevel": 0
}
]
\ No newline at end of file
diff --git a/stock/doctype/item/item.txt b/stock/doctype/item/item.txt
index 1b9bfca..7ab40bd 100644
--- a/stock/doctype/item/item.txt
+++ b/stock/doctype/item/item.txt
@@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
- "creation": "2012-12-17 14:10:03",
+ "creation": "2012-12-17 14:56:32",
"modified_by": "Administrator",
- "modified": "2012-12-17 14:12:10"
+ "modified": "2012-12-17 15:59:19"
},
{
"allow_attach": 1,
@@ -781,6 +781,44 @@
"permlevel": 0
},
{
+ "doctype": "DocField",
+ "fieldname": "cb72",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Show Price in Website (if set)",
+ "doctype": "DocField",
+ "label": "Website Price List",
+ "options": "Price List",
+ "fieldname": "website_price_list",
+ "fieldtype": "Link",
+ "permlevel": 0
+ },
+ {
+ "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.",
+ "doctype": "DocField",
+ "label": "Website Warehouse",
+ "options": "Warehouse",
+ "fieldname": "website_warehouse",
+ "fieldtype": "Link",
+ "permlevel": 0
+ },
+ {
+ "doctype": "DocField",
+ "fieldname": "sb72",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "doctype": "DocField",
+ "label": "Item Website Specifications",
+ "options": "Item Website Specification",
+ "fieldname": "item_website_specifications",
+ "fieldtype": "Table",
+ "permlevel": 0
+ },
+ {
"depends_on": "show_in_website",
"doctype": "DocField",
"label": "Short Description",
@@ -792,7 +830,6 @@
"depends_on": "show_in_website",
"doctype": "DocField",
"label": "Long Description",
- "options": "Markdown",
"fieldname": "web_long_description",
"fieldtype": "Text Editor",
"permlevel": 0
@@ -803,8 +840,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
- "role": "Material Manager",
"cancel": 0,
+ "role": "Material Manager",
"permlevel": 1
},
{
@@ -813,8 +850,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
- "role": "Material Manager",
"cancel": 0,
+ "role": "Material Manager",
"permlevel": 0
},
{
@@ -823,8 +860,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
- "role": "Material User",
"cancel": 0,
+ "role": "Material User",
"permlevel": 1
},
{
@@ -833,8 +870,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
- "role": "Material User",
"cancel": 0,
+ "role": "Material User",
"permlevel": 0
},
{
diff --git a/stock/doctype/item_website_specification/item_website_specification.py b/stock/doctype/item_website_specification/item_website_specification.py
new file mode 100644
index 0000000..928aa9f
--- /dev/null
+++ b/stock/doctype/item_website_specification/item_website_specification.py
@@ -0,0 +1,8 @@
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+class DocType:
+ def __init__(self, d, dl):
+ self.doc, self.doclist = d, dl
\ No newline at end of file
diff --git a/stock/doctype/item_website_specification/item_website_specification.txt b/stock/doctype/item_website_specification/item_website_specification.txt
index 8dc188d..db2bc9f 100644
--- a/stock/doctype/item_website_specification/item_website_specification.txt
+++ b/stock/doctype/item_website_specification/item_website_specification.txt
@@ -4,7 +4,7 @@
"docstatus": 0,
"creation": "2012-12-07 15:42:25",
"modified_by": "Administrator",
- "modified": "2012-12-07 15:44:18"
+ "modified": "2012-12-17 15:29:37"
},
{
"istable": 1,
diff --git a/website/templates/css/product_page.css b/website/templates/css/product_page.css
index 2708625..bf893ca 100644
--- a/website/templates/css/product_page.css
+++ b/website/templates/css/product_page.css
@@ -1,34 +1,9 @@
<style>
+ .item-main-image {
+ max-width: 60%;
+ }
.web-long-description {
font-size: 18px;
line-height: 200%;
}
- .product-page-content {
- float: left;
- }
- /* product page image css */
- .product-page-content img {
- max-width: 100%;
- }
-
- /* similar products listing */
- .similar-products .img-area img {
- max-width: 55px;
- max-height: 55px;
- }
-
- .similar-products .img-area {
- float: left;
- width: 30%;
- margin-top: 0.3em;
- }
-
- .similar-product-description {
- float: left;
- width: 70%;
- }
-
- .similar-product-description span {
- font-size: 12px;
- }
</style>
\ No newline at end of file
diff --git a/website/templates/html/product_page.html b/website/templates/html/product_page.html
index 646bba9..709c3ea 100644
--- a/website/templates/html/product_page.html
+++ b/website/templates/html/product_page.html
@@ -19,30 +19,36 @@
{% block content %}
<div class="layout-wrapper layout-wrapper-background">
<div class="web-content" id="content-product-{{ name }}">
- <div class="layout-main-section">
+ <div class="layout-main" style="padding: 30px;">
<h1>{{ item_name }}</h1>
<div class="product-page-content">
<br><br>
{% if website_image %}
- <image src="files/{{ website_image }}" />
+ <image class="item-main-image" src="files/{{ website_image }}" />
{% else %}
<div class="img-area"></div>
<span style="font-size: 11px">This is an auto-generated Image</span>
{% endif %}
<br><br>
- <div class="web-long-description">
- {{ web_description_html }}
+ <h3>Product Description</h3>
+ <div>
+ {{ web_long_description or web_short_description }}
</div>
+ <hr>
+ {% if obj.doclist.get({"doctype":"Item Website Specification"}) %}
+ <h3>Specifications</h3>
+ <table class="table table-striped table-bordered" style="width: 80%">
+ {% for d in obj.doclist.get(
+ {"doctype":"Item Website Specification"}) %}
+ <tr>
+ <td>{{ d.label }}</td>
+ <td>{{ d.description }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% endif %}
</div>
</div>
- <div class="layout-side-section">
- <h4>More Categories</h4>
- <div class="more-categories"></div>
- <br>
- <h4>Similar Products</h4>
- <div class="similar-products"></div>
- </div>
- <div style="clear: both"></div>
</div>
</div>
{% endblock %}
\ No newline at end of file
diff --git a/website/utils.py b/website/utils.py
index 0fc5f98..198746f 100644
--- a/website/utils.py
+++ b/website/utils.py
@@ -156,13 +156,14 @@
def get_doc_fields(page_name):
doc_type, doc_name = get_source_doc(page_name)
- obj = webnotes.get_obj(doc_type, doc_name)
+ obj = webnotes.get_obj(doc_type, doc_name, with_children=True)
if hasattr(obj, 'prepare_template_args'):
obj.prepare_template_args()
args = obj.doc.fields
args['template'] = page_map[doc_type].template
+ args['obj'] = obj
return args