From d420401ba3dbaeb6170ff47149ef7d0297cbe59d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 1 Jul 2013 17:15:23 +0530 Subject: [PATCH] [moduleview] added top bar --- accounts/page/accounts_home/accounts_home.js | 1 + buying/page/buying_home/buying_home.js | 1 + hr/page/hr_home/hr_home.js | 35 ++++++++++--------- .../manufacturing_home/manufacturing_home.js | 11 +++--- projects/page/projects_home/projects_home.js | 9 ++++- selling/page/selling_home/selling_home.js | 1 + setup/page/setup/setup.py | 30 ++++++++-------- stock/page/stock_home/stock_home.js | 1 + support/page/support_home/support_home.js | 10 +++++- utilities/doctype/address/address.py | 8 ++--- utilities/doctype/address/address.txt | 4 +-- website/page/website_home/website_home.js | 15 ++++---- 12 files changed, 74 insertions(+), 52 deletions(-) diff --git a/accounts/page/accounts_home/accounts_home.js b/accounts/page/accounts_home/accounts_home.js index f7e476af30..3ca51b8d37 100644 --- a/accounts/page/accounts_home/accounts_home.js +++ b/accounts/page/accounts_home/accounts_home.js @@ -3,6 +3,7 @@ wn.module_page["Accounts"] = [ { + top: true, title: wn._("Documents"), icon: "icon-copy", items: [ diff --git a/buying/page/buying_home/buying_home.js b/buying/page/buying_home/buying_home.js index 0151a60c87..1db8d41d7b 100644 --- a/buying/page/buying_home/buying_home.js +++ b/buying/page/buying_home/buying_home.js @@ -4,6 +4,7 @@ wn.module_page["Buying"] = [ { title: wn._("Documents"), + top: true, icon: "icon-copy", items: [ { diff --git a/hr/page/hr_home/hr_home.js b/hr/page/hr_home/hr_home.js index bee05f6a11..517fb772c4 100644 --- a/hr/page/hr_home/hr_home.js +++ b/hr/page/hr_home/hr_home.js @@ -3,9 +3,15 @@ wn.module_page["HR"] = [ { - title: wn._("Documents"), + title: wn._("Top"), + top: true, icon: "icon-copy", items: [ + { + label: wn._("Employee"), + description: wn._("Employee records."), + doctype:"Employee" + }, { label: wn._("Leave Application"), description: wn._("Applications for leave."), @@ -16,6 +22,17 @@ wn.module_page["HR"] = [ description: wn._("Claims for company expense."), doctype:"Expense Claim" }, + { + label: wn._("Job Applicant"), + description: wn._("Applicant for a Job."), + doctype:"Job Applicant" + }, + ] + }, + { + title: wn._("Documents"), + icon: "icon-copy", + items: [ { label: wn._("Attendance"), description: wn._("Attendance record."), @@ -31,22 +48,6 @@ wn.module_page["HR"] = [ description: wn._("Performance appraisal."), doctype:"Appraisal" }, - { - label: wn._("Job Applicant"), - description: wn._("Applicant for a Job."), - doctype:"Job Applicant" - }, - ] - }, - { - title: wn._("Masters"), - icon: "icon-book", - items: [ - { - label: wn._("Employee"), - description: wn._("Employee records."), - doctype:"Employee" - }, ] }, { diff --git a/manufacturing/page/manufacturing_home/manufacturing_home.js b/manufacturing/page/manufacturing_home/manufacturing_home.js index d4841df2fb..7085f9afdf 100644 --- a/manufacturing/page/manufacturing_home/manufacturing_home.js +++ b/manufacturing/page/manufacturing_home/manufacturing_home.js @@ -4,8 +4,14 @@ wn.module_page["Manufacturing"] = [ { title: wn._("Documents"), + top: true, icon: "icon-copy", items: [ + { + label: wn._("Bill of Materials"), + description: wn._("Bill of Materials (BOM)"), + doctype:"BOM" + }, { label: wn._("Production Order"), description: wn._("Orders released for production."), @@ -29,11 +35,6 @@ wn.module_page["Manufacturing"] = [ title: wn._("Masters"), icon: "icon-book", items: [ - { - label: wn._("Bill of Materials"), - description: wn._("Bill of Materials (BOM)"), - doctype:"BOM" - }, { label: wn._("Item"), description: wn._("All Products or Services."), diff --git a/projects/page/projects_home/projects_home.js b/projects/page/projects_home/projects_home.js index fd13a67367..ea078e8fa8 100644 --- a/projects/page/projects_home/projects_home.js +++ b/projects/page/projects_home/projects_home.js @@ -3,8 +3,9 @@ wn.module_page["Projects"] = [ { - title: wn._("Documents"), + title: wn._("Top"), icon: "icon-copy", + top: true, items: [ { label: wn._("Task"), @@ -21,6 +22,12 @@ wn.module_page["Projects"] = [ description: wn._("Time Log for tasks."), doctype:"Time Log" }, + ] + }, + { + title: wn._("Documents"), + icon: "icon-copy", + items: [ { label: wn._("Time Log Batch"), description: wn._("Batch Time Logs for billing."), diff --git a/selling/page/selling_home/selling_home.js b/selling/page/selling_home/selling_home.js index 388fa42f84..8eae737ddb 100644 --- a/selling/page/selling_home/selling_home.js +++ b/selling/page/selling_home/selling_home.js @@ -3,6 +3,7 @@ wn.module_page["Selling"] = [ { + top: true, title: wn._("Documents"), icon: "icon-copy", items: [ diff --git a/setup/page/setup/setup.py b/setup/page/setup/setup.py index 10fc2a4913..348fce968c 100644 --- a/setup/page/setup/setup.py +++ b/setup/page/setup/setup.py @@ -91,6 +91,19 @@ items = [ }, { "doctype": "Sales Taxes and Charges Master" }, { "doctype": "Purchase Taxes and Charges Master" }, + { + "type": "Section", + "title": "Opening Accounts and Stock", + "icon": "icon-eye-open" + }, + { "doctype": "Stock Reconciliation" }, + { + "doctype": "Journal Voucher", + "title": "Opening Accounting Entries", + "filter": { + "is_opening": "Yes" + } + }, { "type": "Section", "title": "Human Resource", @@ -148,19 +161,6 @@ items = [ { "doctype": "Email Digest", }, - { - "type": "Section", - "title": "Opening Accounts and Stock", - "icon": "icon-eye-open" - }, - { "doctype": "Stock Reconciliation" }, - { - "doctype": "Journal Voucher", - "title": "Opening Accounting Entries", - "filter": { - "is_opening": "Yes" - } - }, { "type": "Section", "title": "Customization", @@ -244,8 +244,8 @@ def set_count(item): elif "filter" in item: key = item["filter"].keys()[0] item["count"] = webnotes.conn.sql("""select count(*) from `tab%s` where - %s = %s""" % (item["doctype"], key, "%s"), + %s = %s and docstatus < 2""" % (item["doctype"], key, "%s"), item["filter"][key])[0][0] elif "doctype" in item: - item["count"] = webnotes.conn.sql("select count(*) from `tab%s`" \ + item["count"] = webnotes.conn.sql("select count(*) from `tab%s` where docstatus<2" \ % item["doctype"])[0][0] diff --git a/stock/page/stock_home/stock_home.js b/stock/page/stock_home/stock_home.js index c92c6fe5f9..b17784fde4 100644 --- a/stock/page/stock_home/stock_home.js +++ b/stock/page/stock_home/stock_home.js @@ -4,6 +4,7 @@ wn.module_page["Stock"] = [ { title: wn._("Documents"), + top: true, icon: "icon-copy", items: [ { diff --git a/support/page/support_home/support_home.js b/support/page/support_home/support_home.js index 65ea4b8fca..ea8474cf88 100644 --- a/support/page/support_home/support_home.js +++ b/support/page/support_home/support_home.js @@ -3,7 +3,8 @@ wn.module_page["Support"] = [ { - title: wn._("Documents"), + title: wn._("Top"), + top: true, icon: "icon-copy", items: [ { @@ -16,6 +17,13 @@ wn.module_page["Support"] = [ description: wn._("Customer Issue against Serial No."), doctype:"Customer Issue" }, + ] + }, + + { + title: wn._("Documents"), + icon: "icon-copy", + items: [ { label: wn._("Maintenance Schedule"), description: wn._("Plan for maintenance visits."), diff --git a/utilities/doctype/address/address.py b/utilities/doctype/address/address.py index c475da12b5..40207663e9 100644 --- a/utilities/doctype/address/address.py +++ b/utilities/doctype/address/address.py @@ -27,13 +27,13 @@ class DocType: def autoname(self): if not self.doc.address_title: - self.doc.address_title = self.doc.customer or self.doc.supplier or self.doc.sales_partner or self.doc.lead - + self.doc.address_title = self.doc.customer \ + or self.doc.supplier or self.doc.sales_partner or self.doc.lead + if self.doc.address_title: self.doc.name = cstr(self.doc.address_title).strip() + "-" + cstr(self.doc.address_type).strip() - else: - webnotes.msgprint("""Address Title is mandatory.""", raise_exception=True) + webnotes.msgprint("""Address Title is mandatory.""" + self.doc.customer, raise_exception=True) def validate(self): self.validate_primary_address() diff --git a/utilities/doctype/address/address.txt b/utilities/doctype/address/address.txt index ed39c759c5..827331d6bc 100644 --- a/utilities/doctype/address/address.txt +++ b/utilities/doctype/address/address.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:32", "docstatus": 0, - "modified": "2013-06-28 17:06:32", + "modified": "2013-07-01 15:56:39", "modified_by": "Administrator", "owner": "Administrator" }, @@ -59,7 +59,7 @@ "fieldname": "address_title", "fieldtype": "Data", "label": "Address Title", - "reqd": 1 + "reqd": 0 }, { "doctype": "DocField", diff --git a/website/page/website_home/website_home.js b/website/page/website_home/website_home.js index fb612df11d..bdedcc9051 100644 --- a/website/page/website_home/website_home.js +++ b/website/page/website_home/website_home.js @@ -5,6 +5,7 @@ wn.module_page["Website"] = [ { title: wn._("Web Content"), icon: "icon-copy", + top: true, items: [ { label: wn._("Web Page"), @@ -12,20 +13,20 @@ wn.module_page["Website"] = [ doctype:"Web Page" }, { - label: wn._("Website Slideshow"), - description: wn._("Embed image slideshows in website pages."), - doctype:"Website Slideshow" + label: wn._("Blog Post"), + description: wn._("Single Post (article)."), + doctype:"Blog Post" }, ] }, { - title: wn._("Blog"), + title: wn._("Documents"), icon: "icon-edit", items: [ { - label: wn._("Blog Post"), - description: wn._("Single Post (article)."), - doctype:"Blog Post" + label: wn._("Website Slideshow"), + description: wn._("Embed image slideshows in website pages."), + doctype:"Website Slideshow" }, { label: wn._("Blogger"),