From db8f41ba55647ad8e5b572eb9c70a4565af57a3e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 26 Apr 2017 14:05:14 +0530 Subject: [PATCH 1/3] Added Payment documents as Quick Links in SO/PO --- .../doctype/purchase_order/purchase_order_dashboard.py | 10 +++++++++- .../doctype/sales_order/sales_order_dashboard.py | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py index 5e460df4f3..50382d5fa1 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py @@ -3,6 +3,10 @@ from frappe import _ def get_data(): return { 'fieldname': 'purchase_order', + 'non_standard_fieldnames': { + 'Journal Entry': 'reference_name', + 'Payment Entry': 'reference_name' + }, 'internal_links': { 'Material Request': ['items', 'material_request'], 'Supplier Quotation': ['items', 'supplier_quotation'], @@ -13,6 +17,10 @@ def get_data(): 'label': _('Related'), 'items': ['Purchase Receipt', 'Purchase Invoice'] }, + { + 'label': _('Payment'), + 'items': ['Payment Entry', 'Journal Entry'] + }, { 'label': _('Reference'), 'items': ['Material Request', 'Supplier Quotation', 'Project'] @@ -20,6 +28,6 @@ def get_data(): { 'label': _('Sub-contracting'), 'items': ['Stock Entry'] - }, + } ] } \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py index 51f81f89b6..a0ed034313 100644 --- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py +++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py @@ -5,6 +5,9 @@ def get_data(): 'fieldname': 'sales_order', 'non_standard_fieldnames': { 'Delivery Note': 'against_sales_order', + 'Journal Entry': 'reference_name', + 'Payment Entry': 'reference_name', + 'Payment Request': 'reference_name' }, 'internal_links': { 'Quotation': ['items', 'prevdoc_docname'] @@ -30,5 +33,9 @@ def get_data(): 'label': _('Reference'), 'items': ['Quotation'] }, + { + 'label': _('Payment'), + 'items': ['Payment Entry', 'Payment Request', 'Journal Entry'] + }, ] } \ No newline at end of file From 96c247c83420b5a594f9d65831ccbbcf2bdee1cf Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 26 Apr 2017 14:29:33 +0530 Subject: [PATCH 2/3] Pick batch autmatically only if batch found --- erpnext/stock/doctype/batch/batch.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index 8ef8e915ee..5749afb8e7 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -101,16 +101,18 @@ def set_batch_nos(doc, warehouse_field, throw = False): def get_batch_no(item_code, warehouse, qty, throw=False): '''get the smallest batch with for the given item_code, warehouse and qty''' - batches = sorted( - get_batch_qty(item_code = item_code, warehouse = warehouse), - lambda a, b: 1 if a.qty > b.qty else -1) - + batch_no = None - for b in batches: - if b.qty >= qty: - batch_no = b.batch_no - # found! - break + + batches = get_batch_qty(item_code = item_code, warehouse = warehouse) + if batches: + batches = sorted(batches, lambda a, b: 1 if a.qty > b.qty else -1) + + for b in batches: + if b.qty >= qty: + batch_no = b.batch_no + # found! + break if not batch_no: frappe.msgprint(_('Please select a Batch for Item {0}. Unable to find a single batch that fulfills this requirement').format(frappe.bold(item_code))) From ecd46588ec3d5296e67bd3ff2dd930d1a38857fd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 26 Apr 2017 15:15:37 +0600 Subject: [PATCH 3/3] bumped to version 8.0.19 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 44ba88adfa..22589497fc 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.0.18' +__version__ = '8.0.19' def get_default_company(user=None): '''Get default company for user'''