mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +00:00
Merge branch 'wsgi' of https://github.com/webnotes/erpnext into i18n
Conflicts: accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js public/js/complete_setup.js selling/doctype/opportunity/opportunity.js selling/doctype/quotation/quotation.js
This commit is contained in:
@@ -34,7 +34,6 @@ cur_frm.cscript.refresh = function(doc,dt,dn) {
|
||||
cur_frm.cscript.make_contact(doc,dt,dn);
|
||||
|
||||
cur_frm.communication_view = new wn.views.CommunicationList({
|
||||
list: wn.model.get("Communication", {"customer": doc.name}),
|
||||
parent: cur_frm.fields_dict.communication_html.wrapper,
|
||||
doc: doc,
|
||||
});
|
||||
@@ -45,7 +44,7 @@ cur_frm.cscript.setup_dashboard = function(doc) {
|
||||
cur_frm.dashboard.reset(doc);
|
||||
if(doc.__islocal)
|
||||
return;
|
||||
cur_frm.dashboard.set_headline('<span class="text-muted">Loading...</span>')
|
||||
cur_frm.dashboard.set_headline('<span class="text-muted">'+ wn._('Loading...')+ '</span>')
|
||||
|
||||
cur_frm.dashboard.add_doctype_badge("Opportunity", "customer");
|
||||
cur_frm.dashboard.add_doctype_badge("Quotation", "customer");
|
||||
@@ -119,4 +118,4 @@ cur_frm.fields_dict.lead_name.get_query = function(doc,cdt,cdn) {
|
||||
return{
|
||||
query:"controllers.queries.lead_query"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ from webnotes.model.doc import Document, make_autoname
|
||||
from webnotes import msgprint, _
|
||||
import webnotes.defaults
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
from utilities.transaction_base import TransactionBase
|
||||
|
||||
@@ -31,7 +30,7 @@ class DocType(TransactionBase):
|
||||
return webnotes.conn.get_value('Company', self.doc.company, 'abbr')
|
||||
|
||||
def get_receivables_group(self):
|
||||
g = sql("select receivables_group from tabCompany where name=%s", self.doc.company)
|
||||
g = webnotes.conn.sql("select receivables_group from tabCompany where name=%s", self.doc.company)
|
||||
g = g and g[0][0] or ''
|
||||
if not g:
|
||||
msgprint("Update Company master, assign a default group for Receivables")
|
||||
@@ -47,7 +46,7 @@ class DocType(TransactionBase):
|
||||
|
||||
def update_lead_status(self):
|
||||
if self.doc.lead_name:
|
||||
sql("update `tabLead` set status='Converted' where name = %s", self.doc.lead_name)
|
||||
webnotes.conn.sql("update `tabLead` set status='Converted' where name = %s", self.doc.lead_name)
|
||||
|
||||
def create_account_head(self):
|
||||
if self.doc.company :
|
||||
@@ -132,7 +131,7 @@ class DocType(TransactionBase):
|
||||
|
||||
def delete_customer_account(self):
|
||||
"""delete customer's ledger if exist and check balance before deletion"""
|
||||
acc = sql("select name from `tabAccount` where master_type = 'Customer' \
|
||||
acc = webnotes.conn.sql("select name from `tabAccount` where master_type = 'Customer' \
|
||||
and master_name = %s and docstatus < 2", self.doc.name)
|
||||
if acc:
|
||||
from webnotes.model import delete_doc
|
||||
@@ -143,7 +142,7 @@ class DocType(TransactionBase):
|
||||
self.delete_customer_contact()
|
||||
self.delete_customer_account()
|
||||
if self.doc.lead_name:
|
||||
sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name)
|
||||
webnotes.conn.sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name)
|
||||
|
||||
def on_rename(self, new, old, merge=False):
|
||||
#update customer_name if not naming series
|
||||
|
||||
@@ -17,6 +17,8 @@ class TestCustomer(unittest.TestCase):
|
||||
(("_Test Customer 1 Renamed",),))
|
||||
self.assertEqual(webnotes.conn.exists("Customer", "_Test Customer 1"), ())
|
||||
|
||||
webnotes.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")
|
||||
|
||||
def test_merge(self):
|
||||
from webnotes.test_runner import make_test_records
|
||||
make_test_records("Sales Invoice")
|
||||
@@ -57,6 +59,9 @@ class TestCustomer(unittest.TestCase):
|
||||
# check that old name doesn't exist
|
||||
self.assertEqual(webnotes.conn.exists("Customer", "_Test Customer"), ())
|
||||
self.assertEqual(webnotes.conn.exists("Account", "_Test Customer - _TC"), ())
|
||||
|
||||
# create back _Test Customer
|
||||
webnotes.bean(copy=test_records[0]).insert()
|
||||
|
||||
test_ignore = ["Price List"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user