mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 18:21:22 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -125,6 +125,7 @@ class DocType(TransactionBase):
|
||||
parent_account = self.get_receivables_group()
|
||||
arg = {'account_name':self.doc.name,'parent_account': parent_account, 'group_or_ledger':'Ledger', 'company':self.doc.company,'account_type':'','tax_rate':'0','master_type':'Customer','master_name':self.doc.name,'address':self.doc.address}
|
||||
# create
|
||||
|
||||
ac = get_obj('GL Control').add_ac(cstr(arg))
|
||||
msgprint("Account Head created for "+ac)
|
||||
else :
|
||||
@@ -236,5 +237,11 @@ class DocType(TransactionBase):
|
||||
for rec in update_fields:
|
||||
sql("update `tab%s` set customer_name = '%s' where %s = '%s'" %(rec[0],newdn,rec[1],olddn))
|
||||
|
||||
old_account = webnotes.conn.get_value("Account", {"master_type": "Customer",
|
||||
"master_name": olddn})
|
||||
|
||||
#update master_name in doctype account
|
||||
sql("update `tabAccount` set master_name = '%s', master_type = 'Customer' where master_name = '%s'" %(newdn,olddn))
|
||||
|
||||
from webnotes.model.rename_doc import rename_doc
|
||||
rename_doc("Account", old_account, newdn)
|
||||
|
||||
@@ -2,19 +2,21 @@
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-11-02 17:16:46",
|
||||
"creation": "2012-12-03 10:31:05",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-11-30 10:54:38"
|
||||
"modified": "2012-12-03 11:25:29"
|
||||
},
|
||||
{
|
||||
"autoname": "naming_series:",
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"description": "Buyer of Goods and Services.",
|
||||
"allow_print": 0,
|
||||
"search_fields": "customer_name,customer_group,country,territory",
|
||||
"module": "Selling",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master"
|
||||
"document_type": "Master",
|
||||
"autoname": "naming_series:",
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"allow_rename": 1,
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
@@ -364,44 +366,54 @@
|
||||
"fieldtype": "Small Text",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales Manager",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales User",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 1,
|
||||
"role": "Sales Master Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Master Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@@ -410,18 +422,18 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"cancel": 0,
|
||||
"role": "Sales Master Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"write": 1,
|
||||
"cancel": 0,
|
||||
"role": "Purchase User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
|
||||
@@ -94,8 +94,21 @@ cur_frm.cscript.lead_cust_show = function(doc,cdt,cdn){
|
||||
|
||||
// customer
|
||||
cur_frm.cscript.customer = function(doc,dt,dn) {
|
||||
if(doc.customer) get_server_fields('get_default_customer_address', JSON.stringify({customer: doc.customer}),'', doc, dt, dn, 1);
|
||||
if(doc.customer) unhide_field(['customer_name','customer_address','contact_person','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']);
|
||||
if(doc.customer) {
|
||||
cur_frm.call({
|
||||
method: "get_default_customer_address",
|
||||
args: { customer: doc.customer },
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
cur_frm.refresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
unhide_field(["customer_name", "customer_address", "contact_person",
|
||||
"address_display", "contact_display", "contact_mobile", "contact_email",
|
||||
"territory", "customer_group"]);
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
|
||||
|
||||
@@ -2,19 +2,20 @@
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-11-24 17:21:44",
|
||||
"creation": "2012-12-03 10:31:06",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-11-30 10:54:00"
|
||||
"modified": "2012-12-03 13:57:32"
|
||||
},
|
||||
{
|
||||
"is_submittable": 1,
|
||||
"autoname": "naming_series:",
|
||||
"name": "__common__",
|
||||
"description": "Potential Sales Deal",
|
||||
"default_print_format": "Standard",
|
||||
"search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company",
|
||||
"module": "Selling",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Transaction"
|
||||
"document_type": "Transaction",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
@@ -35,16 +36,6 @@
|
||||
"name": "Opportunity",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"description": "Enter customer enquiry for which you might raise a quotation in future",
|
||||
"oldfieldtype": "Section Break",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Basic Info",
|
||||
"fieldname": "basic_info",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "To manage multiple series please go to Setup > Manage Series",
|
||||
"no_copy": 1,
|
||||
@@ -474,14 +465,24 @@
|
||||
"fieldtype": "Date",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"role": "Sales Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "System Manager",
|
||||
"cancel": 1,
|
||||
"role": "System Manager",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@@ -495,8 +496,8 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Sales User",
|
||||
"cancel": 1,
|
||||
"role": "Sales User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@@ -505,8 +506,8 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"cancel": 0,
|
||||
"role": "Sales User",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
@@ -515,18 +516,8 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
"permlevel": 0
|
||||
}
|
||||
]
|
||||
@@ -369,6 +369,6 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||
|
||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
if(cint(wn.boot.notification_settings.sales_order)) {
|
||||
cur_frm.email_doc(wn.boot.notification_settings.sales_order);
|
||||
cur_frm.email_doc(wn.boot.notification_settings.sales_order_message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user