Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait 2012-10-16 12:29:31 +05:30
commit fa99fc683a
9 changed files with 114 additions and 43 deletions

View File

@ -62,12 +62,14 @@ class DocType:
def update_details(self): def update_details(self):
vouchers = [] vouchers = []
for d in getlist(self.doclist, 'entries'): for d in getlist(self.doclist, 'entries'):
if d.clearance_date and d.cheque_date: if d.clearance_date:
if getdate(d.clearance_date) < getdate(d.cheque_date): if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date):
msgprint("Clearance Date can not be before Cheque Date (Row #%s)" % msgprint("Clearance Date can not be before Cheque Date (Row #%s)" %
d.idx, raise_exception=1) d.idx, raise_exception=1)
sql("update `tabJournal Voucher` set clearance_date = %s, modified = %s where name=%s", (d.clearance_date, nowdate(), d.voucher_id)) sql("""update `tabJournal Voucher`
set clearance_date = %s, modified = %s where name=%s""",
(d.clearance_date, nowdate(), d.voucher_id))
vouchers.append(d.voucher_id) vouchers.append(d.voucher_id)
if vouchers: if vouchers:

View File

@ -438,14 +438,17 @@ def manage_recurring_invoices():
def notify_errors(inv, owner): def notify_errors(inv, owner):
import webnotes
import website
exception_msg = """ exception_msg = """
Dear User, Dear User,
An error occured while creating recurring invoice from %s. An error occured while creating recurring invoice from %s (at %s).
May be there are some invalid email ids mentioned in the invoice. May be there are some invalid email ids mentioned in the invoice.
To stop sending repetitive error notifications from the system, we have unchecked \ To stop sending repetitive error notifications from the system, we have unchecked
"Convert into Recurring" field in the invoice %s. "Convert into Recurring" field in the invoice %s.
@ -458,11 +461,15 @@ def notify_errors(inv, owner):
Regards, Regards,
Administrator Administrator
""" % (inv, inv) """ % (inv, website.get_site_address(), inv)
subj = "[Urgent] Error while creating recurring invoice from %s" % inv subj = "[Urgent] Error while creating recurring invoice from %s" % inv
import webnotes.utils
recipients = webnotes.utils.get_system_managers_list() from webnotes.profile import get_system_managers
recipients += ['support@erpnext.com', owner] recipients = get_system_managers()
owner_email = webnotes.conn.get_value("Profile", owner, "email")
if not owner_email in recipients:
recipients.append(owner_email)
assign_task_to_owner(inv, exception_msg, recipients) assign_task_to_owner(inv, exception_msg, recipients)
sendmail(recipients, subject=subj, msg = exception_msg) sendmail(recipients, subject=subj, msg = exception_msg)

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
u'creation': '2012-05-04 10:21:24', u'creation': '2012-10-02 18:51:46',
u'docstatus': 0, u'docstatus': 0,
u'modified': '2012-10-02 16:43:51', u'modified': '2012-10-15 12:38:42',
u'modified_by': u'Administrator', u'modified_by': u'Administrator',
u'owner': u'Administrator' u'owner': u'Administrator'
}, },
@ -235,11 +235,13 @@
# DocField # DocField
{ {
'colour': u'White:FFF',
'description': u'eg. Cheque Number',
u'doctype': u'DocField', u'doctype': u'DocField',
'fieldname': u'cheque_no', 'fieldname': u'cheque_no',
'fieldtype': u'Data', 'fieldtype': u'Data',
'in_filter': 1, 'in_filter': 1,
'label': u'Cheque No', 'label': u'Reference Number',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': u'cheque_no', 'oldfieldname': u'cheque_no',
'oldfieldtype': u'Data', 'oldfieldtype': u'Data',
@ -252,7 +254,7 @@
u'doctype': u'DocField', u'doctype': u'DocField',
'fieldname': u'cheque_date', 'fieldname': u'cheque_date',
'fieldtype': u'Date', 'fieldtype': u'Date',
'label': u'Cheque Date', 'label': u'Reference Date',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': u'cheque_date', 'oldfieldname': u'cheque_date',
'oldfieldtype': u'Date', 'oldfieldtype': u'Date',
@ -743,6 +745,30 @@
'trigger': u'Client' 'trigger': u'Client'
}, },
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
u'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Accounts User',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
u'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Accounts User',
'submit': 0,
'write': 0
},
# DocPerm # DocPerm
{ {
'amend': 0, 'amend': 0,
@ -769,14 +795,14 @@
# DocPerm # DocPerm
{ {
'amend': 1, 'amend': 0,
'cancel': 1, 'cancel': 0,
'create': 1, 'create': 0,
u'doctype': u'DocPerm', u'doctype': u'DocPerm',
'permlevel': 0, 'permlevel': 0,
'role': u'Accounts User', 'role': u'Auditor',
'submit': 1, 'submit': 0,
'write': 1 'write': 0
}, },
# DocPerm # DocPerm
@ -786,7 +812,7 @@
'create': 0, 'create': 0,
u'doctype': u'DocPerm', u'doctype': u'DocPerm',
'permlevel': 1, 'permlevel': 1,
'role': u'Accounts User', 'role': u'Auditor',
'submit': 0, 'submit': 0,
'write': 0 'write': 0
} }

