From 148cbaeafe7e35fda64ab2857bc423aafee4c40a Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 24 Jul 2013 21:44:59 +0530 Subject: [PATCH 1/2] [minor] fixed help for Sales Invoice / Purchase Invoice --- .../purchase_invoice/purchase_invoice.txt | 18 +++++++++--------- .../doctype/sales_invoice/sales_invoice.txt | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.txt b/accounts/doctype/purchase_invoice/purchase_invoice.txt index 44cd20ff58..8d65281624 100755 --- a/accounts/doctype/purchase_invoice/purchase_invoice.txt +++ b/accounts/doctype/purchase_invoice/purchase_invoice.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-21 16:16:39", "docstatus": 0, - "modified": "2013-07-23 15:27:03", + "modified": "2013-07-24 21:44:41", "modified_by": "Administrator", "owner": "Administrator" }, @@ -70,7 +70,7 @@ "reqd": 1 }, { - "description": "The account to which you will pay (have paid) the money to.", + "description": "Supplier (Payable) Account", "doctype": "DocField", "fieldname": "credit_to", "fieldtype": "Link", @@ -771,22 +771,22 @@ "reqd": 0 }, { - "amend": 1, - "cancel": 1, - "create": 1, + "amend": 0, + "cancel": 0, + "create": 0, "doctype": "DocPerm", "role": "Accounts User", - "submit": 1, - "write": 1 + "submit": 0, + "write": 0 }, { "amend": 0, "cancel": 0, - "create": 1, + "create": 0, "doctype": "DocPerm", "role": "Purchase User", "submit": 0, - "write": 1 + "write": 0 }, { "amend": 0, diff --git a/accounts/doctype/sales_invoice/sales_invoice.txt b/accounts/doctype/sales_invoice/sales_invoice.txt index a04fca41b3..480f9fec35 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.txt +++ b/accounts/doctype/sales_invoice/sales_invoice.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-24 19:29:05", "docstatus": 0, - "modified": "2013-07-23 15:28:32", + "modified": "2013-07-24 21:44:15", "modified_by": "Administrator", "owner": "Administrator" }, @@ -62,7 +62,7 @@ "reqd": 1 }, { - "description": "The account to which you will pay (have paid) the money to.", + "description": "Customer (Receivable) Account", "doctype": "DocField", "fieldname": "debit_to", "fieldtype": "Link", From a877053d90df6c2696c6bbd91230b3f39d8106b4 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 25 Jul 2013 10:49:59 +0530 Subject: [PATCH 2/2] [accounts] [minor] [fix] fixed set_query for Mode of Payment --- .../doctype/mode_of_payment/mode_of_payment.js | 2 +- controllers/queries.py | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/accounts/doctype/mode_of_payment/mode_of_payment.js b/accounts/doctype/mode_of_payment/mode_of_payment.js index e3625e6100..e9e5738509 100644 --- a/accounts/doctype/mode_of_payment/mode_of_payment.js +++ b/accounts/doctype/mode_of_payment/mode_of_payment.js @@ -16,9 +16,9 @@ cur_frm.set_query("default_account", function(doc) { return{ - query: "controllers.queries.account_query", filters: { 'account_type': "Bank or Cash", + "group_or_ledger": "Ledger", 'company': doc.company } } diff --git a/controllers/queries.py b/controllers/queries.py index 8a990771ba..478971a148 100644 --- a/controllers/queries.py +++ b/controllers/queries.py @@ -144,24 +144,6 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters): limit %(start)s, %(page_len)s """ % {'field': fields,'key': searchfield, 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len}) - -def account_query(doctype, txt, searchfield, start, page_len, filters): - conditions = [] - if not filters: - filters = {} - if not filters.group_or_ledger: - filters.group_or_ledger = "Ledger" - - return webnotes.conn.sql(""" - select tabAccount.name, tabAccount.parent_account, tabAccount.debit_or_credit - from tabAccount - where tabAccount.docstatus!=2 - and - and tabAccount.%(key)s LIKE "%(txt)s" - %(fcond)s %(mcond)s - limit %(start)s, %(page_len)s""" % {'key': searchfield, - 'txt': "%%%s%%" % txt, 'fcond': get_filters_cond(doctype, filters, conditions), - 'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len}) def tax_account_query(doctype, txt, searchfield, start, page_len, filters): return webnotes.conn.sql("""select name, parent_account, debit_or_credit