Merge branch 'develop'
This commit is contained in:
commit
e91b3ea407
@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = '5.8.0'
|
__version__ = '5.8.1'
|
||||||
|
@ -148,14 +148,24 @@ cur_frm.fields_dict['items'].grid.get_field("item_code").get_query = function(do
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict['credit_to'].get_query = function(doc) {
|
cur_frm.fields_dict['credit_to'].get_query = function(doc) {
|
||||||
|
// filter on Account
|
||||||
|
if (doc.supplier) {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
'account_type': 'Payable',
|
'account_type': 'Payable',
|
||||||
'root_type': 'Liability',
|
|
||||||
'is_group': 0,
|
'is_group': 0,
|
||||||
'company': doc.company
|
'company': doc.company
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
'report_type': 'Balance Sheet',
|
||||||
|
'is_group': 0,
|
||||||
|
'company': doc.company
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get Print Heading
|
// Get Print Heading
|
||||||
|
@ -91,8 +91,12 @@ class PurchaseInvoice(BuyingController):
|
|||||||
throw(_("Conversion rate cannot be 0 or 1"))
|
throw(_("Conversion rate cannot be 0 or 1"))
|
||||||
|
|
||||||
def validate_credit_to_acc(self):
|
def validate_credit_to_acc(self):
|
||||||
account_type = frappe.db.get_value("Account", self.credit_to, "account_type")
|
account = frappe.db.get_value("Account", self.credit_to, ["account_type", "report_type"], as_dict=True)
|
||||||
if account_type != "Payable":
|
|
||||||
|
if account.report_type != "Balance Sheet":
|
||||||
|
frappe.throw(_("Credit To account must be a Balance Sheet account"))
|
||||||
|
|
||||||
|
if self.supplier and account.account_type != "Payable":
|
||||||
frappe.throw(_("Credit To account must be a Payable account"))
|
frappe.throw(_("Credit To account must be a Payable account"))
|
||||||
|
|
||||||
def check_for_stopped_status(self):
|
def check_for_stopped_status(self):
|
||||||
|
@ -405,10 +405,22 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.set_query("debit_to", function(doc) {
|
cur_frm.set_query("debit_to", function(doc) {
|
||||||
|
// filter on Account
|
||||||
|
if (doc.customer) {
|
||||||
return {
|
return {
|
||||||
filters: [
|
filters: {
|
||||||
['Account', 'root_type', '=', 'Asset'],
|
'account_type': 'Receivable',
|
||||||
['Account', 'account_type', '=', 'Receivable']
|
'is_group': 0,
|
||||||
]
|
'company': doc.company
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
'report_type': 'Balance Sheet',
|
||||||
|
'is_group': 0,
|
||||||
|
'company': doc.company
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -271,8 +271,12 @@ class SalesInvoice(SellingController):
|
|||||||
reconcile_against_document(lst)
|
reconcile_against_document(lst)
|
||||||
|
|
||||||
def validate_debit_to_acc(self):
|
def validate_debit_to_acc(self):
|
||||||
account_type = frappe.db.get_value("Account", self.debit_to, "account_type")
|
account = frappe.db.get_value("Account", self.debit_to, ["account_type", "report_type"], as_dict=True)
|
||||||
if account_type != "Receivable":
|
|
||||||
|
if account.report_type != "Balance Sheet":
|
||||||
|
frappe.throw(_("Debit To account must be a Balance Sheet account"))
|
||||||
|
|
||||||
|
if self.customer and account.account_type != "Receivable":
|
||||||
frappe.throw(_("Debit To account must be a Receivable account"))
|
frappe.throw(_("Debit To account must be a Receivable account"))
|
||||||
|
|
||||||
def validate_fixed_asset_account(self):
|
def validate_fixed_asset_account(self):
|
||||||
|
@ -27,7 +27,7 @@ blogs.
|
|||||||
"""
|
"""
|
||||||
app_icon = "icon-th"
|
app_icon = "icon-th"
|
||||||
app_color = "#e74c3c"
|
app_color = "#e74c3c"
|
||||||
app_version = "5.8.0"
|
app_version = "5.8.1"
|
||||||
github_link = "https://github.com/frappe/erpnext"
|
github_link = "https://github.com/frappe/erpnext"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
@ -5,6 +5,9 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
frappe.reload_doctype("Sales Order Item")
|
||||||
|
frappe.reload_doctype("Purchase Order Item")
|
||||||
|
|
||||||
# sales return
|
# sales return
|
||||||
return_entries = list(frappe.db.sql("""
|
return_entries = list(frappe.db.sql("""
|
||||||
select dn.name as name, dn_item.name as row_id, dn.return_against,
|
select dn.name as name, dn_item.name as row_id, dn.return_against,
|
||||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
version = "5.8.0"
|
version = "5.8.1"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user