Compare commits

...

29 Commits

Author SHA1 Message Date
Pratik Vyas
89a3ee7f57 Merge branch 'develop' 2014-02-10 20:57:25 +05:30
Pratik Vyas
347bf93b4f bumped to version 3.8.5 2014-02-10 21:27:25 +06:00
Pratik Vyas
17cb5b7799 Merge branch 'develop' 2014-02-07 16:03:09 +05:30
Pratik Vyas
e0c9dd3d23 bumped to version 3.8.4 2014-02-07 16:33:09 +06:00
Nabin Hait
41891ec95c Merge pull request #1405 from nabinhait/hotfix
Serial No duplicate entry fix
2014-02-07 15:54:57 +05:30
Nabin Hait
e1e5d675ac Validate duplicate serial nos entry 2014-02-07 15:33:34 +05:30
Nabin Hait
c4e92c6416 Validate duplicate serial nos entry 2014-02-07 15:22:50 +05:30
Nabin Hait
2c832addca Merge pull request #1404 from nabinhait/hotfix
Hotfix
2014-02-07 11:51:54 +05:30
Nabin Hait
c095cfa224 Merge branch 'develop' of github.com:webnotes/erpnext into hotfix 2014-02-07 11:49:45 +05:30
Nabin Hait
fbb10d37d3 Removed on_trash function from support ticket 2014-02-07 11:49:26 +05:30
Pratik Vyas
9294fc8e7e Merge branch 'develop' 2014-02-06 15:27:11 +05:30
Pratik Vyas
07d4c373f3 bumped to version 3.8.3 2014-02-06 15:57:11 +06:00
Pratik Vyas
ae763d7afa Merge pull request #1394 from pdvyas/testing-develop3
fix travis build script typo
2014-02-06 14:54:13 +05:30
Pratik Vyas
70e2a50f0f fix travis build script typo 2014-02-06 14:07:58 +05:30
Pratik Vyas
1b8c158fdc Merge pull request #1393 from pdvyas/testing-develop2
add travis build script
2014-02-06 13:37:21 +05:30
Pratik Vyas
4078ef8ef5 add travis build script 2014-02-06 13:36:26 +05:30
Pratik Vyas
c6b59ef082 Merge branch 'develop' 2014-02-05 18:49:29 +05:30
Pratik Vyas
dbbba659a8 bumped to version 3.8.2 2014-02-05 19:19:29 +06:00
Nabin Hait
3c3719fa9c Merge pull request #1388 from nabinhait/hotfix
Hotfix
2014-02-05 18:46:54 +05:30
Nabin Hait
a7af1d619e Fix in accounts receivable report 2014-02-05 18:15:12 +05:30
Nabin Hait
18eb8c5f68 fixed unicode and null issue in sms center 2014-02-05 15:06:09 +05:30
Pratik Vyas
fe977289eb Merge branch 'develop' 2014-01-30 16:00:29 +05:30
Pratik Vyas
45b5b6d11f bumped to version 3.8.1 2014-01-30 16:30:29 +06:00
Nabin Hait
c58b330673 Merge pull request #1372 from nabinhait/hotfix
Hotfix
2014-01-30 01:49:29 -08:00
Nabin Hait
5d976ca3ac recurring invoice test fix 2014-01-30 15:12:39 +05:30
Nabin Hait
f2f17959ab Serial no fix 2014-01-30 14:54:25 +05:30
Nabin Hait
53f7ba26f6 Merge branch 'develop' of github.com:webnotes/erpnext into hotfix 2014-01-30 12:12:50 +05:30
Nabin Hait
1969f9e1ac Merge branch 'develop' of github.com:webnotes/erpnext into hotfix 2014-01-30 12:11:04 +05:30
Nabin Hait
60fcce66f7 Minor fix in accounts receivable report 2014-01-30 12:08:44 +05:30
12 changed files with 59 additions and 26 deletions

30
.travis.yml Normal file
View File

