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 2e5436bb0e..0000000000 --- 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": "\n \n\n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n

FORM No. 16 A

\n

Certificate No:

\n

[See rule 31 (1)(b)]

\n

Certifiction of deduction of tax at source under section 203 of the Income-tax Act, 1961

\n

[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

\n 196C; income of Foreign Institutional Investors from securities referred to in section 196D]\n
Name and address of person deducing taxAcknowledgement No.s of all quarterly statements of TDS under sub-section(3) of section 200 as provided by TIN Facilitation Centre or NSDL web-siteName and address of the person to whom payment is made or in whose account it is credited
\n \n

\n \n
\n
\n \n \n \n

\n \n
\n
\n \n Registration Details OF THE DEDUCTOR
\n \n
\n
\n \n
NATURE OF PAYMENT


\n
\n \n
\n
\n \n PAN NO. OF THE PAYEE
\n \n \n
\n
DETAILS OF PAYMENT, TAX DEDUCTION AND DEPOSIT OF TAX INTO CENTRAL GOVERNMENT ACCOUNT\n

(The deductor is to provide transaction wise details of tax deducted and deposited)

\n
\n \n
\n Certified that a sum of Rs. has been deducted at source and paid to the credit of the Central Government as per details given above



\n

Signature of person responsible for deduction of tax \n

\n \n \n \n \n \n \n \n \n \n
Place: Full Name:
Date: Designation:
\n
\n\n", - "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 0e71487c26..498f811732 100644 --- a/accounts/page/accounts_home/accounts_home.html +++ b/accounts/page/accounts_home/accounts_home.html @@ -123,33 +123,8 @@
-
Tax Deduction (India)
+
India Specific
- - - - -
- Form 16A -
To setup, please go to Setup > Naming Series", "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", @@ -101,6 +104,30 @@ "reqd": 1, "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", @@ -112,26 +139,8 @@ "permlevel": 0, "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", @@ -544,6 +540,21 @@ "fieldtype": "Small Text", "permlevel": 0 }, + { + "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", @@ -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 0000000000..4234d65f58 --- /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 e6a11922f1..b49cd72633 100644 --- a/patches/november_2012/production_order_patch.py +++ b/patches/november_2012/production_order_patch.py @@ -8,5 +8,5 @@ def execute(): 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 32958d7908..17334d9f01 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -560,6 +560,10 @@ patch_list = [ }, { '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 0000000000..35b3f563e1 --- /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 . + +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('%(value)s', + { + 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"' + doc.comment + '"', '#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 0000000000..7dad77afc8 --- /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 . + +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 03b2c734ec..a0039638d0 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 . -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('%(value)s', - { - 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. -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 a53c76b939..0295e32ec7 100644 --- a/support/doctype/support_ticket/__init__.py +++ b/support/doctype/support_ticket/__init__.py @@ -81,7 +81,7 @@ class SupportMailbox(POP3Mailbox): 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 3e607fbb25..3484bf346e 100644 --- a/support/doctype/support_ticket/support_ticket.js +++ b/support/doctype/support_ticket/support_ticket.js @@ -51,6 +51,7 @@ $.extend(cur_frm.cscript, { 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 08bf5cdbec..ae0f2177b6 100644 --- a/utilities/doctype/address/address.py +++ b/utilities/doctype/address/address.py @@ -31,7 +31,8 @@ class DocType: 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 a1a886e74f..61b45b1a76 100644 --- a/utilities/doctype/sms_control/sms_control.py +++ b/utilities/doctype/sms_control/sms_control.py @@ -41,7 +41,7 @@ class DocType: 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 b392f5e79a..daf0318994 100644 --- a/website/css/website.css +++ b/website/css/website.css @@ -65,14 +65,6 @@ p, li { 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 0000000000..e69de29bb2 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 0000000000..a0e8726372 --- /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 0000000000..9facfbb4a1 --- /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 0000000000..e69de29bb2 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 0000000000..928aa9ff9f --- /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 0000000000..a68ddcfb4d --- /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 0000000000..e69de29bb2 diff --git a/website/doctype/company_history/company_history.py b/website/doctype/company_history/company_history.py new file mode 100644 index 0000000000..928aa9ff9f --- /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 0000000000..64fe6c2128 --- /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 b32995b9b3..e4c86b00c6 100644 --- a/website/page/website_home/website_home.html +++ b/website/page/website_home/website_home.html @@ -20,11 +20,11 @@
Product Settings

Settings for Product Catalog on the website.

+
+
About Us Settings
+

Settings for About Us Page.

-
-

Reports

-
diff --git a/website/templates/html/product_group.html b/website/templates/html/product_group.html index 7c22a158ec..feebafe856 100644 --- a/website/templates/html/product_group.html +++ b/website/templates/html/product_group.html @@ -21,7 +21,7 @@
{% for d in sub_groups %} -
+ {% endfor %} diff --git a/website/templates/html/product_missing_image.html b/website/templates/html/product_missing_image.html index 81cc0d8205..3858a131cd 100644 --- a/website/templates/html/product_missing_image.html +++ b/website/templates/html/product_missing_image.html @@ -1 +1 @@ -
\ No newline at end of file +
\ 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 0000000000..f4b6e307f7 --- /dev/null +++ b/website/templates/pages/about.html @@ -0,0 +1,40 @@ +{% extends "html/page.html" %} + +{% block content %} +
+
+ {% if obj.doc.company_introduction %} + {{ obj.doc.company_introduction }} + {% endif %} + {% if obj.doclist.get({"doctype":"Company History"}) %} +

{{ obj.doc.company_history_heading or "Company History" }}

+ + + {% for d in obj.doclist.get({"doctype":"Company History"}) %} + + + + + {% endfor %} + +

{{ d.year }}

{{ d.highlight }}
+ {% endif %} + {% if obj.doclist.get({"doctype":"Employee"}) %} +

{{ obj.doc.team_members_heading or "Team Members" }}

+ + + {% for d in obj.doclist.get({"doctype":"Employee"}) %} + + + + + {% endfor %} + +
+

{{ d.employee_name }}

+ {{ d.bio }}
+ {% endif %} + {{ obj.doc.footer or "" }} +
+
+{% endblock %} \ No newline at end of file diff --git a/website/utils.py b/website/utils.py index 8d24574cf1..52a0898a75 100644 --- a/website/utils.py +++ b/website/utils.py @@ -40,6 +40,10 @@ page_map = { }) } +page_settings_map = { + "about": "About Us Settings" +} + def render(page_name): """render html page""" try: @@ -98,6 +102,10 @@ def update_page_name(doc, title): """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 @@ def prepare_args(page_name): 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)