\
s)
\
%(feed_type)s\
@@ -50,7 +51,7 @@ erpnext.ActivityFeed = Class.extend({
// color for comment
if(data.feed_type=='Comment') {
- data.add_class = "label-important";
+ data.add_class = "label-danger";
}
if(data.feed_type=='Assignment') {
diff --git a/hr/doctype/job_applicant/job_applicant.py b/hr/doctype/job_applicant/job_applicant.py
index 04b6da9568a..99272303d0c 100644
--- a/hr/doctype/job_applicant/job_applicant.py
+++ b/hr/doctype/job_applicant/job_applicant.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import webnotes
from utilities.transaction_base import TransactionBase
+from webnotes.utils import extract_email_id
class DocType(TransactionBase):
def __init__(self, d, dl):
@@ -14,8 +15,13 @@ class DocType(TransactionBase):
def get_sender(self, comm):
return webnotes.conn.get_value('Jobs Email Settings',None,'email_id')
- def on_communication_sent(self, comm):
- webnotes.conn.set(self.doc, 'status', 'Replied')
+ def on_communication(self, comm):
+ if webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
+ status = "Replied"
+ else:
+ status = "Open"
+
+ webnotes.conn.set(self.doc, 'status', status)
def on_trash(self):
webnotes.conn.sql("""delete from `tabCommunication`
diff --git a/patches/patch_list.py b/patches/patch_list.py
index d4c395a4e05..086d29480f7 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -259,6 +259,8 @@ patch_list = [
"patches.august_2013.p06_deprecate_is_cancelled",
"patches.august_2013.p06_fix_sle_against_stock_entry",
"execute:webnotes.bean('Style Settings').save() #2013-08-20",
+ "patches.september_2013.p01_add_user_defaults_from_pos_setting",
+ "execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-09-02",
"patches.september_2013.p01_fix_buying_amount_gl_entries",
"patches.september_2013.p01_update_communication",
"patches.september_2013.p02_fix_serial_no_status",
diff --git a/patches/september_2013/__init__.py b/patches/september_2013/__init__.py
index e69de29bb2d..baffc488252 100644
--- a/patches/september_2013/__init__.py
+++ b/patches/september_2013/__init__.py
@@ -0,0 +1 @@
+from __future__ import unicode_literals
diff --git a/patches/september_2013/p01_add_user_defaults_from_pos_setting.py b/patches/september_2013/p01_add_user_defaults_from_pos_setting.py
new file mode 100644
index 00000000000..f3a9344464d
--- /dev/null
+++ b/patches/september_2013/p01_add_user_defaults_from_pos_setting.py
@@ -0,0 +1,13 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+
+def execute():
+ pos_view_users = webnotes.conn.sql_list("""select user from `tabPOS Setting`""")
+ for user in pos_view_users:
+ if user:
+ webnotes.defaults.set_user_default("is_pos", 1, user)
+ else:
+ webnotes.defaults.set_global_default("is_pos", 1)
\ No newline at end of file
diff --git a/selling/doctype/lead/lead.py b/selling/doctype/lead/lead.py
index 063c5f0d09b..1aff8c865c6 100644
--- a/selling/doctype/lead/lead.py
+++ b/selling/doctype/lead/lead.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes import _
-from webnotes.utils import cstr, validate_email_add, cint
+from webnotes.utils import cstr, validate_email_add, cint, extract_email_id
from webnotes import session, msgprint
sql = webnotes.conn.sql
@@ -28,8 +28,14 @@ class DocType(SellingController):
if customer:
self.doc.fields["__is_customer"] = customer
- def on_communication_sent(self, comm):
- webnotes.conn.set(self.doc, 'status', 'Replied')
+ def on_communication(self, comm):
+ if comm.sender == self.get_sender(comm) or \
+ webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
+ status = "Replied"
+ else:
+ status = "Open"
+
+ webnotes.conn.set(self.doc, 'status', status)
def check_status(self):
chk = sql("select status from `tabLead` where name=%s", self.doc.name)
diff --git a/selling/doctype/quotation/quotation.js b/selling/doctype/quotation/quotation.js
index fcebe357f87..ea1b62aa0a7 100644
--- a/selling/doctype/quotation/quotation.js
+++ b/selling/doctype/quotation/quotation.js
@@ -62,11 +62,11 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
if (!doc.__islocal) {
cur_frm.communication_view = new wn.views.CommunicationList({
- list: wn.model.get("Communication", {"quotation": doc.name}),
+ list: wn.model.get("Communication", {"parent": doc.name, "parenttype": "Quotation"}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc,
recipients: doc.contact_email
- });
+ });
}
this.quotation_to();
diff --git a/setup/doctype/company/company.js b/setup/doctype/company/company.js
index a8358fab054..ca3c93b49bf 100644
--- a/setup/doctype/company/company.js
+++ b/setup/doctype/company/company.js
@@ -36,8 +36,6 @@ cur_frm.cscript.abbr = function(doc){
}
}
-cur_frm.fields_dict.default_cash_account.get_query = cur_frm.fields_dict.default_bank_account.get_query;
-
cur_frm.fields_dict.default_bank_account.get_query = function(doc) {
return{
filters:{
@@ -48,7 +46,7 @@ cur_frm.fields_dict.default_bank_account.get_query = function(doc) {
}
}
-cur_frm.fields_dict.payables_group.get_query = cur_frm.fields_dict.receivables_group.get_query;
+cur_frm.fields_dict.default_cash_account.get_query = cur_frm.fields_dict.default_bank_account.get_query;
cur_frm.fields_dict.receivables_group.get_query = function(doc) {
return{
@@ -59,6 +57,39 @@ cur_frm.fields_dict.receivables_group.get_query = function(doc) {
}
}
+cur_frm.fields_dict.payables_group.get_query = cur_frm.fields_dict.receivables_group.get_query;
+
+cur_frm.fields_dict.default_expense_account.get_query = function(doc) {
+ return{
+ filters:{
+ 'company': doc.name,
+ 'group_or_ledger': "Ledger",
+ 'is_pl_account': "Yes",
+ 'debit_or_credit': "Debit"
+ }
+ }
+}
+
+cur_frm.fields_dict.default_income_account.get_query = function(doc) {
+ return{
+ filters:{
+ 'company': doc.name,
+ 'group_or_ledger': "Ledger",
+ 'is_pl_account': "Yes",
+ 'debit_or_credit': "Credit"
+ }
+ }
+}
+
+cur_frm.fields_dict.cost_center.get_query = function(doc) {
+ return{
+ filters:{
+ 'company': doc.name,
+ 'group_or_ledger': "Ledger",
+ }
+ }
+}
+
if (sys_defaults.auto_accounting_for_stock) {
cur_frm.fields_dict["stock_adjustment_account"].get_query = function(doc) {
return {
diff --git a/setup/doctype/company/company.py b/setup/doctype/company/company.py
index 0f3b2ff6487..38093e71787 100644
--- a/setup/doctype/company/company.py
+++ b/setup/doctype/company/company.py
@@ -48,7 +48,8 @@ class DocType:
self.create_default_warehouses()
self.create_default_web_page()
- if not self.doc.cost_center:
+ if not webnotes.conn.get_value("Cost Center", {"group_or_ledger": "Ledger",
+ "company": self.doc.name}):
self.create_default_cost_center()
self.set_default_accounts()
diff --git a/support/doctype/support_ticket/get_support_mails.py b/support/doctype/support_ticket/get_support_mails.py
index fb26e570d7c..fa4f304e531 100644
--- a/support/doctype/support_ticket/get_support_mails.py
+++ b/support/doctype/support_ticket/get_support_mails.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import webnotes
-from webnotes.utils import cstr, cint
+from webnotes.utils import cstr, cint, decode_dict
from webnotes.utils.email_lib import sendmail
from webnotes.utils.email_lib.receive import POP3Mailbox
from core.doctype.communication.communication import make
@@ -31,14 +31,15 @@ class SupportMailbox(POP3Mailbox):
ticket.doc.save()
else:
- ticket = webnotes.bean([{
+ ticket = webnotes.bean([decode_dict({
"doctype":"Support Ticket",
"description": mail.content,
"subject": mail.subject,
"raised_by": mail.from_email,
"content_type": mail.content_type,
"status": "Open",
- }])
+ })])
+
ticket.insert()
new_ticket = True
diff --git a/support/doctype/support_ticket/support_ticket.py b/support/doctype/support_ticket/support_ticket.py
index 8e723ee3c10..9f364807d4b 100644
--- a/support/doctype/support_ticket/support_ticket.py
+++ b/support/doctype/support_ticket/support_ticket.py
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
import webnotes
from utilities.transaction_base import TransactionBase
-from webnotes.utils import now
+from webnotes.utils import now, extract_email_id
class DocType(TransactionBase):
def __init__(self, doc, doclist=[]):
@@ -33,8 +33,12 @@ class DocType(TransactionBase):
from webnotes.widgets.form.assign_to import clear
clear(self.doc.doctype, self.doc.name)
- def on_communication_sent(self, comm):
- self.doc.status = "Waiting for Customer"
+ def on_communication(self, comm):
+ if comm.sender == self.get_sender(comm) or \
+ webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
+ self.doc.status = "Waiting for Customer"
+ else:
+ self.doc.status = "Open"
self.update_status()
self.doc.save()
diff --git a/utilities/doctype/contact/contact.js b/utilities/doctype/contact/contact.js
index 608b1e7c56a..3b5255ccc68 100644
--- a/utilities/doctype/contact/contact.js
+++ b/utilities/doctype/contact/contact.js
@@ -5,7 +5,7 @@ wn.require('app/controllers/js/contact_address_common.js');
cur_frm.cscript.refresh = function(doc) {
cur_frm.communication_view = new wn.views.CommunicationList({
- list: wn.model.get("Communication", {"contact": doc.name}),
+ list: wn.model.get("Communication", {"parent": doc.name, "parenttype": "Contact"}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc,
recipients: doc.email_id
diff --git a/utilities/doctype/contact/contact.py b/utilities/doctype/contact/contact.py
index 9997cabea5e..a116edbdc23 100644
--- a/utilities/doctype/contact/contact.py
+++ b/utilities/doctype/contact/contact.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import webnotes
-from webnotes.utils import cstr
+from webnotes.utils import cstr, extract_email_id
from utilities.transaction_base import TransactionBase
@@ -12,8 +12,13 @@ class DocType(TransactionBase):
self.doc = doc
self.doclist = doclist
- def on_communication_sent(self, comm):
- webnotes.conn.set(self.doc, 'status', 'Replied')
+ def on_communication(self, comm):
+ if webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
+ status = "Replied"
+ else:
+ status = "Open"
+
+ webnotes.conn.set(self.doc, 'status', status)
def autoname(self):
# concat first and last name
diff --git a/website/helpers/make_web_include_files.py b/website/helpers/make_web_include_files.py
index 7ff3d6ad998..a9df23bb1c5 100644
--- a/website/helpers/make_web_include_files.py
+++ b/website/helpers/make_web_include_files.py
@@ -3,14 +3,14 @@
import os
import webnotes
-import webnotes.webutils
def make():
+ from startup.webutils import get_home_page
if not webnotes.conn:
webnotes.connect()
- home_page = webnotes.webutils.get_home_page()
+ home_page = get_home_page()
fname = 'js/wn-web.js'
if os.path.basename(os.path.abspath('.'))!='public':