From 7247e793107debea366d8e6b14db931b80198f6d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 13:02:38 +0530 Subject: [PATCH 1/8] added workflow --- support/doctype/support_ticket/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/doctype/support_ticket/__init__.py b/support/doctype/support_ticket/__init__.py index 0295e32ec7..2473bbcdd1 100644 --- a/support/doctype/support_ticket/__init__.py +++ b/support/doctype/support_ticket/__init__.py @@ -89,7 +89,7 @@ class SupportMailbox(POP3Mailbox): st.doc.status = 'Open' st.doc.save() - update_feed(st.doc, 'on_update') + update_feed(st, 'on_update') # extract attachments self.save_attachments(st.doc, mail.attachments) return From d2744e7461874371852ad8f8ab4a5555422fd7af Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 13:04:46 +0530 Subject: [PATCH 2/8] support_ticket: update_feed fix --- support/doctype/support_ticket/support_ticket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/doctype/support_ticket/support_ticket.py b/support/doctype/support_ticket/support_ticket.py index 89a58a6860..0f4a25eeb7 100644 --- a/support/doctype/support_ticket/support_ticket.py +++ b/support/doctype/support_ticket/support_ticket.py @@ -50,11 +50,11 @@ class DocType(TransactionBase): def close_ticket(self): webnotes.conn.set(self.doc,'status','Closed') - update_feed(self.doc) + update_feed(self) def reopen_ticket(self): webnotes.conn.set(self.doc,'status','Open') - update_feed(self.doc) + update_feed(self) def on_trash(self): webnotes.conn.sql("""update `tabCommunication` set support_ticket=NULL From 056d1723e7c153be43018f19753e3c29d8ce7148 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 13:26:08 +0530 Subject: [PATCH 3/8] support ticket fix --- home/__init__.py | 2 +- support/doctype/support_ticket/__init__.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/home/__init__.py b/home/__init__.py index e508ac70fb..9667efd212 100644 --- a/home/__init__.py +++ b/home/__init__.py @@ -87,5 +87,5 @@ def update_feed(controller, method=None): doc = controller.doc if method in ['on_update', 'on_submit']: subject, color = feed_dict.get(doc.doctype, [None, None]) - if subject: + if subject: make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color) diff --git a/support/doctype/support_ticket/__init__.py b/support/doctype/support_ticket/__init__.py index 2473bbcdd1..90dc1e32ce 100644 --- a/support/doctype/support_ticket/__init__.py +++ b/support/doctype/support_ticket/__init__.py @@ -112,11 +112,7 @@ class SupportMailbox(POP3Mailbox): except: d.description = 'Unable to extract message' d.save(1) - else: - # update feed - update_feed(d, 'on_update') - # send auto reply if cint(self.email_settings.send_autoreply): if "mailer-daemon" not in d.raised_by.lower(): From f4a6e17830e01a48cb1adffb1d1c08cc5a09950a Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 13:43:42 +0530 Subject: [PATCH 4/8] ignore attach, email validation fixes in support_ticket --- support/doctype/support_ticket/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/support/doctype/support_ticket/__init__.py b/support/doctype/support_ticket/__init__.py index 90dc1e32ce..da1755feb9 100644 --- a/support/doctype/support_ticket/__init__.py +++ b/support/doctype/support_ticket/__init__.py @@ -109,6 +109,11 @@ class SupportMailbox(POP3Mailbox): d.naming_series = opts and opts.split("\n")[0] or 'SUP' try: d.save(1) + try: + # extract attachments + self.save_attachments(d, mail.attachments) + except Exception, e: + self.description += "\n\n[Did not pull attachment]" except: d.description = 'Unable to extract message' d.save(1) @@ -118,8 +123,6 @@ class SupportMailbox(POP3Mailbox): if "mailer-daemon" not in d.raised_by.lower(): self.send_auto_reply(d) - # extract attachments - self.save_attachments(d, mail.attachments) def save_attachments(self, doc, attachment_list=[]): """ From 5a3cbd8700a49f8c739a8e8f2ca32e4eca04c2b9 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 14:57:26 +0530 Subject: [PATCH 5/8] integrated workflow in form --- hr/doctype/leave_application/leave_application.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hr/doctype/leave_application/leave_application.js b/hr/doctype/leave_application/leave_application.js index 63b5e6e0f6..b49ed3391f 100755 --- a/hr/doctype/leave_application/leave_application.js +++ b/hr/doctype/leave_application/leave_application.js @@ -47,7 +47,10 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { } else { cur_frm.set_intro("This Leave Application is pending approval. Only the Leave Apporver can update status.") cur_frm.toggle_enable("status", false); - if(!doc.__islocal) cur_frm.frm_head.appframe.buttons.Submit.remove(); + if(!doc.__islocal) { + if(cur_frm.frm_head.appframe.buttons.Submit) + cur_frm.frm_head.appframe.buttons.Submit.remove(); + } } } else { if(doc.status=="Approved") { From 391b6b7a0f18ba01877512df9cce7de1a82a413c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 28 Dec 2012 15:30:21 +0530 Subject: [PATCH 6/8] fixes validation in item master --- stock/doctype/item/item.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/stock/doctype/item/item.py b/stock/doctype/item/item.py index 5b00643843..38ff797291 100644 --- a/stock/doctype/item/item.py +++ b/stock/doctype/item/item.py @@ -128,16 +128,19 @@ class DocType: else: check_list.append(d.tax_type) - def check_for_active_boms(self, check): - if check in ['Is Active', 'Is Purchase Item']: + def check_for_active_boms(self, field_label): + if field_label in ['Is Active', 'Is Purchase Item']: bom_mat = sql("select distinct t1.parent from `tabBOM Item` t1, `tabBOM` t2 where t1.item_code ='%s' and (t1.bom_no = '' or t1.bom_no is NULL) and t2.name = t1.parent and t2.is_active = 1 and t2.docstatus = 1 and t1.docstatus =1 " % self.doc.name ) if bom_mat and bom_mat[0][0]: - msgprint("%s should be 'Yes'. As Item %s is present in one or many Active BOMs." % (cstr(check), cstr(self.doc.name))) + msgprint("%s should be 'Yes'. As Item %s is present in one or many Active BOMs." % (cstr(field_label), cstr(self.doc.name))) raise Exception - if check == 'Is Active' or ( check == 'Is Manufactured Item' and self.doc.is_sub_contracted_item != 'Yes') or (check == 'Is Sub Contracted Item' and self.doc.is_manufactured_item != 'Yes') : + if ((field_label == 'Allow Production Order' + and self.doc.is_sub_contracted_item != 'Yes') + or (field_label == 'Is Sub Contracted Item' + and self.doc.is_manufactured_item != 'Yes')): bom = sql("select name from `tabBOM` where item = '%s' and is_active = 1" % cstr(self.doc.name)) if bom and bom[0][0]: - msgprint("%s should be 'Yes'. As Item %s is present in one or many Active BOMs." % (cstr(check), cstr(self.doc.name))) + msgprint("%s should be 'Yes'. As Item %s is present in one or many Active BOMs." % (cstr(field_label), cstr(self.doc.name))) raise Exception def validate_barcode(self): @@ -147,24 +150,21 @@ class DocType: msgprint("Barcode: %s already used in item: %s" % (self.doc.barcode, cstr(duplicate[0][0])), raise_exception = 1) def validate(self): - fl = {'is_manufactured_item' :'Is Manufactured Item', + fl = {'is_manufactured_item' :'Allow Bill of Materials', 'is_sub_contracted_item':'Is Sub Contracted Item', 'is_purchase_item' :'Is Purchase Item', - 'is_pro_applicable' :'Is Pro Applicable'} + 'is_pro_applicable' :'Allow Production Order'} for d in fl: if cstr(self.doc.fields.get(d)) != 'Yes': - self.check_for_active_boms(check = fl[d]) + self.check_for_active_boms(fl[d]) self.check_ref_rate_detail() self.fill_customer_code() self.check_item_tax() self.validate_barcode() - if not self.doc.min_order_qty: - self.doc.min_order_qty = 0 self.check_non_asset_warehouse() - if self.doc.is_pro_applicable and self.doc.is_pro_applicable == 'Yes' and self.doc.is_manufactured_item and self.doc.is_manufactured_item != 'Yes': - msgprint("If making Production Order is allowed then, it should also allow to make Bill of Materials. Refer Manufacturing section.") - raise Exception + if cstr(self.doc.is_manufactured_item) == "No": + self.doc.is_pro_applicable = "No" if self.doc.is_pro_applicable == 'Yes' and self.doc.is_stock_item == 'No': msgprint("As Production Order can be made for this Item, then Is Stock Item Should be 'Yes' as we maintain it's stock. Refer Manufacturing and Inventory section.", raise_exception=1) From 4337802cdbb37c67164b0193428be8920962cc45 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 16:07:55 +0530 Subject: [PATCH 7/8] 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

From f033a1e151a325a5302a6a188eba8cf1df57ec69 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 16:09:38 +0530 Subject: [PATCH 8/8] integrated workflow, disable Submit, Cancel if workflow is defined --- home/page/latest_updates/latest_updates.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js index 86eb7e9056..b9296f2424 100644 --- a/home/page/latest_updates/latest_updates.js +++ b/home/page/latest_updates/latest_updates.js @@ -1,6 +1,7 @@ erpnext.updates = [ ["28th December 2012", [ - "Workflow: Added System for Multi-level approval before Submission", + "Workflow: Added System for Multi-level approval before Submission. \ +
See video at https://www.youtube.com/watch?v=zuGv59_wJKw.", ]], ["27th December 2012", [ "Website: Added auto-generated Contact Us and About Us Pages",