@@ -0,0 +1,30 @@
language: python
python:
- "2.7"
services:
- mysql
install:
- pip install git+https://github.com/webnotes/wnframework.git@4.0.0-wip &&
- pip install --editable .
script:
cd ./test_sites/ &&
webnotes --reinstall -v test_site &&
webnotes --install_app erpnext -v test_site &&
webnotes --run_tests -v test_site --app erpnext
branches:
except:
- develop
- master
- 3.x.x
- slow
- webshop_refactor
before_script:
- mysql -e 'create database travis' &&
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('travis') WHERE user='travis';\nFLUSH PRIVILEGES;\n" | mysql -u root

View File

@@ -654,7 +654,8 @@ class TestSalesInvoice(unittest.TestCase):
def _test_recurring_invoice(self, base_si, first_and_last_day):
from webnotes.utils import add_months, get_last_day
from accounts.doctype.sales_invoice.sales_invoice import manage_recurring_invoices
from accounts.doctype.sales_invoice.sales_invoice \
import manage_recurring_invoices, get_next_date
no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.doc.recurring_type]
@@ -662,7 +663,8 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEquals(i+1, webnotes.conn.sql("""select count(*) from `tabSales Invoice`
where recurring_id=%s and docstatus=1""", base_si.doc.recurring_id)[0][0])
next_date = add_months(base_si.doc.posting_date, no_of_months)
next_date = get_next_date(base_si.doc.posting_date, no_of_months,
base_si.doc.repeat_on_day_of_month)
manage_recurring_invoices(next_date=next_date, commit=False)

View File

@@ -113,9 +113,8 @@ class AccountsReceivableReport(object):
if not hasattr(self, "account_map"):
self.account_map = dict(((r.name, r) for r in webnotes.conn.sql("""select
acc.name, cust.name as customer, cust.customer_name, cust.territory
from `tabAccount` acc, `tabCustomer` cust
where acc.master_type="Customer"
and cust.name=acc.master_name""", as_dict=True)))
from `tabAccount` acc left join `tabCustomer` cust
on cust.name=acc.master_name where acc.master_type="Customer" """, as_dict=True)))
return self.account_map
@@ -134,7 +133,6 @@ class AccountsReceivableReport(object):
self.gl_entries = webnotes.conn.sql("""select * from `tabGL Entry`
where docstatus < 2 {0} order by posting_date, account""".format(conditions),
values, as_dict=True)
return self.gl_entries
def prepare_conditions(self):

View File

@@ -356,20 +356,23 @@ def get_actual_expense(args):
and fiscal_year='%(fiscal_year)s' and company='%(company)s' %(condition)s
""" % (args))[0][0]
def rename_account_for(dt, olddn, newdn, merge):
def rename_account_for(dt, olddn, newdn, merge, company):
old_account = get_account_for(dt, olddn)
if old_account:
new_account = None
if not merge:
if old_account == olddn:
new_account = webnotes.rename_doc("Account", olddn, newdn)
if old_account == add_abbr_if_missing(olddn, company):
new_account = webnotes.rename_doc("Account", old_account, newdn)
else:
existing_new_account = get_account_for(dt, newdn)
new_account = webnotes.rename_doc("Account", old_account,
existing_new_account or newdn, merge=True if existing_new_account else False)
if new_account:
webnotes.conn.set_value("Account", new_account, "master_name", newdn)
webnotes.conn.set_value("Account", new_account or old_account, "master_name", newdn)
def add_abbr_if_missing(dn, company):
from setup.doctype.company.company import get_name_with_abbr
return get_name_with_abbr(dn, company)
def get_account_for(account_for_doctype, account_for):
if account_for_doctype in ["Customer", "Supplier"]:

View File

@@ -161,7 +161,7 @@ class DocType(TransactionBase):
def before_rename(self, olddn, newdn, merge=False):
from accounts.utils import rename_account_for
rename_account_for("Supplier", olddn, newdn, merge)
rename_account_for("Supplier", olddn, newdn, merge, self.doc.company)
def after_rename(self, olddn, newdn, merge=False):
set_field = ''

