Merge pull request #1820 from anandpdoshi/anand-wip

Validate Select Fields
This commit is contained in:
Rushabh Mehta 2014-06-19 16:32:50 +05:30
commit a2f5a7f3cd
9 changed files with 700 additions and 694 deletions

View File

@ -91,7 +91,7 @@
"label": "Account Type", "label": "Account Type",
"oldfieldname": "account_type", "oldfieldname": "account_type",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment", "options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "search_index": 0
}, },
@ -210,7 +210,7 @@
"icon": "icon-money", "icon": "icon-money",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 1,
"modified": "2014-06-03 18:27:58.109303", "modified": "2014-06-19 18:27:58.109303",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Account", "name": "Account",

View File

@ -113,7 +113,7 @@
"label": "Voucher Type", "label": "Voucher Type",
"oldfieldname": "voucher_type", "oldfieldname": "voucher_type",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "Journal Voucher\nSales Invoice\nPurchase Invoice", "options": "Journal Voucher\nSales Invoice\nPurchase Invoice\nPeriod Closing Voucher\nPurchase Receipt\nDelivery Note\nStock Entry\nStock Reconciliation",
"permlevel": 0, "permlevel": 0,
"search_index": 0 "search_index": 0
}, },
@ -186,7 +186,7 @@
"icon": "icon-list", "icon": "icon-list",
"idx": 1, "idx": 1,
"in_create": 1, "in_create": 1,
"modified": "2014-06-09 01:51:29.340077", "modified": "2014-06-19 01:51:29.340077",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "GL Entry", "name": "GL Entry",

View File

@ -186,9 +186,14 @@ class JournalVoucher(AccountsController):
def set_print_format_fields(self): def set_print_format_fields(self):
for d in self.get('entries'): for d in self.get('entries'):
account_type, master_type = frappe.db.get_value("Account", d.account, result = frappe.db.get_value("Account", d.account,
["account_type", "master_type"]) ["account_type", "master_type"])
if not result:
continue
account_type, master_type = result
if master_type in ['Supplier', 'Customer']: if master_type in ['Supplier', 'Customer']:
if not self.pay_to_recd_from: if not self.pay_to_recd_from:
self.pay_to_recd_from = frappe.db.get_value(master_type, self.pay_to_recd_from = frappe.db.get_value(master_type,

View File

@ -42,7 +42,7 @@
], ],
"fiscal_year": "_Test Fiscal Year 2013", "fiscal_year": "_Test Fiscal Year 2013",
"grand_total_import": 0, "grand_total_import": 0,
"naming_series": "BILL", "naming_series": "_T-BILL",
"other_charges": [ "other_charges": [
{ {
"account_head": "_Test Account Shipping Charges - _TC", "account_head": "_Test Account Shipping Charges - _TC",

View File

@ -9,6 +9,7 @@
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1, "in_list_view": 1,
"label": "Feed Type", "label": "Feed Type",
"options": "\nComment\nLogin",
"permlevel": 0 "permlevel": 0
}, },
{ {
@ -48,7 +49,7 @@
], ],
"icon": "icon-rss", "icon": "icon-rss",
"idx": 1, "idx": 1,
"modified": "2014-05-27 03:49:10.882587", "modified": "2014-06-18 03:49:10.882587",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Home", "module": "Home",
"name": "Feed", "name": "Feed",

View File

@ -13,7 +13,7 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"default": "PRO", "default": "PRO-",
"fieldname": "naming_series", "fieldname": "naming_series",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Series", "label": "Series",

View File

@ -16,7 +16,7 @@
"doctype": "Lead", "doctype": "Lead",
"email_id": "test_lead2@example.com", "email_id": "test_lead2@example.com",
"lead_name": "_Test Lead 2", "lead_name": "_Test Lead 2",
"status": "Contacted" "status": "Lead"
}, },
{ {
"doctype": "Lead", "doctype": "Lead",

View File

@ -51,14 +51,14 @@
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1, "in_list_view": 1,
"label": "Number Format", "label": "Number Format",
"options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###", "options": "\n#,###.##\n#.###,##\n# ###.##\n# ###,##\n#'###.##\n#, ###.##\n#,##,###.##\n#,###.###\n#.###\n#,###",
"permlevel": 0 "permlevel": 0
} }
], ],
"icon": "icon-bitcoin", "icon": "icon-bitcoin",
"idx": 1, "idx": 1,
"in_create": 0, "in_create": 0,
"modified": "2014-05-27 03:49:09.038451", "modified": "2014-06-18 03:49:09.038451",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Currency", "name": "Currency",

View File

@ -125,7 +125,7 @@ def create_lead(email_id):
"doctype": "Lead", "doctype": "Lead",
"email_id": email_id, "email_id": email_id,
"lead_name": real_name or email_id, "lead_name": real_name or email_id,
"status": "Contacted", "status": "Lead",
"naming_series": get_default_naming_series("Lead"), "naming_series": get_default_naming_series("Lead"),
"company": frappe.db.get_default("company"), "company": frappe.db.get_default("company"),
"source": "Email" "source": "Email"