From 60fcce66f763cdf9086e84996b375fd12668f35d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 30 Jan 2014 12:08:44 +0530 Subject: [PATCH 1/4] Minor fix in accounts receivable report --- accounts/report/accounts_receivable/accounts_receivable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/report/accounts_receivable/accounts_receivable.py b/accounts/report/accounts_receivable/accounts_receivable.py index 1f24c584b6..eb8c91f99f 100644 --- a/accounts/report/accounts_receivable/accounts_receivable.py +++ b/accounts/report/accounts_receivable/accounts_receivable.py @@ -133,7 +133,7 @@ class AccountsReceivableReport(object): conditions, values = self.prepare_conditions() self.gl_entries = webnotes.conn.sql("""select * from `tabGL Entry` where docstatus < 2 {0} order by posting_date, account""".format(conditions), - values, as_dict=True, debug=1) + values, as_dict=True) return self.gl_entries From 3f657bcf51a6f47948c72eea674ac125018b8f2c Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Thu, 30 Jan 2014 14:29:43 +0600 Subject: [PATCH 2/4] bumped to version 3.8.0 --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index cd3e91bda8..be5d2bd65c 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "app_name": "ERPNext", - "app_version": "3.7.1", + "app_version": "3.8.0", "base_template": "app/portal/templates/base.html", "modules": { "Accounts": { @@ -74,5 +74,5 @@ "type": "module" } }, - "requires_framework_version": "==3.8.0" + "requires_framework_version": "==3.9.0" } \ No newline at end of file From f2f17959ab5e6865d2e3a14eac58272d865d5c43 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 30 Jan 2014 14:54:25 +0530 Subject: [PATCH 3/4] Serial no fix --- patches/1401/fix_serial_no_status_and_warehouse.py | 8 +++++--- stock/doctype/serial_no/serial_no.py | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/1401/fix_serial_no_status_and_warehouse.py b/patches/1401/fix_serial_no_status_and_warehouse.py index fe43c282d8..9e5579c90c 100644 --- a/patches/1401/fix_serial_no_status_and_warehouse.py +++ b/patches/1401/fix_serial_no_status_and_warehouse.py @@ -4,14 +4,16 @@ from __future__ import unicode_literals import webnotes + def execute(): serial_nos = webnotes.conn.sql("""select name from `tabSerial No` where docstatus=0 and status in ('Available', 'Sales Returned') and ifnull(warehouse, '') = ''""") for sr in serial_nos: try: - sr_bean = webnotes.bean("Serial No", sr[0]) - sr_bean.make_controller().via_stock_ledger = True - sr_bean.save() + last_sle = webnotes.bean("Serial No", sr[0]).make_controller().get_last_sle() + if last_sle.actual_qty > 0: + webnotes.conn.set_value("Serial No", sr[0], "warehouse", last_sle.warehouse) + webnotes.conn.commit() except: pass \ No newline at end of file diff --git a/stock/doctype/serial_no/serial_no.py b/stock/doctype/serial_no/serial_no.py index e6557b4284..57b3b460b1 100644 --- a/stock/doctype/serial_no/serial_no.py +++ b/stock/doctype/serial_no/serial_no.py @@ -87,8 +87,6 @@ class DocType(StockController): self.doc.status = "Sales Returned" else: self.doc.status = "Available" - if not self.doc.warehouse: - self.doc.warehouse = last_sle.warehouse else: if document_type == "Purchase Return": self.doc.status = "Purchase Returned" From 5d976ca3acf18a6161954dc606f2b348a2d3033b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 30 Jan 2014 15:12:39 +0530 Subject: [PATCH 4/4] recurring invoice test fix --- accounts/doctype/sales_invoice/test_sales_invoice.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accounts/doctype/sales_invoice/test_sales_invoice.py b/accounts/doctype/sales_invoice/test_sales_invoice.py index e98dfdc2a0..ccb7d532a5 100644 --- a/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -654,7 +654,8 @@ class TestSalesInvoice(unittest.TestCase): def _test_recurring_invoice(self, base_si, first_and_last_day): from webnotes.utils import add_months, get_last_day - from accounts.doctype.sales_invoice.sales_invoice import manage_recurring_invoices + from accounts.doctype.sales_invoice.sales_invoice \ + import manage_recurring_invoices, get_next_date no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.doc.recurring_type] @@ -662,7 +663,8 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(i+1, webnotes.conn.sql("""select count(*) from `tabSales Invoice` where recurring_id=%s and docstatus=1""", base_si.doc.recurring_id)[0][0]) - next_date = add_months(base_si.doc.posting_date, no_of_months) + next_date = get_next_date(base_si.doc.posting_date, no_of_months, + base_si.doc.repeat_on_day_of_month) manage_recurring_invoices(next_date=next_date, commit=False)