Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc274e29ec | ||
|
|
d45f7d60c3 | ||
|
|
c1611abebf | ||
|
|
e0f6b3edbe | ||
|
|
40c5174aa0 | ||
|
|
0799b28e46 | ||
|
|
89a3ee7f57 | ||
|
|
347bf93b4f | ||
|
|
17cb5b7799 | ||
|
|
e0c9dd3d23 | ||
|
|
41891ec95c | ||
|
|
dfc0072929 | ||
|
|
e1e5d675ac | ||
|
|
c4e92c6416 | ||
|
|
2c832addca | ||
|
|
c095cfa224 | ||
|
|
fbb10d37d3 | ||
|
|
9294fc8e7e | ||
|
|
07d4c373f3 | ||
|
|
ae763d7afa | ||
|
|
70e2a50f0f | ||
|
|
1b8c158fdc | ||
|
|
4078ef8ef5 | ||
|
|
c6b59ef082 | ||
|
|
dbbba659a8 | ||
|
|
3c3719fa9c | ||
|
|
a7af1d619e | ||
|
|
18eb8c5f68 |
30
.travis.yml
Normal file
30
.travis.yml
Normal 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-05-21 16:16:39",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-11-22 17:15:27",
|
||||
"modified": "2014-02-11 12:01:59",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -739,6 +739,15 @@
|
||||
"fieldtype": "Column Break",
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"doctype": "DocField",
|
||||
"fieldname": "letter_head",
|
||||
"fieldtype": "Select",
|
||||
"label": "Letter Head",
|
||||
"options": "link:Letter Head",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "fiscal_year",
|
||||
|
||||
@@ -51,10 +51,10 @@ def execute(filters=None):
|
||||
ageing_based_on_date = gle.posting_date
|
||||
|
||||
row += get_ageing_data(age_on, ageing_based_on_date, outstanding_amount) + \
|
||||
[account_map.get(gle.account).get("supplier") or ""]
|
||||
[account_map.get(gle.account, {}).get("supplier") or ""]
|
||||
|
||||
if supplier_naming_by == "Naming Series":
|
||||
row += [account_map.get(gle.account).get("supplier_name") or ""]
|
||||
row += [account_map.get(gle.account, {}).get("supplier_name") or ""]
|
||||
|
||||
row += [account_supplier_type_map.get(gle.account), gle.remarks]
|
||||
data.append(row)
|
||||
|
||||
@@ -101,21 +101,20 @@ class AccountsReceivableReport(object):
|
||||
return flt(gle.debit) - flt(gle.credit) - payment_received
|
||||
|
||||
def get_customer(self, account):
|
||||
return self.get_account_map().get(account).get("customer") or ""
|
||||
return self.get_account_map().get(account, {}).get("customer") or ""
|
||||
|
||||
def get_customer_name(self, account):
|
||||
return self.get_account_map().get(account).get("customer_name") or ""
|
||||
return self.get_account_map().get(account, {}).get("customer_name") or ""
|
||||
|
||||
def get_territory(self, account):
|
||||
return self.get_account_map().get(account).get("territory") or ""
|
||||
return self.get_account_map().get(account, {}).get("territory") or ""
|
||||
|
||||
def get_account_map(self):
|
||||
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):
|
||||
|
||||
@@ -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"]:
|
||||
|
||||
@@ -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 = ''
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"app_name": "ERPNext",
|
||||
"app_version": "3.8.1",
|
||||
"app_version": "3.8.6",
|
||||
"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.5"
|
||||
}
|
||||
@@ -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 = ''
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-05-21 16:16:39",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-11-22 17:15:47",
|
||||
"modified": "2014-02-11 12:01:00",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -621,6 +621,15 @@
|
||||
"oldfieldtype": "Date",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"doctype": "DocField",
|
||||
"fieldname": "letter_head",
|
||||
"fieldtype": "Select",
|
||||
"label": "Letter Head",
|
||||
"options": "link:Letter Head",
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"doctype": "DocField",
|
||||
|
||||
@@ -213,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):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user