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:
Bárbara Perretti
2013-10-16 15:09:18 -03:00
250 changed files with 5061 additions and 2506 deletions

View File

@@ -2,12 +2,13 @@
{
"creation": "2013-03-07 11:55:07",
"docstatus": 0,
"modified": "2013-07-05 14:51:41",
"modified": "2013-10-02 14:25:02",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
"allow_import": 1,
"autoname": "field:project_name",
"doctype": "DocType",
"document_type": "Master",

View File

@@ -9,7 +9,6 @@ from webnotes.model import db_exists
from webnotes.model.bean import copy_doclist
from webnotes import msgprint
sql = webnotes.conn.sql
class DocType:
def __init__(self,doc,doclist=[]):
@@ -17,13 +16,13 @@ class DocType:
self.doclist = doclist
def get_project_details(self):
cust = sql("select customer, customer_name from `tabProject` where name = %s", self.doc.project)
cust = webnotes.conn.sql("select customer, customer_name from `tabProject` where name = %s", self.doc.project)
if cust:
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
return ret
def get_customer_details(self):
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
cust = webnotes.conn.sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
if cust:
ret = {'customer_name': cust and cust[0][0] or ''}
return ret

View File

@@ -2,12 +2,13 @@
{
"creation": "2013-01-29 19:25:50",
"docstatus": 0,
"modified": "2013-07-05 14:57:57",
"modified": "2013-10-02 14:25:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
"allow_import": 1,
"autoname": "TASK.#####",
"doctype": "DocType",
"document_type": "Master",

View File

@@ -5,15 +5,31 @@ import webnotes, unittest
class TimeLogBatchTest(unittest.TestCase):
def test_time_log_status(self):
self.assertEquals(webnotes.conn.get_value("Time Log", "_T-Time Log-00001", "status"), "Submitted")
tlb = webnotes.bean("Time Log Batch", "_T-Time Log Batch-00001")
from projects.doctype.time_log.test_time_log import test_records as time_log_records
time_log = webnotes.bean(copy=time_log_records[0])
time_log.doc.fields.update({
"from_time": "2013-01-02 10:00:00",
"to_time": "2013-01-02 11:00:00",
"docstatus": 0
})
time_log.insert()
time_log.submit()
self.assertEquals(webnotes.conn.get_value("Time Log", time_log.doc.name, "status"), "Submitted")
tlb = webnotes.bean(copy=test_records[0])
tlb.doclist[1].time_log = time_log.doc.name
tlb.insert()
tlb.submit()
self.assertEquals(webnotes.conn.get_value("Time Log", "_T-Time Log-00001", "status"), "Batched for Billing")
self.assertEquals(webnotes.conn.get_value("Time Log", time_log.doc.name, "status"), "Batched for Billing")
tlb.cancel()
self.assertEquals(webnotes.conn.get_value("Time Log", "_T-Time Log-00001", "status"), "Submitted")
self.assertEquals(webnotes.conn.get_value("Time Log", time_log.doc.name, "status"), "Submitted")
test_records = [[
{"rate": "500"},
{
"doctype": "Time Log Batch",
"rate": "500"
},
{
"doctype": "Time Log Batch Detail",
"parenttype": "Time Log Batch",