[minor] fixes reported on support
This commit is contained in:
parent
5dfd1d48fa
commit
659bc1aca4
@ -300,6 +300,9 @@ class SalesInvoice(SellingController):
|
|||||||
account = frappe.db.get_value("Account", self.debit_to,
|
account = frappe.db.get_value("Account", self.debit_to,
|
||||||
["account_type", "report_type", "account_currency"], as_dict=True)
|
["account_type", "report_type", "account_currency"], as_dict=True)
|
||||||
|
|
||||||
|
if not account:
|
||||||
|
frappe.throw(_("Debit To is required"))
|
||||||
|
|
||||||
if account.report_type != "Balance Sheet":
|
if account.report_type != "Balance Sheet":
|
||||||
frappe.throw(_("Debit To account must be a Balance Sheet account"))
|
frappe.throw(_("Debit To account must be a Balance Sheet account"))
|
||||||
|
|
||||||
|
@ -109,20 +109,24 @@ def create_fiscal_year_and_company(args):
|
|||||||
create_bank_account(args)
|
create_bank_account(args)
|
||||||
|
|
||||||
args["curr_fiscal_year"] = curr_fiscal_year
|
args["curr_fiscal_year"] = curr_fiscal_year
|
||||||
|
|
||||||
def create_bank_account(args):
|
def create_bank_account(args):
|
||||||
if args.get("bank_account"):
|
if args.get("bank_account"):
|
||||||
bank_account_group = frappe.db.get_value("Account",
|
bank_account_group = frappe.db.get_value("Account",
|
||||||
{"account_type": "Bank", "is_group": 1, "root_type": "Asset"})
|
{"account_type": "Bank", "is_group": 1, "root_type": "Asset"})
|
||||||
if bank_account_group:
|
if bank_account_group:
|
||||||
frappe.get_doc({
|
bank_account = frappe.get_doc({
|
||||||
"doctype": "Account",
|
"doctype": "Account",
|
||||||
'account_name': args.get("bank_account"),
|
'account_name': args.get("bank_account"),
|
||||||
'parent_account': bank_account_group,
|
'parent_account': bank_account_group,
|
||||||
'is_group':0,
|
'is_group':0,
|
||||||
'company':args.get('company_name').strip(),
|
'company':args.get('company_name').strip(),
|
||||||
"account_type": "Bank",
|
"account_type": "Bank",
|
||||||
}).insert()
|
})
|
||||||
|
try:
|
||||||
|
bank_account.insert()
|
||||||
|
except RootNotEditable:
|
||||||
|
frappe.throw(_("Bank account cannot be named as {0}").format(args.get("bank_account")))
|
||||||
|
|
||||||
def create_price_lists(args):
|
def create_price_lists(args):
|
||||||
for pl_type, pl_name in (("Selling", _("Standard Selling")), ("Buying", _("Standard Buying"))):
|
for pl_type, pl_name in (("Selling", _("Standard Selling")), ("Buying", _("Standard Buying"))):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user