added about us page and settings
diff --git a/accounts/Print Format/Form 16A Print Format/Form 16A Print Format.txt b/accounts/Print Format/Form 16A Print Format/Form 16A Print Format.txt
deleted file mode 100644
index 2e5436b..0000000
--- a/accounts/Print Format/Form 16A Print Format/Form 16A Print Format.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2010-09-27 17:30:34",
- "modified_by": "Administrator",
- "modified": "2011-10-19 14:19:27"
- },
- {
- "name": "__common__",
- "module": "Accounts",
- "standard": "Yes",
- "html": "<html>\n <script>\n function get_letter_head() {\n\t// add letter head\n\tvar cp = locals['Control Panel']['Control Panel'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= '';\n\t\t\n\treturn lh;\n}\n </script>\n<body>\n<table border = \"1\" style='border-collapse: collapse;'>\n <tr>\n <td>\n <div style=\"border-bottom: 1px solid; padding-bottom: 5px; width:100%\"><script>get_letter_head()</script></div>\n </td>\n </tr>\n <tr>\n <td colspan = \"3\"><h1 align = \"center\"><b>FORM No. 16 A</b></h1>\n <p align=\"right\">Certificate No:<script>doc.name</script></p>\n <p align = \"center\">[See rule 31 (1)(b)]</p>\n <h2 align = \"center\"><b>Certifiction of deduction of tax at source under section 203 of the Income-tax Act, 1961</b></h2>\n <p>[For interest on securities; dividends; interests other than 'interests on securities';winnings from lottery or crossword puzzle;\n winnings from horse race; payments to contractors and sub-contractors;insurance comission;payments to\n \n non-resident sportsmen/ sports associations;payments in respect of deposits under National Savings Scheme:\n payments on account of repurchase of units by Mutual Fund or Unit Trust of India; commission, remuneration or prize\n \n on sale of lottery tickets; comission or brokerage;rent;fees for professional or technical services;royalty and any sum \n under section 28(va);income in respect of units; payment of compensation on acquisition of certain immovable property;\n\n other sums under section 195; income in respect of units of non-residents referred to in section 196A; income from units\n referred to in section 196B;income from foreign currency bonds or shares of an Indian Company referred to in section</p>\n 196C; income of Foreign Institutional Investors from securities referred to in section 196D]\n </td> \n </tr>\n\n <tr>\n <td width=\"30%\">Name and address of person deducing tax</td>\n <td width=\"40%\">Acknowledgement No.s of all quarterly statements of TDS under sub-section(3) of section 200 as provided by TIN Facilitation Centre or NSDL web-site</td>\n <td width=\"30%\">Name and address of the person to whom payment is made or in whose account it is credited</td>\n </tr>\n \n <tr>\n <td>\n <table>\n <tr><script>doc.company</script></tr><br><br>\n <tr><script>replace_newlines(doc.company_address)</script></tr>\n </table>\n </td>\n <td>\n <script>print_table('Form 16A', doc.name, 'form_16A_ack_details','Form 16A Ack Detail', ['quarter','ack_no'], ['Quarter' , 'Acknowledgement No.'] , ['40%','60%']).innerHTML</script>\n </td>\n <td>\n <table>\n <tr><script>doc.party_name</script></tr><br><br>\n <tr><script>replace_newlines(doc.party_address)</script></tr>\n </table>\n </td>\n </tr>\n \n <tr>\n <td>\n <table>\n <tr><b>Registration Details OF THE DEDUCTOR</b></tr><br>\n <tr><script>replace_newlines(doc.registration_details)</script></tr>\n </table>\n </td>\n \n <td>\n <table>\n <tr><b><center>NATURE OF PAYMENT</center></b></tr><br><br>\n <tr><b><center><script>doc.tds_category</script></center></b></tr>\n \n </table>\n </td>\n \n <td>\n <table>\n <tr><b>PAN NO. OF THE PAYEE</b></tr><br>\n <tr><script>doc.pan_number</script></tr>\n \n </table>\n </td>\n </tr>\n \n <tr>\n <td align = \"center\" colspan =\"3\"><b>DETAILS OF PAYMENT, TAX DEDUCTION AND DEPOSIT OF TAX INTO CENTRAL GOVERNMENT ACCOUNT</b>\n <p align = \"center\">(The deductor is to provide transaction wise details of tax deducted and deposited)</p>\n </tr>\n \n <tr>\n <td colspan=\"3\">\n <script>print_table('Form 16A', doc.name, 'form_16A_tax_details','Form 16A Tax Detail', ['SR','amount_paid', 'date_of_payment','tds_main','surcharge','cess_on_tds','total_tax_deposited','cheque_no','bsr_code','tax_deposited_date','challan_no'], ['S No.' , 'Amount paid / credited','Date of payment / credit','TDS (Rs.)','Surcharge (Rs.)','Cess on TDS(Rs.)','Total Tax Deposited (Rs.)','Cheque/DD no.(if any)','BSR code on bank branch', 'Date on which tax deposited(dd/mm/yy)','Transfer Voucher/Challan Identification no.'] , ['3%', '10%','10%', '10%','10%','6%','10%' ,'10%','7%' ,'10%','7%','7%'] ).innerHTML</script>\n </td>\n </tr>\n \n <tr>\n <td colspan=\"3\">\n Certified that a sum of Rs. <script>doc.total_amount</script> has been deducted at source and paid to the credit of the Central Government as per details given above <br><br><br><br>\n <p align=\"right\"> Signature of person responsible for deduction of tax \n </td>\n </tr>\n \n <tr>\n <td colspan=\"3\">\n <table width=\"100%\" border=\"0\">\n <tr>\n <td width=\"50%\">Place: <script>doc.place</script></td>\n <td width=\"50%\" align=\"right\">Full Name: <script>doc.full_name</script></td>\n </tr>\n <tr>\n <td width=\"50%\">Date: <script>date.str_to_user(doc.dt)</script></td>\n <td width=\"50%\" align=\"right\">Designation: <script>doc.designation</script></td>\n </tr>\n </table>\n </td>\n </tr>\n \n</table>\n</body>\n</html>",
- "doctype": "Print Format"
- },
- {
- "name": "Form 16A Print Format",
- "doctype": "Print Format"
- }
-]
\ No newline at end of file
diff --git a/accounts/page/accounts_home/accounts_home.html b/accounts/page/accounts_home/accounts_home.html
index 0e71487..498f811 100644
--- a/accounts/page/accounts_home/accounts_home.html
+++ b/accounts/page/accounts_home/accounts_home.html
@@ -123,35 +123,10 @@
</div>
<div class="section india-specific">
- <div class="section-head">Tax Deduction (India)</div>
+ <div class="section-head">India Specific</div>
<div class="section-body">
<div class="section-item">
<a class="section-link"
- title = "Tax Deduction at Source (TDS) payments to be made to the goverment"
- href="#List/TDS Payment">TDS Payments</a>
- </div>
- <div class="section-item">
- <a class="section-link"
- title = "Update with acknowledgement recd from the government"
- href="#List/TDS Return Acknowledgement">TDS Return Acknowledgement</a>
- </div>
- <div class="section-item">
- <a class="section-link"
- title = "Tax deduction (TDS) categories"
- href="#List/TDS Category">TDS Category</a>
- </div>
- <div class="section-item">
- <a class="section-link"
- title = "Tax deduction (TDS) rates for different periods"
- href="#List/TDS Rate Chart">TDS Rate Chart</a>
- </div>
- <div class="section-item">
- <a class="section-link"
- title = "Challan given to employees/suppliers whose tax (TDS) has been deducted"
- href="#List/Form 16A">Form 16A</a>
- </div>
- <div class="section-item">
- <a class="section-link"
title = "C-Forms received from customers"
href="#List/C-Form">C-Form</a>
</div>
diff --git a/home/__init__.py b/home/__init__.py
index 436e8ec..e508ac7 100644
--- a/home/__init__.py
+++ b/home/__init__.py
@@ -21,6 +21,7 @@
feed_dict = {
# Project
'Project': ['[%(status)s]', '#000080'],
+ 'Task': ['[%(status)s] %(subject)s', '#000080'],
# Sales
'Lead': ['%(lead_name)s', '#000080'],
@@ -81,8 +82,9 @@
f.full_name = get_fullname(owner)
f.save()
-def update_feed(doc, method=None):
+def update_feed(controller, method=None):
"adds a new feed"
+ doc = controller.doc
if method in ['on_update', 'on_submit']:
subject, color = feed_dict.get(doc.doctype, [None, None])
if subject:
diff --git a/hr/doctype/employee/employee.txt b/hr/doctype/employee/employee.txt
index 826df84..0c48287 100644
--- a/hr/doctype/employee/employee.txt
+++ b/hr/doctype/employee/employee.txt
@@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
- "creation": "2012-11-30 11:49:12",
+ "creation": "2012-12-03 10:13:46",
"modified_by": "Administrator",
- "modified": "2012-11-30 11:54:31"
+ "modified": "2012-12-27 14:45:31"
},
{
"autoname": "naming_series:",
@@ -52,9 +52,16 @@
"permlevel": 0
},
{
+ "doctype": "DocField",
+ "label": "Image View",
+ "options": "image",
+ "fieldname": "image_view",
+ "fieldtype": "Image",
+ "permlevel": 0
+ },
+ {
"print_hide": 1,
"no_copy": 1,
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Employee",
"fieldname": "employee",
@@ -67,32 +74,28 @@
"description": "<span class=\"sys_manager\">To setup, please go to Setup > Naming Series</span>",
"no_copy": 1,
"oldfieldtype": "Select",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Naming Series",
"oldfieldname": "naming_series",
- "permlevel": 0,
+ "options": "EMP/",
"fieldname": "naming_series",
"fieldtype": "Select",
"reqd": 0,
- "options": "EMP/"
+ "permlevel": 0
},
{
"oldfieldtype": "Select",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Salutation",
"oldfieldname": "salutation",
- "trigger": "Client",
+ "options": "\nMr\nMs",
"fieldname": "salutation",
"fieldtype": "Select",
"search_index": 0,
- "options": "\nMr\nMs",
"permlevel": 0
},
{
"oldfieldtype": "Data",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Full Name",
"oldfieldname": "employee_name",
@@ -102,6 +105,30 @@
"permlevel": 0
},
{
+ "doctype": "DocField",
+ "label": "Image",
+ "options": "attach_files:",
+ "fieldname": "image",
+ "fieldtype": "Select",
+ "permlevel": 0
+ },
+ {
+ "doctype": "DocField",
+ "width": "50%",
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "System User (login) ID. If set, it will become default for all HR forms.",
+ "doctype": "DocField",
+ "label": "User ID",
+ "options": "Profile",
+ "fieldname": "user_id",
+ "fieldtype": "Link",
+ "permlevel": 0
+ },
+ {
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "Employee Number",
@@ -113,25 +140,7 @@
"in_filter": 1
},
{
- "description": "System User (login) ID. If set, it will become default for all HR forms.",
- "colour": "White:FFF",
- "doctype": "DocField",
- "label": "User ID",
- "options": "Profile",
- "fieldname": "user_id",
- "fieldtype": "Link",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "width": "50%",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "permlevel": 0
- },
- {
"oldfieldtype": "Date",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Date of Joining",
"oldfieldname": "date_of_joining",
@@ -142,11 +151,9 @@
},
{
"oldfieldtype": "Date",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Date of Birth",
"oldfieldname": "date_of_birth",
- "trigger": "Client",
"fieldname": "date_of_birth",
"fieldtype": "Date",
"search_index": 0,
@@ -194,7 +201,6 @@
{
"default": "Active",
"oldfieldtype": "Select",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Status",
"oldfieldname": "status",
@@ -221,7 +227,6 @@
{
"description": "Applicable Holiday List",
"oldfieldtype": "Link",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Holiday List",
"oldfieldname": "holiday_list",
@@ -249,7 +254,6 @@
},
{
"oldfieldtype": "Date",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Final Confirmation Date",
"oldfieldname": "final_confirmation_date",
@@ -294,7 +298,6 @@
},
{
"oldfieldtype": "Link",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Branch",
"oldfieldname": "branch",
@@ -307,7 +310,6 @@
},
{
"oldfieldtype": "Link",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Department",
"oldfieldname": "department",
@@ -320,21 +322,19 @@
},
{
"oldfieldtype": "Link",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Designation",
"oldfieldname": "designation",
- "permlevel": 0,
+ "options": "Designation",
"fieldname": "designation",
"fieldtype": "Link",
"search_index": 1,
"reqd": 0,
- "options": "Designation",
+ "permlevel": 0,
"in_filter": 1
},
{
"oldfieldtype": "Link",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Grade",
"oldfieldname": "grade",
@@ -378,33 +378,29 @@
},
{
"oldfieldtype": "Select",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Salary Mode",
"oldfieldname": "salary_mode",
- "trigger": "Client",
+ "options": "\nBank\nCash\nCheque",
"fieldname": "salary_mode",
"fieldtype": "Select",
- "options": "\nBank\nCash\nCheque",
"permlevel": 0
},
{
"oldfieldtype": "Link",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Bank Name",
"oldfieldname": "bank_name",
- "permlevel": 0,
+ "options": "Suggest",
"fieldname": "bank_name",
"fieldtype": "Data",
"depends_on": "eval:doc.salary_mode == 'Bank'",
"hidden": 0,
- "options": "Suggest",
+ "permlevel": 0,
"in_filter": 1
},
{
"oldfieldtype": "Data",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Bank A/C No.",
"oldfieldname": "bank_ac_no",
@@ -546,6 +542,21 @@
},
{
"doctype": "DocField",
+ "label": "Bio",
+ "fieldname": "sb53",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Short biography for website and other publications.",
+ "doctype": "DocField",
+ "label": "Bio",
+ "fieldname": "bio",
+ "fieldtype": "Text Editor",
+ "permlevel": 0
+ },
+ {
+ "doctype": "DocField",
"label": "Personal Details",
"fieldname": "personal_details",
"fieldtype": "Section Break",
@@ -588,10 +599,8 @@
},
{
"oldfieldtype": "Button",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Salary Structure",
- "trigger": "Client",
"fieldname": "salary_structure",
"fieldtype": "Button",
"hidden": 1,
@@ -629,7 +638,6 @@
},
{
"description": "Here you can maintain family details like name and occupation of parent, spouse and children",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Family Background",
"fieldname": "family_background",
@@ -638,7 +646,6 @@
},
{
"description": "Here you can maintain height, weight, allergies, medical concerns etc",
- "colour": "White:FFF",
"doctype": "DocField",
"label": "Health Details",
"fieldname": "health_details",
diff --git a/patches/december_2012/delete_form16_print_format.py b/patches/december_2012/delete_form16_print_format.py
new file mode 100644
index 0000000..4234d65
--- /dev/null
+++ b/patches/december_2012/delete_form16_print_format.py
@@ -0,0 +1,3 @@
+import webnotes
+def execute():
+ webnotes.delete_doc("Print Format", "Form 16A Print Format")
\ No newline at end of file
diff --git a/patches/november_2012/production_order_patch.py b/patches/november_2012/production_order_patch.py
index e6a1192..b49cd72 100644
--- a/patches/november_2012/production_order_patch.py
+++ b/patches/november_2012/production_order_patch.py
@@ -8,5 +8,5 @@
set use_multi_level_bom = if(consider_sa_items_as_raw_materials='Yes', 0, 1)""")
webnotes.conn.sql("""update `tabProduction Order`
- set use_multi_level_bom = if(consider_sa_items_as_raw_materials='Yes', 0, 1)
+ set use_multi_level_bom = if(consider_sa_items='Yes', 0, 1)
where use_multi_level_bom is null""")
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 32958d7..17334d9 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -560,6 +560,10 @@
},
{
'patch_module': 'patches.december_2012',
+<<<<<<< HEAD
'patch_file': 'address_title',
+=======
+ 'patch_file': 'delete_form16_print_format',
+>>>>>>> a85b2e4ee349c544acb7a1949351e9a7c70f7b7c
},
]
\ No newline at end of file
diff --git a/public/js/stock_analytics.js b/public/js/stock_analytics.js
new file mode 100644
index 0000000..35b3f56
--- /dev/null
+++ b/public/js/stock_analytics.js
@@ -0,0 +1,196 @@
+// ERPNext - web based ERP (http://erpnext.com)
+// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+wn.require("app/js/stock_grid_report.js");
+
+erpnext.StockAnalytics = erpnext.StockGridReport.extend({
+ init: function(wrapper, opts) {
+ var args = {
+ title: "Stock Analytics",
+ page: wrapper,
+ parent: $(wrapper).find('.layout-main'),
+ appframe: wrapper.appframe,
+ doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
+ "Fiscal Year"],
+ tree_grid: {
+ show: true,
+ parent_field: "parent_item_group",
+ formatter: function(item) {
+ if(!item.is_group) {
+ return repl('<a href="#stock-ledger/item_code=%(enc_value)s">%(value)s</a>',
+ {
+ value: item.name,
+ enc_value: encodeURIComponent(item.name)
+ });
+ } else {
+ return item.name;
+ }
+
+ }
+ },
+ }
+
+ if(opts) $.extend(args, opts);
+
+ this._super(args);
+ },
+ setup_columns: function() {
+ var std_columns = [
+ {id: "check", name: "Plot", field: "check", width: 30,
+ formatter: this.check_formatter},
+ {id: "name", name: "Item", field: "name", width: 300,
+ formatter: this.tree_formatter},
+ {id: "brand", name: "Brand", field: "brand", width: 100},
+ {id: "opening", name: "Opening", field: "opening", hidden: true,
+ formatter: this.currency_formatter}
+ ];
+
+ this.make_date_range_columns();
+ this.columns = std_columns.concat(this.columns);
+ },
+ filters: [
+ {fieldtype:"Select", label: "Value or Qty", options:["Value (Weighted Average)",
+ "Value (FIFO)", "Quantity"],
+ filter: function(val, item, opts, me) {
+ return me.apply_zero_filter(val, item, opts, me);
+ }},
+ {fieldtype:"Select", label: "Brand", link:"Brand",
+ default_value: "Select Brand...", filter: function(val, item, opts) {
+ return val == opts.default_value || item.brand == val || item._show;
+ }},
+ {fieldtype:"Select", label: "Warehouse", link:"Warehouse",
+ default_value: "Select Warehouse..."},
+ {fieldtype:"Date", label: "From Date"},
+ {fieldtype:"Label", label: "To"},
+ {fieldtype:"Date", label: "To Date"},
+ {fieldtype:"Select", label: "Range",
+ options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
+ {fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"},
+ {fieldtype:"Button", label: "Reset Filters"}
+ ],
+ setup_filters: function() {
+ var me = this;
+ this._super();
+
+ this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
+
+ this.show_zero_check();
+ this.setup_plot_check();
+ },
+ init_filter_values: function() {
+ this._super();
+ this.filter_inputs.range && this.filter_inputs.range.val('Monthly');
+ },
+ prepare_data: function() {
+ var me = this;
+
+ if(!this.data) {
+ var items = this.prepare_tree("Item", "Item Group");
+
+ me.parent_map = {};
+ me.item_by_name = {};
+ me.data = [];
+
+ $.each(items, function(i, v) {
+ var d = copy_dict(v);
+
+ me.data.push(d);
+ me.item_by_name[d.name] = d;
+ if(d.parent_item_group) {
+ me.parent_map[d.name] = d.parent_item_group;
+ }
+ me.reset_item_values(d);
+ });
+ this.set_indent();
+ this.data[0].checked = true;
+ } else {
+ // otherwise, only reset values
+ $.each(this.data, function(i, d) {
+ me.reset_item_values(d);
+ });
+ }
+
+ this.prepare_balances();
+ this.update_groups();
+
+ },
+ prepare_balances: function() {
+ var me = this;
+ var from_date = dateutil.str_to_obj(this.from_date);
+ var to_date = dateutil.str_to_obj(this.to_date);
+ var data = wn.report_dump.data["Stock Ledger Entry"];
+
+ this.item_warehouse = {};
+
+ for(var i=0, j=data.length; i<j; i++) {
+ var sl = data[i];
+ sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
+ var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
+
+ if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
+ var item = me.item_by_name[sl.item_code];
+
+ if(me.value_or_qty!="Quantity") {
+ var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
+ var is_fifo = this.value_or_qty== "Value (FIFO)";
+ var diff = me.get_value_diff(wh, sl, is_fifo);
+ } else {
+ var diff = sl.qty;
+ }
+
+ if(posting_datetime < from_date) {
+ item.opening += diff;
+ } else if(posting_datetime <= to_date) {
+ item[me.column_map[sl.posting_date].field] += diff;
+ } else {
+ break;
+ }
+ }
+ }
+ },
+ update_groups: function() {
+ var me = this;
+
+ $.each(this.data, function(i, item) {
+ // update groups
+ if(!item.is_group && me.apply_filter(item, "brand")) {
+ var balance = item.opening;
+ $.each(me.columns, function(i, col) {
+ if(col.formatter==me.currency_formatter && !col.hidden) {
+ item[col.field] = balance + item[col.field];
+ balance = item[col.field];
+ }
+ });
+
+ var parent = me.parent_map[item.name];
+ while(parent) {
+ parent_group = me.item_by_name[parent];
+ $.each(me.columns, function(c, col) {
+ if (col.formatter == me.currency_formatter) {
+ parent_group[col.field] =
+ flt(parent_group[col.field])
+ + flt(item[col.field]);
+ }
+ });
+ parent = me.parent_map[parent];
+ }
+ }
+ });
+ },
+ get_plot_points: function(item, col, idx) {
+ return [[dateutil.user_to_obj(col.name).getTime(), item[col.field]]]
+ }
+});
\ No newline at end of file
diff --git a/selling/doctype/customer/customer.js b/selling/doctype/customer/customer.js
index bb3e0ce..7b5397e 100644
--- a/selling/doctype/customer/customer.js
+++ b/selling/doctype/customer/customer.js
@@ -48,7 +48,7 @@
cur_frm.communication_view = new wn.views.CommunicationList({
list: wn.model.get("Communication", {"customer": doc.name}),
parent: cur_frm.fields_dict.communication_html.wrapper,
- doc: doc
+ doc: doc,
});
}
}
@@ -114,4 +114,4 @@
}
-cur_frm.fields_dict.lead_name.get_query = erpnext.utils.lead_query;
\ No newline at end of file
+cur_frm.fields_dict.lead_name.get_query = erpnext.utils.lead_query;
diff --git a/selling/doctype/lead/lead_list.js b/selling/doctype/lead/lead_list.js
index 227a232..21f0ffd 100644
--- a/selling/doctype/lead/lead_list.js
+++ b/selling/doctype/lead/lead_list.js
@@ -5,6 +5,7 @@
'tabLead.lead_name',
'tabLead.status',
'tabLead.source',
+ 'tabLead.company_name',
'tabLead.modified_by'
]);
this.stats = this.stats.concat(['status', 'source', 'rating', 'company']);
@@ -29,7 +30,8 @@
{width: '5%', content:'avatar_modified'},
{width: '30%', content:'lead_name'},
{width: '12%', content:'status_html'},
- {width: '38%', content:'lead_status+tags', css: {color:'#222'}},
+ {width: '15%', content:'lead_status+tags', css: {color:'#222'}},
+ {width: '23%', content: 'company_name'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
})
diff --git a/startup/event_handlers.py b/startup/event_handlers.py
index 70a66e9..16fb523 100644
--- a/startup/event_handlers.py
+++ b/startup/event_handlers.py
@@ -46,10 +46,6 @@
"""add comment to feed"""
home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
'<i>"' + doc.comment + '"</i>', '#6B24B3')
-
-def doclist_all(doc, method):
- """doclist trigger called from webnotes.model.wrapper on any event"""
- home.update_feed(doc, method)
def boot_session(bootinfo):
"""boot session - send website info if guest"""
diff --git a/startup/observers.py b/startup/observers.py
new file mode 100644
index 0000000..7dad77a
--- /dev/null
+++ b/startup/observers.py
@@ -0,0 +1,20 @@
+# ERPNext - web based ERP (http://erpnext.com)
+# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+observer_map = {
+ "*:on_update": "home.update_feed",
+ "*:on_submit": "home.update_feed",
+}
\ No newline at end of file
diff --git a/stock/page/stock_analytics/stock_analytics.js b/stock/page/stock_analytics/stock_analytics.js
index 03b2c73..a003963 100644
--- a/stock/page/stock_analytics/stock_analytics.js
+++ b/stock/page/stock_analytics/stock_analytics.js
@@ -14,200 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-wn.require("app/js/stock_grid_report.js");
-// done so that it doesn't throw error when inherited in stock-balance report
-if(wn.pages["stock-analytics"]) {
- wn.pages['stock-analytics'].onload = function(wrapper) {
- wn.ui.make_app_page({
- parent: wrapper,
- title: 'Stock Analytics',
- single_column: true
- });
+wn.pages['stock-analytics'].onload = function(wrapper) {
+ wn.ui.make_app_page({
+ parent: wrapper,
+ title: 'Stock Analytics',
+ single_column: true
+ });
- new erpnext.StockAnalytics(wrapper);
+ new erpnext.StockAnalytics(wrapper);
- wrapper.appframe.add_home_breadcrumb()
- wrapper.appframe.add_module_breadcrumb("Stock")
- wrapper.appframe.add_breadcrumb("icon-bar-chart")
- }
+ wrapper.appframe.add_home_breadcrumb()
+ wrapper.appframe.add_module_breadcrumb("Stock")
+ wrapper.appframe.add_breadcrumb("icon-bar-chart")
}
-erpnext.StockAnalytics = erpnext.StockGridReport.extend({
- init: function(wrapper, opts) {
- var args = {
- title: "Stock Analytics",
- page: wrapper,
- parent: $(wrapper).find('.layout-main'),
- appframe: wrapper.appframe,
- doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
- "Fiscal Year"],
- tree_grid: {
- show: true,
- parent_field: "parent_item_group",
- formatter: function(item) {
- if(!item.is_group) {
- return repl('<a href="#stock-ledger/item_code=%(enc_value)s">%(value)s</a>',
- {
- value: item.name,
- enc_value: encodeURIComponent(item.name)
- });
- } else {
- return item.name;
- }
-
- }
- },
- }
-
- if(opts) $.extend(args, opts);
-
- this._super(args);
- },
- setup_columns: function() {
- var std_columns = [
- {id: "check", name: "Plot", field: "check", width: 30,
- formatter: this.check_formatter},
- {id: "name", name: "Item", field: "name", width: 300,
- formatter: this.tree_formatter},
- {id: "brand", name: "Brand", field: "brand", width: 200},
- {id: "opening", name: "Opening", field: "opening", hidden: true,
- formatter: this.currency_formatter}
- ];
-
- this.make_date_range_columns();
- this.columns = std_columns.concat(this.columns);
- },
- filters: [
- {fieldtype:"Select", label: "Value or Qty", options:["Value (Weighted Average)",
- "Value (FIFO)", "Quantity"],
- filter: function(val, item, opts, me) {
- return me.apply_zero_filter(val, item, opts, me);
- }},
- {fieldtype:"Select", label: "Brand", link:"Brand",
- default_value: "Select Brand...", filter: function(val, item, opts) {
- return val == opts.default_value || item.brand == val || item._show;
- }},
- {fieldtype:"Select", label: "Warehouse", link:"Warehouse",
- default_value: "Select Warehouse..."},
- {fieldtype:"Date", label: "From Date"},
- {fieldtype:"Label", label: "To"},
- {fieldtype:"Date", label: "To Date"},
- {fieldtype:"Select", label: "Range",
- options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
- {fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"},
- {fieldtype:"Button", label: "Reset Filters"}
- ],
- setup_filters: function() {
- var me = this;
- this._super();
-
- this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
-
- this.show_zero_check();
- this.setup_plot_check();
- },
- init_filter_values: function() {
- this._super();
- this.filter_inputs.range && this.filter_inputs.range.val('Monthly');
- },
- prepare_data: function() {
- var me = this;
-
- if(!this.data) {
- var items = this.prepare_tree("Item", "Item Group");
-
- me.parent_map = {};
- me.item_by_name = {};
- me.data = [];
-
- $.each(items, function(i, v) {
- var d = copy_dict(v);
-
- me.data.push(d);
- me.item_by_name[d.name] = d;
- if(d.parent_item_group) {
- me.parent_map[d.name] = d.parent_item_group;
- }
- me.reset_item_values(d);
- });
- this.set_indent();
- this.data[0].checked = true;
- } else {
- // otherwise, only reset values
- $.each(this.data, function(i, d) {
- me.reset_item_values(d);
- });
- }
-
- this.prepare_balances();
- this.update_groups();
-
- },
- prepare_balances: function() {
- var me = this;
- var from_date = dateutil.str_to_obj(this.from_date);
- var to_date = dateutil.str_to_obj(this.to_date);
- var data = wn.report_dump.data["Stock Ledger Entry"];
-
- this.item_warehouse = {};
-
- for(var i=0, j=data.length; i<j; i++) {
- var sl = data[i];
- sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
- var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
-
- if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
- var item = me.item_by_name[sl.item_code];
-
- if(me.value_or_qty!="Quantity") {
- var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
- var is_fifo = this.value_or_qty== "Value (FIFO)";
- var diff = me.get_value_diff(wh, sl, is_fifo);
- } else {
- var diff = sl.qty;
- }
-
- if(posting_datetime < from_date) {
- item.opening += diff;
- } else if(posting_datetime <= to_date) {
- item[me.column_map[sl.posting_date].field] += diff;
- } else {
- break;
- }
- }
- }
- },
- update_groups: function() {
- var me = this;
-
- $.each(this.data, function(i, item) {
- // update groups
- if(!item.is_group && me.apply_filter(item, "brand")) {
- var balance = item.opening;
- $.each(me.columns, function(i, col) {
- if(col.formatter==me.currency_formatter && !col.hidden) {
- item[col.field] = balance + item[col.field];
- balance = item[col.field];
- }
- });
-
- var parent = me.parent_map[item.name];
- while(parent) {
- parent_group = me.item_by_name[parent];
- $.each(me.columns, function(c, col) {
- if (col.formatter == me.currency_formatter) {
- parent_group[col.field] =
- flt(parent_group[col.field])
- + flt(item[col.field]);
- }
- });
- parent = me.parent_map[parent];
- }
- }
- });
- },
- get_plot_points: function(item, col, idx) {
- return [[dateutil.user_to_obj(col.name).getTime(), item[col.field]]]
- }
-});
\ No newline at end of file
+wn.require("app/js/stock_analytics.js");
\ No newline at end of file
diff --git a/stock/page/stock_balance/stock_balance.js b/stock/page/stock_balance/stock_balance.js
index 7268aca..3033470 100644
--- a/stock/page/stock_balance/stock_balance.js
+++ b/stock/page/stock_balance/stock_balance.js
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-wn.require("../app/stock/page/stock_analytics/stock_analytics.js");
+wn.require("app/js/stock_analytics.js");
wn.pages['stock-balance'].onload = function(wrapper) {
wn.ui.make_app_page({
diff --git a/support/doctype/support_ticket/__init__.py b/support/doctype/support_ticket/__init__.py
index a53c76b..0295e32 100644
--- a/support/doctype/support_ticket/__init__.py
+++ b/support/doctype/support_ticket/__init__.py
@@ -81,7 +81,7 @@
if exists and exists[0] and exists[0][0]:
st = webnotes.get_obj('Support Ticket', thread_id)
- from support.doctype.communication.communication import make
+ from core.doctype.communication.communication import make
make(content=content, sender=full_email_id, doctype="Support Ticket",
name=thread_id, lead = st.doc.lead, contact=st.doc.contact)
diff --git a/support/doctype/support_ticket/support_ticket.js b/support/doctype/support_ticket/support_ticket.js
index 3e607fb..3484bf3 100644
--- a/support/doctype/support_ticket/support_ticket.js
+++ b/support/doctype/support_ticket/support_ticket.js
@@ -51,6 +51,7 @@
var comm_list = wn.model.get("Communication", {"support_ticket": doc.name})
comm_list.push({
"sender": doc.raised_by,
+ "creation": doc.creation,
"modified": doc.creation,
"content": doc.description});
diff --git a/utilities/doctype/address/address.py b/utilities/doctype/address/address.py
index 08bf5cd..ae0f217 100644
--- a/utilities/doctype/address/address.py
+++ b/utilities/doctype/address/address.py
@@ -31,7 +31,8 @@
self.doc.name = self.doc.supplier + '-' + self.doc.address_type
elif self.doc.sales_partner:
self.doc.name = self.doc.sales_partner + '-' + self.doc.address_type
-
+ elif self.doc.address_title:
+ self.doc.address_title = self.doc.address_title + "-" + self.doc.address_type
def validate(self):
self.validate_for_whom()
diff --git a/utilities/doctype/sms_control/sms_control.py b/utilities/doctype/sms_control/sms_control.py
index a1a886e..61b45b1 100644
--- a/utilities/doctype/sms_control/sms_control.py
+++ b/utilities/doctype/sms_control/sms_control.py
@@ -41,7 +41,7 @@
d = d.replace(x, '')
# mobile no validation for erpnext gateway
- if webnotes.conn.webnotes.conn.get_value('SMS Settings', None, 'sms_gateway_url'):
+ if webnotes.conn.get_value('SMS Settings', None, 'sms_gateway_url'):
mob_no = d
else:
if not d.startswith("0") and len(d) == 10:
diff --git a/website/css/website.css b/website/css/website.css
index b392f5e..daf0318 100644
--- a/website/css/website.css
+++ b/website/css/website.css
@@ -65,14 +65,6 @@
float: left;
}
-.website-missing-image {
- background-color: #eee;
- padding: 40px;
- width: 32px;
- font-size: 32px;
- color: #888;
-}
-
.clear {
clear: both;
}
diff --git a/website/doctype/about_us_settings/__init__.py b/website/doctype/about_us_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/website/doctype/about_us_settings/__init__.py
diff --git a/website/doctype/about_us_settings/about_us_settings.py b/website/doctype/about_us_settings/about_us_settings.py
new file mode 100644
index 0000000..a0e8726
--- /dev/null
+++ b/website/doctype/about_us_settings/about_us_settings.py
@@ -0,0 +1,18 @@
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import webnotes
+from website.utils import url_for_website
+
+class DocType:
+ def __init__(self, d, dl):
+ self.doc, self.doclist = d, dl
+
+ def onload(self):
+ """load employee"""
+ emp_list = []
+ for d in self.doclist.get({"doctype":"About Us Team Member"}):
+ emp = webnotes.doc("Employee", d.employee)
+ emp.image = url_for_website(emp.image)
+ emp_list.append(emp)
+ self.doclist += emp_list
\ No newline at end of file
diff --git a/website/doctype/about_us_settings/about_us_settings.txt b/website/doctype/about_us_settings/about_us_settings.txt
new file mode 100644
index 0000000..9facfbb
--- /dev/null
+++ b/website/doctype/about_us_settings/about_us_settings.txt
@@ -0,0 +1,98 @@
+[
+ {
+ "owner": "Administrator",
+ "docstatus": 0,
+ "creation": "2012-12-27 14:24:35",
+ "modified_by": "Administrator",
+ "modified": "2012-12-27 15:51:11"
+ },
+ {
+ "issingle": 1,
+ "description": "Settings for the About Us Page",
+ "doctype": "DocType",
+ "module": "Website",
+ "document_type": "Master",
+ "name": "__common__"
+ },
+ {
+ "name": "__common__",
+ "parent": "About Us Settings",
+ "doctype": "DocField",
+ "parenttype": "DocType",
+ "permlevel": 0,
+ "parentfield": "fields"
+ },
+ {
+ "parent": "About Us Settings",
+ "read": 1,
+ "name": "__common__",
+ "create": 1,
+ "doctype": "DocPerm",
+ "write": 1,
+ "parenttype": "DocType",
+ "role": "Website Manager",
+ "permlevel": 0,
+ "parentfield": "permissions"
+ },
+ {
+ "name": "About Us Settings",
+ "doctype": "DocType"
+ },
+ {
+ "description": "Introduce your company to the website visitor.",
+ "doctype": "DocField",
+ "label": "Company Introduction",
+ "fieldname": "company_introduction",
+ "fieldtype": "Text Editor"
+ },
+ {
+ "doctype": "DocField",
+ "label": "Company History",
+ "fieldname": "sb0",
+ "fieldtype": "Section Break"
+ },
+ {
+ "description": "\"Company History\"",
+ "doctype": "DocField",
+ "label": "Company History Heading",
+ "fieldname": "company_history_heading",
+ "fieldtype": "Data"
+ },
+ {
+ "doctype": "DocField",
+ "label": "Company History",
+ "fieldname": "company_history",
+ "fieldtype": "Table",
+ "options": "Company History"
+ },
+ {
+ "doctype": "DocField",
+ "label": "Team Members",
+ "fieldname": "sb1",
+ "fieldtype": "Section Break"
+ },
+ {
+ "description": "\"Team Members\" or \"Management\"",
+ "doctype": "DocField",
+ "label": "Team Members Heading",
+ "fieldname": "team_members_heading",
+ "fieldtype": "Data"
+ },
+ {
+ "doctype": "DocField",
+ "label": "Team Members",
+ "fieldname": "team_members",
+ "fieldtype": "Table",
+ "options": "About Us Team Member"
+ },
+ {
+ "description": "More content for the bottom of the page.",
+ "doctype": "DocField",
+ "label": "Footer",
+ "fieldname": "footer",
+ "fieldtype": "Text Editor"
+ },
+ {
+ "doctype": "DocPerm"
+ }
+]
\ No newline at end of file
diff --git a/website/doctype/about_us_team_member/__init__.py b/website/doctype/about_us_team_member/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/website/doctype/about_us_team_member/__init__.py
diff --git a/website/doctype/about_us_team_member/about_us_team_member.py b/website/doctype/about_us_team_member/about_us_team_member.py
new file mode 100644
index 0000000..928aa9f
--- /dev/null
+++ b/website/doctype/about_us_team_member/about_us_team_member.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/website/doctype/about_us_team_member/about_us_team_member.txt b/website/doctype/about_us_team_member/about_us_team_member.txt
new file mode 100644
index 0000000..a68ddcf
--- /dev/null
+++ b/website/doctype/about_us_team_member/about_us_team_member.txt
@@ -0,0 +1,35 @@
+[
+ {
+ "owner": "Administrator",
+ "docstatus": 0,
+ "creation": "2012-12-27 14:28:45",
+ "modified_by": "Administrator",
+ "modified": "2012-12-27 14:49:44"
+ },
+ {
+ "istable": 1,
+ "name": "__common__",
+ "doctype": "DocType",
+ "module": "Website"
+ },
+ {
+ "parent": "About Us Team Member",
+ "doctype": "DocField",
+ "name": "__common__",
+ "label": "Employee",
+ "width": "300px",
+ "parenttype": "DocType",
+ "options": "Employee",
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "permlevel": 0,
+ "parentfield": "fields"
+ },
+ {
+ "name": "About Us Team Member",
+ "doctype": "DocType"
+ },
+ {
+ "doctype": "DocField"
+ }
+]
\ No newline at end of file
diff --git a/website/doctype/company_history/__init__.py b/website/doctype/company_history/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/website/doctype/company_history/__init__.py
diff --git a/website/doctype/company_history/company_history.py b/website/doctype/company_history/company_history.py
new file mode 100644
index 0000000..928aa9f
--- /dev/null
+++ b/website/doctype/company_history/company_history.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/website/doctype/company_history/company_history.txt b/website/doctype/company_history/company_history.txt
new file mode 100644
index 0000000..64fe6c2
--- /dev/null
+++ b/website/doctype/company_history/company_history.txt
@@ -0,0 +1,40 @@
+[
+ {
+ "owner": "Administrator",
+ "docstatus": 0,
+ "creation": "2012-12-27 14:25:38",
+ "modified_by": "Administrator",
+ "modified": "2012-12-27 14:25:38"
+ },
+ {
+ "istable": 1,
+ "name": "__common__",
+ "doctype": "DocType",
+ "module": "Website"
+ },
+ {
+ "name": "__common__",
+ "parent": "Company History",
+ "doctype": "DocField",
+ "parenttype": "DocType",
+ "permlevel": 0,
+ "parentfield": "fields"
+ },
+ {
+ "name": "Company History",
+ "doctype": "DocType"
+ },
+ {
+ "doctype": "DocField",
+ "label": "Year",
+ "fieldname": "year",
+ "fieldtype": "Data"
+ },
+ {
+ "doctype": "DocField",
+ "label": "Highlight",
+ "width": "300px",
+ "fieldname": "highlight",
+ "fieldtype": "Text"
+ }
+]
\ No newline at end of file
diff --git a/website/page/website_home/website_home.html b/website/page/website_home/website_home.html
index b32995b..e4c86b0 100644
--- a/website/page/website_home/website_home.html
+++ b/website/page/website_home/website_home.html
@@ -20,11 +20,11 @@
<br>
<h5><a href="#Form/Product Settings">Product Settings</a></h5>
<p class="help">Settings for Product Catalog on the website.</p>
+ <br>
+ <h5><a href="#Form/About Us Settings">About Us Settings</a></h5>
+ <p class="help">Settings for About Us Page.</p>
</div>
<div style="clear: both"></div>
- <hr>
- <h3>Reports</h3>
- <div class="reports-list"></div>
</div>
<div class="layout-side-section">
<div class="psidebar">
diff --git a/website/templates/html/product_group.html b/website/templates/html/product_group.html
index 7c22a15..feebafe 100644
--- a/website/templates/html/product_group.html
+++ b/website/templates/html/product_group.html
@@ -21,7 +21,7 @@
<div class="well well-small">
<div class="container-fluid" style="padding-left: 0px; margin-left:-10px; line-height: 2em;">
{% for d in sub_groups %}
- <div class="span2">
+ <div class="span4">
<a href="{{ d.page_name }}">{{ d.name }} ({{ d.count }})</a>
</div>
{% endfor %}
diff --git a/website/templates/html/product_missing_image.html b/website/templates/html/product_missing_image.html
index 81cc0d8..3858a13 100644
--- a/website/templates/html/product_missing_image.html
+++ b/website/templates/html/product_missing_image.html
@@ -1 +1 @@
-<div class='website-missing-image'><i class='icon-camera'></i></div>
\ No newline at end of file
+<div class='missing-image'><i class='icon-camera'></i></div>
\ No newline at end of file
diff --git a/website/templates/pages/about.html b/website/templates/pages/about.html
new file mode 100644
index 0000000..f4b6e30
--- /dev/null
+++ b/website/templates/pages/about.html
@@ -0,0 +1,40 @@
+{% extends "html/page.html" %}
+
+{% block content %}
+<div class="layout-wrapper">
+ <div class="layout-main">
+ {% if obj.doc.company_introduction %}
+ {{ obj.doc.company_introduction }}
+ {% endif %}
+ {% if obj.doclist.get({"doctype":"Company History"}) %}
+ <h3>{{ obj.doc.company_history_heading or "Company History" }}</h3>
+ <table class="table table-bordered" style="width: 100%; table-layout: fixed">
+ <tbody>
+ {% for d in obj.doclist.get({"doctype":"Company History"}) %}
+ <tr>
+ <td style="width: 30%; text-align: right"><h4>{{ d.year }}</h4></td>
+ <td>{{ d.highlight }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endif %}
+ {% if obj.doclist.get({"doctype":"Employee"}) %}
+ <h3>{{ obj.doc.team_members_heading or "Team Members" }}</h3>
+ <table class="table table-bordered" style="width: 100%; table-layout: fixed">
+ <tbody>
+ {% for d in obj.doclist.get({"doctype":"Employee"}) %}
+ <tr>
+ <td style="text-align:right; width: 30%;">
+ <img src="{{ d.image }}" style=""></td>
+ <td><h4>{{ d.employee_name }}</h4>
+ {{ d.bio }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endif %}
+ {{ obj.doc.footer or "" }}
+ </div>
+</div>
+{% endblock %}
\ No newline at end of file
diff --git a/website/utils.py b/website/utils.py
index 8d24574..52a0898 100644
--- a/website/utils.py
+++ b/website/utils.py
@@ -40,6 +40,10 @@
})
}
+page_settings_map = {
+ "about": "About Us Settings"
+}
+
def render(page_name):
"""render html page"""
try:
@@ -98,6 +102,10 @@
"""set page_name and check if it is unique"""
webnotes.conn.set(doc, "page_name", page_name(title))
+ standard_pages = get_template_pages()
+ if doc.page_name in standard_pages:
+ webnotes.conn.sql("""Page Name cannot be one of %s""" % ', '.join(standard_pages))
+
res = webnotes.conn.sql("""\
select count(*) from `tab%s`
where page_name=%s and name!=%s""" % (doc.doctype, '%s', '%s'),
@@ -135,10 +143,12 @@
page_name = get_home_page()
if page_name in get_template_pages():
- args = {
+ args = webnotes._dict({
'template': 'pages/%s.html' % page_name,
'name': page_name,
- }
+ })
+ if page_name in page_settings_map:
+ args.obj = webnotes.model_wrapper(page_settings_map[page_name]).obj
else:
args = get_doc_fields(page_name)