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

This commit is contained in:
Rushabh Mehta
2012-11-27 14:27:11 +01:00
16 changed files with 335 additions and 254 deletions

View File

@@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require("public/app/js/communication.js");
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.add_fetch('customer', 'customer_name', 'customer_name');
@@ -40,6 +42,15 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
}
cur_frm.cscript.refresh = function() {
cur_frm.communication_view = new erpnext.CommunicationView({
list: wn.model.get("Communication", {"contact": doc.name}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc,
email: doc.email_id
})
}
cur_frm.cscript.hide_dialog = function() {
if(cur_frm.contact_list)
cur_frm.contact_list.run();

View File

@@ -21,12 +21,16 @@ import webnotes
from webnotes.model.doc import Document
from webnotes import session, form, msgprint, errprint
# -----------------------------------------------------------------------------------------
class DocType:
from utilities.transaction_base import TransactionBase
class DocType(TransactionBase):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def onload(self):
self.add_communication_list()
def autoname(self):
if self.doc.customer:
self.doc.name = self.doc.first_name + (self.doc.last_name and ' ' + self.doc.last_name or '') + '-' + self.doc.customer

View File

@@ -4,14 +4,14 @@
"docstatus": 0,
"creation": "2012-08-06 11:15:46",
"modified_by": "Administrator",
"modified": "2012-11-24 15:10:53"
"modified": "2012-11-27 18:32:42"
},
{
"in_create": 0,
"default_print_format": "Standard",
"doctype": "DocType",
"module": "Utilities",
"in_dialog": 1,
"in_dialog": 0,
"document_type": "Master",
"name": "__common__"
},
@@ -34,23 +34,6 @@
"name": "Contact",
"doctype": "DocType"
},
{
"oldfieldtype": "Section Break",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Contact Details",
"fieldname": "contact_details",
"fieldtype": "Section Break",
"permlevel": 0
},
{
"oldfieldtype": "Column Break",
"doctype": "DocField",
"width": "50%",
"fieldname": "column_break0",
"fieldtype": "Column Break",
"permlevel": 0
},
{
"oldfieldtype": "Data",
"doctype": "DocField",
@@ -70,6 +53,54 @@
"fieldtype": "Data",
"permlevel": 0
},
{
"doctype": "DocField",
"fieldname": "cb00",
"fieldtype": "Column Break",
"permlevel": 0
},
{
"oldfieldtype": "Data",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Email Id",
"oldfieldname": "email_id",
"fieldname": "email_id",
"fieldtype": "Data",
"search_index": 1,
"reqd": 1,
"permlevel": 0
},
{
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "Phone",
"oldfieldname": "contact_no",
"fieldname": "phone",
"fieldtype": "Data",
"reqd": 1,
"permlevel": 0
},
{
"doctype": "DocField",
"fieldname": "sb00",
"fieldtype": "Section Break",
"permlevel": 0
},
{
"doctype": "DocField",
"label": "Communication HTML",
"fieldname": "communication_html",
"fieldtype": "HTML",
"permlevel": 0
},
{
"doctype": "DocField",
"label": "Contact Details",
"fieldname": "contact_details",
"fieldtype": "Section Break",
"permlevel": 0
},
{
"print_hide": 0,
"oldfieldtype": "Link",
@@ -105,9 +136,9 @@
"permlevel": 0
},
{
"allow_on_submit": 0,
"depends_on": "eval:!doc.customer && !doc.sales_partner",
"colour": "White:FFF",
"allow_on_submit": 0,
"doctype": "DocField",
"label": "Supplier Name",
"fieldname": "supplier_name",
@@ -144,28 +175,6 @@
"fieldtype": "Column Break",
"permlevel": 0
},
{
"oldfieldtype": "Data",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Email Id",
"oldfieldname": "email_id",
"fieldname": "email_id",
"fieldtype": "Data",
"search_index": 1,
"reqd": 1,
"permlevel": 0
},
{
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "Phone",
"oldfieldname": "contact_no",
"fieldname": "phone",
"fieldtype": "Data",
"reqd": 1,
"permlevel": 0
},
{
"oldfieldtype": "Data",
"doctype": "DocField",