View File

@@ -1,6 +1,6 @@
{
"app_name": "ERPNext",
"app_version": "3.8.0",
"app_version": "3.8.5",
"base_template": "app/portal/templates/base.html",
"modules": {
"Accounts": {
@@ -74,5 +74,5 @@
"type": "module"
}
},
"requires_framework_version": "==3.9.0"
"requires_framework_version": "==3.9.4"
}

View File

@@ -4,14 +4,16 @@
from __future__ import unicode_literals
import webnotes
def execute():
serial_nos = webnotes.conn.sql("""select name from `tabSerial No` where docstatus=0
and status in ('Available', 'Sales Returned') and ifnull(warehouse, '') = ''""")
for sr in serial_nos:
try:
sr_bean = webnotes.bean("Serial No", sr[0])
sr_bean.make_controller().via_stock_ledger = True
sr_bean.save()
last_sle = webnotes.bean("Serial No", sr[0]).make_controller().get_last_sle()
if last_sle.actual_qty > 0:
webnotes.conn.set_value("Serial No", sr[0], "warehouse", last_sle.warehouse)
webnotes.conn.commit()
except:
pass

View File

@@ -156,7 +156,7 @@ class DocType(TransactionBase):
def before_rename(self, olddn, newdn, merge=False):
from accounts.utils import rename_account_for
rename_account_for("Customer", olddn, newdn, merge)
rename_account_for("Customer", olddn, newdn, merge, self.doc.company)
def after_rename(self, olddn, newdn, merge=False):
set_field = ''

View File

@@ -87,8 +87,6 @@ class DocType(StockController):
self.doc.status = "Sales Returned"
else:
self.doc.status = "Available"
if not self.doc.warehouse:
self.doc.warehouse = last_sle.warehouse
else:
if document_type == "Purchase Return":
self.doc.status = "Purchase Returned"
@@ -215,6 +213,10 @@ def validate_serial_no(sle, item_det):
if len(serial_nos) and len(serial_nos) != abs(cint(sle.actual_qty)):
webnotes.throw(_("Serial Nos do not match with qty") + \
(": %s (%s)" % (sle.item_code, sle.actual_qty)), SerialNoQtyError)
if len(serial_nos) != len(set(serial_nos)):
webnotes.throw(_("Duplicate Serial No entered against item") +
(": %s" % sle.item_code), SerialNoDuplicateError)
for serial_no in serial_nos:
if webnotes.conn.exists("Serial No", serial_no):

View File

@@ -102,7 +102,7 @@ class DocType:
webnotes.conn.sql("delete from `tabBin` where warehouse=%s", olddn)
from accounts.utils import rename_account_for
rename_account_for("Warehouse", olddn, newdn, merge)
rename_account_for("Warehouse", olddn, newdn, merge, self.doc.company)
return newdn

View File

@@ -49,10 +49,6 @@ class DocType(TransactionBase):
self.doc.company = webnotes.conn.get_value("Lead", self.doc.lead, "company") or \
webnotes.conn.get_default("company")
def on_trash(self):
webnotes.conn.sql("""update `tabCommunication` set support_ticket=NULL
where support_ticket=%s""", (self.doc.name,))
def update_status(self):
status = webnotes.conn.get_value("Support Ticket", self.doc.name, "status")
if self.doc.status!="Open" and status =="Open" and not self.doc.first_responded_on:

View File

@@ -55,7 +55,7 @@ class DocType:
def send_form_sms(self, arg):
"called from client side"
args = load_json(arg)
self.send_sms([str(args['number'])], str(args['message']))
self.send_sms([cstr(args['number'])], cstr(args['message']))
def send_sms(self, receiver_list, msg, sender_name = ''):
receiver_list = self.validate_receiver_nos(receiver_list)