From 4337802cdbb37c67164b0193428be8920962cc45 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 16:07:55 +0530 Subject: [PATCH] integrated workflow, disable Submit, Cancel if workflow is defined --- home/page/latest_updates/latest_updates.js | 7 +++ hr/doctype/expense_claim/expense_claim.py | 5 ++ .../leave_application/leave_application.js | 9 ++-- .../leave_application/leave_application.py | 3 ++ .../manufacturing_home.html | 2 +- setup/page/setup/setup.html | 54 ++++++++++--------- 6 files changed, 49 insertions(+), 31 deletions(-) diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js index d8b81bda05..86eb7e9056 100644 --- a/home/page/latest_updates/latest_updates.js +++ b/home/page/latest_updates/latest_updates.js @@ -1,4 +1,11 @@ erpnext.updates = [ + ["28th December 2012", [ + "Workflow: Added System for Multi-level approval before Submission", + ]], + ["27th December 2012", [ + "Website: Added auto-generated Contact Us and About Us Pages", + "Website: Added option to create slideshows and add them to Pages, Products and Product Groups", + ]], ["25th December 2012", [ "Stock Balance Report: Inflow, outflow and balance of stock within a defined period", "Stock Reports: Added Brand filter on some of the reports" diff --git a/hr/doctype/expense_claim/expense_claim.py b/hr/doctype/expense_claim/expense_claim.py index 9e476e5595..b3a132ed45 100644 --- a/hr/doctype/expense_claim/expense_claim.py +++ b/hr/doctype/expense_claim/expense_claim.py @@ -32,6 +32,11 @@ class DocType: def validate(self): # if self.doc.exp_approver == self.doc.owner: # webnotes.msgprint("""Self Approval is not allowed.""", raise_exception=1) + + if self.doc.status not in ("Draft", "Approved", "Rejected"): + webnotes.msgprint("Status must be one of 'Draft', 'Approved' or 'Rejected'", + raise_exception=True) + self.validate_fiscal_year() self.validate_exp_details() diff --git a/hr/doctype/leave_application/leave_application.js b/hr/doctype/leave_application/leave_application.js index b49ed3391f..3c26a51d25 100755 --- a/hr/doctype/leave_application/leave_application.js +++ b/hr/doctype/leave_application/leave_application.js @@ -55,15 +55,14 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { } else { if(doc.status=="Approved") { cur_frm.set_intro("Leave application has been approved."); + if(cur_frm.doc.docstatus==0) { + cur_frm.set_intro("Please submit to update Leave Balance."); + } } else if(doc.status=="Rejected") { cur_frm.set_intro("Leave application has been rejected."); } } - } - - if(doc.status=="Approved" && doc.docstatus==0) { - cur_frm.savesubmit() - } + } } cur_frm.cscript.employee = function (doc, dt, dn){ diff --git a/hr/doctype/leave_application/leave_application.py b/hr/doctype/leave_application/leave_application.py index d945367e79..e61f7b5137 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/hr/doctype/leave_application/leave_application.py @@ -33,6 +33,9 @@ class DocType: def validate(self): # if self.doc.leave_approver == self.doc.owner: # webnotes.msgprint("""Self Approval is not allowed.""", raise_exception=1) + if self.doc.status not in ("Open", "Approved", "Rejected"): + webnotes.msgprint("Status must be one of 'Open', 'Approved' or 'Rejected'", + raise_exception=True) self.validate_to_date() self.validate_balance_leaves() diff --git a/manufacturing/page/manufacturing_home/manufacturing_home.html b/manufacturing/page/manufacturing_home/manufacturing_home.html index b87d30ac6b..201eaeb618 100644 --- a/manufacturing/page/manufacturing_home/manufacturing_home.html +++ b/manufacturing/page/manufacturing_home/manufacturing_home.html @@ -28,7 +28,7 @@
BOM Replace Tool + href="#Form/BOM Replace Tool">BOM Replace Tool
diff --git a/setup/page/setup/setup.html b/setup/page/setup/setup.html index 1b5e967230..1e7607f6c0 100644 --- a/setup/page/setup/setup.html +++ b/setup/page/setup/setup.html @@ -4,45 +4,49 @@

Company

- Companies
+ Companies
List of companies (not customers / suppliers)

- Fiscal Years
+ Fiscal Years
Financial Years for books of accounts

- Currencies
+ Currencies
Currency Master

Users and Permissions

- Users
+ Users
Add/remove users, set roles, passwords etc

- Permission Manager
+ Permission Manager
Set permissions on transactions / masters

- Amount based Authorization Rules
+ Workflow Manager
+ Set workflow rules. +

+

+ Amount based Authorization Rules
Restrict submission rights based on amount

Data

- Data Import Tool
+ Data Import Tool
Import data from spreadsheet (csv) files

- Global Defaults
+ Global Defaults
Set default values for entry

- Recycle Bin
+ Recycle Bin
Un-trash items

@@ -53,75 +57,75 @@

Email and Notifications

- Email Settings
+ Email Settings
Out going mail server and support ticket mailbox

- Auto Notifications
+ Auto Notifications
Automatic email sending to customers and suppliers

- Email Digests
+ Email Digests
Daily, weekly, monthly email Digests

- SMS Setup
+ SMS Setup
Setup outgoing SMS via your bulk SMS provider

- Send Bulk SMS
+ Send Bulk SMS
Send bulk SMS to leads, customers, contacts

Customize ERPNext

- Customize Forms
+ Customize Forms
Change entry properties (hide fields, make mandatory etc)

- Custom Fields
+ Custom Fields
Add fields to forms

- Custom Scripts
+ Custom Scripts
Add custom code to forms

- Disable Features
+ Disable Features
Simplify entry forms by disabling features

- Modules Setup
+ Modules Setup
Show, hide modules

- Numbering Series
+ Numbering Series
Set multiple numbering series for transactions

Branding and Printing

- Letter Heads
+ Letter Heads
Letter heads for print

- Print Formats
+ Print Formats
HTML print formats for quotes, invoices etc

- Print Headings
+ Print Headings
Add headers for standard print formats

- Style Settings
+ Style Settings
Change background fonts etc