Skip to content

Commit f26dcbc

Browse files
committed
Merge branch 'develop'
2 parents f7d81c7 + ecd4658 commit f26dcbc

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

erpnext/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from __future__ import unicode_literals
33
import frappe
44

5-
__version__ = '8.0.18'
5+
__version__ = '8.0.19'
66

77
def get_default_company(user=None):
88
'''Get default company for user'''

erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
def get_data():
44
return {
55
'fieldname': 'purchase_order',
6+
'non_standard_fieldnames': {
7+
'Journal Entry': 'reference_name',
8+
'Payment Entry': 'reference_name'
9+
},
610
'internal_links': {
711
'Material Request': ['items', 'material_request'],
812
'Supplier Quotation': ['items', 'supplier_quotation'],
@@ -13,13 +17,17 @@ def get_data():
1317
'label': _('Related'),
1418
'items': ['Purchase Receipt', 'Purchase Invoice']
1519
},
20+
{
21+
'label': _('Payment'),
22+
'items': ['Payment Entry', 'Journal Entry']
23+
},
1624
{
1725
'label': _('Reference'),
1826
'items': ['Material Request', 'Supplier Quotation', 'Project']
1927
},
2028
{
2129
'label': _('Sub-contracting'),
2230
'items': ['Stock Entry']
23-
},
31+
}
2432
]
2533
}

erpnext/selling/doctype/sales_order/sales_order_dashboard.py

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ def get_data():
55
'fieldname': 'sales_order',
66
'non_standard_fieldnames': {
77
'Delivery Note': 'against_sales_order',
8+
'Journal Entry': 'reference_name',
9+
'Payment Entry': 'reference_name',
10+
'Payment Request': 'reference_name'
811
},
912
'internal_links': {
1013
'Quotation': ['items', 'prevdoc_docname']
@@ -30,5 +33,9 @@ def get_data():
3033
'label': _('Reference'),
3134
'items': ['Quotation']
3235
},
36+
{
37+
'label': _('Payment'),
38+
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
39+
},
3340
]
3441
}

erpnext/stock/doctype/batch/batch.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,18 @@ def set_batch_nos(doc, warehouse_field, throw = False):
101101

102102
def get_batch_no(item_code, warehouse, qty, throw=False):
103103
'''get the smallest batch with for the given item_code, warehouse and qty'''
104-
batches = sorted(
105-
get_batch_qty(item_code = item_code, warehouse = warehouse),
106-
lambda a, b: 1 if a.qty > b.qty else -1)
107-
104+
108105
batch_no = None
109-
for b in batches:
110-
if b.qty >= qty:
111-
batch_no = b.batch_no
112-
# found!
113-
break
106+
107+
batches = get_batch_qty(item_code = item_code, warehouse = warehouse)
108+
if batches:
109+
batches = sorted(batches, lambda a, b: 1 if a.qty > b.qty else -1)
110+
111+
for b in batches:
112+
if b.qty >= qty:
113+
batch_no = b.batch_no
114+
# found!
115+
break
114116

115117
if not batch_no:
116118
frappe.msgprint(_('Please select a Batch for Item {0}. Unable to find a single batch that fulfills this requirement').format(frappe.bold(item_code)))

0 commit comments

Comments
 (0)