added client side functions and mode_of_payment defaults

This commit is contained in:
Rushabh Mehta 2012-12-04 16:34:26 +05:30
parent 586ac7c977
commit 535d6c4d91
2 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,7 @@
"docstatus": 0,
"creation": "2012-07-03 13:30:49",
"modified_by": "Administrator",
"modified": "2012-12-04 16:31:20"
"modified": "2012-12-04 16:33:37"
},
{
"autoname": "field:mode_of_payment",
@ -57,7 +57,7 @@
"options": "Company"
},
{
"description": "Will be automatically updated in POS Invoice when this mode is selected.",
"description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Default Account",

View File

@ -900,7 +900,9 @@ def assign_task_to_owner(inv, msg, users):
@webnotes.whitelist()
def get_bank_cash_account(mode_of_payment):
val = webnotes.conn.get_value("Mode of Payment", mode_of_payment, "default_account")
if not val:
webnotes.msgprint("Default Account not set in Mode of Payment: ")
return {
"cash_bank_account": webnotes.conn.get_value("Mode of Payment",
mode_of_payment, "default_account")
"cash_bank_account": val
}