View File

@ -3,11 +3,11 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2012-03-27 14:35:52', u'creation': '2012-07-03 13:29:42',
'docstatus': 0, u'docstatus': 0,
'modified': '2012-03-27 14:35:52', u'modified': '2012-10-15 15:23:02',
'modified_by': u'Administrator', u'modified_by': u'Administrator',
'owner': u'Administrator' u'owner': u'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
@ -15,33 +15,45 @@
'autoname': u'_FEED.#####', 'autoname': u'_FEED.#####',
'colour': u'White:FFF', 'colour': u'White:FFF',
'default_print_format': u'Standard', 'default_print_format': u'Standard',
'doctype': 'DocType', u'doctype': u'DocType',
'module': u'Home', 'module': u'Home',
'name': '__common__', u'name': u'__common__',
'section_style': u'Simple', 'section_style': u'Simple',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 3 'version': 1
}, },
# These values are common for all DocField # These values are common for all DocField
{ {
'doctype': u'DocField', u'doctype': u'DocField',
'name': '__common__', u'name': u'__common__',
'parent': u'Feed', 'parent': u'Feed',
'parentfield': u'fields', 'parentfield': u'fields',
'parenttype': u'DocType', 'parenttype': u'DocType',
'permlevel': 0 'permlevel': 0
}, },
# These values are common for all DocPerm
{
u'doctype': u'DocPerm',
u'name': u'__common__',
'parent': u'Feed',
'parentfield': u'permissions',
'parenttype': u'DocType',
'permlevel': 0,
'read': 1,
'role': u'System Manager'
},
# DocType, Feed # DocType, Feed
{ {
'doctype': 'DocType', u'doctype': u'DocType',
'name': u'Feed' u'name': u'Feed'
}, },
# DocField # DocField
{ {
'doctype': u'DocField', u'doctype': u'DocField',
'fieldname': u'feed_type', 'fieldname': u'feed_type',
'fieldtype': u'Select', 'fieldtype': u'Select',
'label': u'Feed Type' 'label': u'Feed Type'
@ -49,7 +61,7 @@
# DocField # DocField
{ {
'doctype': u'DocField', u'doctype': u'DocField',
'fieldname': u'doc_type', 'fieldname': u'doc_type',
'fieldtype': u'Data', 'fieldtype': u'Data',
'label': u'Doc Type' 'label': u'Doc Type'
@ -57,7 +69,7 @@
# DocField # DocField
{ {
'doctype': u'DocField', u'doctype': u'DocField',
'fieldname': u'doc_name', 'fieldname': u'doc_name',
'fieldtype': u'Data', 'fieldtype': u'Data',
'label': u'Doc Name' 'label': u'Doc Name'
@ -65,7 +77,7 @@
# DocField # DocField
{ {
'doctype': u'DocField', u'doctype': u'DocField',
'fieldname': u'subject', 'fieldname': u'subject',
'fieldtype': u'Data', 'fieldtype': u'Data',
'label': u'Subject' 'label': u'Subject'
@ -73,7 +85,7 @@
# DocField # DocField
{ {
'doctype': u'DocField', u'doctype': u'DocField',
'fieldname': u'color', 'fieldname': u'color',
'fieldtype': u'Data', 'fieldtype': u'Data',
'label': u'Color' 'label': u'Color'
@ -81,9 +93,14 @@
# DocField # DocField
{ {
'doctype': u'DocField', u'doctype': u'DocField',
'fieldname': u'full_name', 'fieldname': u'full_name',
'fieldtype': u'Data', 'fieldtype': u'Data',
'label': u'Full Name' 'label': u'Full Name'
},
# DocPerm
{
u'doctype': u'DocPerm'
} }
] ]

View File

@ -1,6 +1,7 @@
wn.pages['activity'].onload = function(wrapper) { wn.pages['activity'].onload = function(wrapper) {
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.layout-appframe')); wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.layout-appframe'));
wrapper.appframe.title('Activity'); wrapper.appframe.title('Activity');
var list = new wn.ui.Listing({ var list = new wn.ui.Listing({
appframe: wrapper.appframe, appframe: wrapper.appframe,
method: 'home.page.activity.activity.get_feed', method: 'home.page.activity.activity.get_feed',
@ -10,6 +11,13 @@ wn.pages['activity'].onload = function(wrapper) {
} }
}); });
list.run(); list.run();
// Build Report Button
if(wn.boot.profile.can_get_report.indexOf("Feed")!=-1) {
wrapper.appframe.add_button('Build Report', function() {
wn.set_route('Report2', "Feed");
}, 'icon-th')
}
} }
erpnext.last_feed_date = false; erpnext.last_feed_date = false;

View File

@ -38,7 +38,6 @@ class DocType:
def __init__(self, doc, doclist=[]): def __init__(self, doc, doclist=[]):
self.doc = doc self.doc = doc
self.doclist = doclist self.doclist = doclist
self.prefix = is_testing and 'test' or 'tab'
def validate(self): def validate(self):
import string import string

View File

@ -140,8 +140,8 @@ class DocType:
import webnotes import webnotes
companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1) companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1)
import webnotes.utils from webnotes.profile import get_system_managers
system_managers = webnotes.utils.get_system_managers_list() system_managers = get_system_managers()
if not system_managers: return if not system_managers: return
from webnotes.model.doc import Document from webnotes.model.doc import Document

View File

@ -43,7 +43,7 @@ def on_login_post_session(login_manager):
from webnotes.utils import nowtime from webnotes.utils import nowtime
from webnotes.profile import get_user_fullname from webnotes.profile import get_user_fullname
home.make_feed('Login', 'Profile', login_manager.user, login_manager.user, home.make_feed('Login', 'Profile', login_manager.user, login_manager.user,
'%s logged in at %s' % (get_user_fullname, nowtime()), '%s logged in at %s' % (get_user_fullname(login_manager.user), nowtime()),
login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D') login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')

View File

@ -23,4 +23,16 @@ def send_message():
webnotes.msgprint('Please give us your email id so that we can write back to you', raise_exception=True) webnotes.msgprint('Please give us your email id so that we can write back to you', raise_exception=True)
d.save() d.save()
webnotes.msgprint('Thank you!') webnotes.msgprint('Thank you!')
def get_site_address():
from webnotes.utils import get_request_site_address
url = get_request_site_address()
if not url or url=='http://localhost':
new_url = webnotes.conn.get_value('Website Settings', 'Website Settings',
'subdomain')
if new_url:
url = "http://" + new_url
return url