From 954f89757235ae390b9c246f420d5adf909aa7de Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 11 Feb 2013 15:55:30 +0530 Subject: [PATCH 01/10] in product listing, don't truncate description --- website/helpers/product.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/helpers/product.py b/website/helpers/product.py index 2685d10ed8..32534a5ecb 100644 --- a/website/helpers/product.py +++ b/website/helpers/product.py @@ -91,8 +91,6 @@ def get_item_for_list_in_html(r): def scrub_item_for_list(r): if not r.website_description: r.website_description = "No description given" - if len(r.website_description.split(" ")) > 24: - r.website_description = " ".join(r.website_description.split(" ")[:24]) + "..." r.website_image = url_for_website(r.website_image) def get_parent_item_groups(item_group_name): From ca73b90a0d4f2b444f9494ae1d04c89644dd045c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 11 Feb 2013 19:32:18 +0530 Subject: [PATCH 02/10] raw material supplied in purchase receipt should be a no copy field --- stock/doctype/purchase_receipt_item/purchase_receipt_item.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt index fd73c879ff..8c20d4cd67 100755 --- a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt +++ b/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-02-07 08:28:23", "docstatus": 0, - "modified": "2013-02-08 14:06:15", + "modified": "2013-02-11 08:13:11", "modified_by": "Administrator", "owner": "Administrator" }, @@ -385,6 +385,7 @@ "hidden": 1, "in_filter": 0, "label": "Raw Materials Supplied Cost", + "no_copy": 1, "oldfieldname": "rm_supp_cost", "oldfieldtype": "Currency", "options": "Company:company:default_currency", From d8c3aa22a0360fcd1a41680cd7159d530a59b27a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 11 Feb 2013 19:33:33 +0530 Subject: [PATCH 03/10] removed product param in get_product_list --- website/helpers/product.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/website/helpers/product.py b/website/helpers/product.py index 32534a5ecb..6cd4a5f83f 100644 --- a/website/helpers/product.py +++ b/website/helpers/product.py @@ -28,9 +28,7 @@ def get_product_info(item_code): } @webnotes.whitelist(allow_guest=True) -def get_product_list(search=None, product_group=None, start=0, limit=10): - # DOUBT: why is product_group param passed? - +def get_product_list(search=None, start=0, limit=10): # base query query = """select name, item_name, page_name, website_image, item_group, web_long_description as website_description @@ -47,7 +45,6 @@ def get_product_list(search=None, product_group=None, start=0, limit=10): data = webnotes.conn.sql(query, { "search": search, - "product_group": product_group }, as_dict=1) return [get_item_for_list_in_html(r) for r in data] From e1ad443c91d41fcd2c00873fce6d18e3a5a33379 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 11 Feb 2013 20:28:56 +0530 Subject: [PATCH 04/10] re-adding description as it is distorting list --- website/helpers/product.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/helpers/product.py b/website/helpers/product.py index 6cd4a5f83f..ef433b1a29 100644 --- a/website/helpers/product.py +++ b/website/helpers/product.py @@ -88,6 +88,8 @@ def get_item_for_list_in_html(r): def scrub_item_for_list(r): if not r.website_description: r.website_description = "No description given" + if len(r.website_description.split(" ")) > 24: + r.website_description = " ".join(r.website_description.split(" ")[:24]) + "..." r.website_image = url_for_website(r.website_image) def get_parent_item_groups(item_group_name): From c9629a481da750bfe6f58b3924a089021fbc914f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 12 Feb 2013 12:54:58 +0530 Subject: [PATCH 05/10] fetch favicon from website settings --- website/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/website/utils.py b/website/utils.py index cd1b6a5974..48ca844ae9 100644 --- a/website/utils.py +++ b/website/utils.py @@ -19,7 +19,6 @@ from __future__ import unicode_literals import os import conf import webnotes -from webnotes.utils import cstr page_map = { 'Web Page': webnotes._dict({ @@ -52,7 +51,7 @@ def render(page_name): html = get_html(page_name) else: html = get_html('index') - except Exception, e: + except Exception: html = get_html('error') from webnotes.handler import eprint, print_zip @@ -244,7 +243,7 @@ def get_outer_env(): }) settings = webnotes.doc("Website Settings", "Website Settings") - for k in ["brand_html", "copyright", "address", "top_bar_background"]: + for k in ["brand_html", "copyright", "address", "top_bar_background", "favicon"]: if k in settings.fields: ret[k] = settings.fields[k] From 3422bdfec5edc9ec99c35a861f9ca4900ce3e330 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 12 Feb 2013 13:03:25 +0530 Subject: [PATCH 06/10] added Website Manager role in install --- startup/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup/install.py b/startup/install.py index d94fd64b0e..b42b7163c0 100644 --- a/startup/install.py +++ b/startup/install.py @@ -33,7 +33,7 @@ def make_roles(): "Partner", "Projects User", "Purchase Manager", "Purchase Master Manager", "Purchase User", "Quality Manager", "Sales Manager", "Sales Master Manager", "Sales User", "Supplier", "Support Manager", - "Support Team"] + "Support Team", "Website Manager"] for r in roles: doc = webnotes.doc(fielddata = { From 9b051db7d636d78e6bbad3d11fa58d9914691e49 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 12 Feb 2013 13:04:15 +0530 Subject: [PATCH 07/10] show page name in web page list view --- website/doctype/web_page/web_page.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/doctype/web_page/web_page.txt b/website/doctype/web_page/web_page.txt index 788f1c04d1..861ac86e39 100644 --- a/website/doctype/web_page/web_page.txt +++ b/website/doctype/web_page/web_page.txt @@ -1,8 +1,8 @@ [ { - "creation": "2013-01-10 16:34:32", + "creation": "2013-01-27 16:31:21", "docstatus": 0, - "modified": "2013-01-22 14:57:27", + "modified": "2013-02-12 09:33:47", "modified_by": "Administrator", "owner": "Administrator" }, @@ -66,6 +66,7 @@ "doctype": "DocField", "fieldname": "page_name", "fieldtype": "Data", + "in_list_view": 1, "label": "Page Name", "read_only": 1 }, From 945b39f98452541f10e2e2e900a030e7dda93b11 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 12 Feb 2013 15:17:25 +0530 Subject: [PATCH 08/10] fixes in payemnt reconciliation --- .../payment_to_invoice_matching_tool.js | 3 ++- .../payment_to_invoice_matching_tool.py | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js index 06c014cb78..022f900b05 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js @@ -44,7 +44,8 @@ cur_frm.fields_dict.voucher_no.get_query = function(doc) { and (ifnull(gle.against_voucher, '') = '' \ or ifnull(gle.against_voucher, '') = gle.voucher_no ) \ and ifnull(gle.%(account_type)s, 0) > 0 \ - and (select ifnull(abs(sum(debit) - sum(credit)), 0) from `tabGL Entry` \ + and (select ifnull(abs(sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))), 0) \ + from `tabGL Entry` \ where against_voucher_type = '%(dt)s' \ and against_voucher = gle.voucher_no \ and voucher_no != gle.voucher_no \ diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index d585ceaefa..b75142b66e 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -39,16 +39,14 @@ class DocType: (self.doc.voucher_type, self.doc.voucher_no, self.doc.account)) total_amount = total_amount and flt(total_amount[0][0]) or 0 - reconciled_payment = webnotes.conn.sql(""" - select sum(%s) - sum(%s) from `tabGL Entry` where + select sum(ifnull(%s, 0)) - sum(ifnull(%s, 0)) from `tabGL Entry` where against_voucher = %s and voucher_no != %s and account = %s and ifnull(is_cancelled, 'No') = 'No'""" % ((self.doc.account_type == 'debit' and 'credit' or 'debit'), self.doc.account_type, '%s', '%s', '%s'), (self.doc.voucher_no, self.doc.voucher_no, self.doc.account)) reconciled_payment = reconciled_payment and flt(reconciled_payment[0][0]) or 0 - ret = { 'total_amount': total_amount, 'pending_amt_to_reconcile': total_amount - reconciled_payment From cd50c2513f04112aff680363885ac9f7b9938eef Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 12 Feb 2013 15:46:24 +0530 Subject: [PATCH 09/10] removed wrong validation --- accounts/doctype/purchase_invoice/purchase_invoice.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py index 8512b01831..db0ddd807d 100644 --- a/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -269,9 +269,6 @@ class DocType(BuyingController): if not cstr(data[0]['currency']) == cstr(self.doc.currency): msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " currency : " + cstr(data[0]['currency']) + " does not match with currency of current document.") raise Exception - if not flt(data[0]['conversion_rate']) == flt(self.doc.conversion_rate): - msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " conversion_rate : " + cstr(data[0]['conversion_rate']) + " does not match with conversion_rate of current document.") - raise Exception def set_aging_date(self): if self.doc.is_opening != 'Yes': From 4860754407d0284ede75f3fc9f39d437f680420d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 12 Feb 2013 18:49:55 +0530 Subject: [PATCH 10/10] call calc_adjustment_amount function only if docstatus is zero --- .../payment_to_invoice_matching_tool.js | 1 + buying/doctype/purchase_common/purchase_common.js | 2 +- selling/doctype/sales_common/sales_common.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js index 022f900b05..8b35bc1028 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js @@ -33,6 +33,7 @@ cur_frm.cscript.refresh = function(doc) { } cur_frm.fields_dict.voucher_no.get_query = function(doc) { + // TO-do: check for pos, it should not come if (!doc.account) msgprint("Please select Account first"); else { return repl("select gle.voucher_no, gle.posting_date, gle.%(account_type)s \ diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js index a149db56f5..3a9d89110f 100644 --- a/buying/doctype/purchase_common/purchase_common.js +++ b/buying/doctype/purchase_common/purchase_common.js @@ -419,7 +419,7 @@ cur_frm.cscript.validate = function(doc, cdt, cdn) { cur_frm.cscript.calc_amount(doc, 1); // calculate advances if pv - if(doc.doctype == 'Purchase Invoice') calc_total_advance(doc, cdt, cdn); + if(doc.docstatus == 0 && doc.doctype == 'Purchase Invoice') calc_total_advance(doc, cdt, cdn); } // **************** RE-CALCULATE VALUES *************************** diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js index 50b97a2b55..6a618c9a1a 100644 --- a/selling/doctype/sales_common/sales_common.js +++ b/selling/doctype/sales_common/sales_common.js @@ -891,7 +891,8 @@ cur_frm.cscript.validate = function(doc, cdt, cdn) { } cur_frm.cscript.calculate_charges (doc, cdt, cdn); - if (cur_frm.cscript.calc_adjustment_amount) cur_frm.cscript.calc_adjustment_amount(doc); + if (doc.docstatus == 0 && cur_frm.cscript.calc_adjustment_amount) + cur_frm.cscript.calc_adjustment_amount(doc); }