Skip to content

Commit 03d9570

Browse files
committed
reorder level fixes
1 parent d921e4d commit 03d9570

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

selling/doctype/sales_order/sales_order.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ def update_stock_ledger(self, update_stock, clear = 0):
432432
"item_code": d['item_code'],
433433
"reserved_qty": flt(update_stock) * flt(d['qty']),
434434
"posting_date": self.doc.transaction_date,
435-
"doc_type": self.doc.doctype,
436-
"doc_name": self.doc.name,
435+
"voucher_type": self.doc.doctype,
436+
"voucher_no": self.doc.name,
437437
"is_amended": self.doc.amended_from and 'Yes' or 'No'
438438
}
439439
get_obj('Warehouse', d['reserved_warehouse']).update_bin(args)

stock/doctype/bin/bin.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def update_stock(self, args):
4040

4141
if (flt(args.get("actual_qty")) < 0 or flt(args.get("reserved_qty")) > 0) \
4242
and args.get("is_cancelled") == 'No' and args.get("is_amended")=='No':
43-
self.reorder_item(args.get("doc_type"), args.get("doc_name"))
43+
self.reorder_item(args.get("voucher_type"), args.get("voucher_no"))
4444

4545
if args.get("actual_qty"):
4646
# update valuation and qty after transaction for post dated entry
@@ -346,12 +346,12 @@ def create_auto_indent(self, i , doc_type, doc_name, cur_qty):
346346
webnotes.conn.set(indent_obj.doc,'docstatus',1)
347347
indent_obj.on_submit()
348348
msgprint("""Item: %s is to be re-ordered. Purchase Request %s raised.
349-
It was generated from %s %s""" %
350-
(self.doc.item_code, indent.name,doc_type, doc_name ))
349+
It was generated from %s: %s""" %
350+
(self.doc.item_code, indent.name, doc_type, doc_name ))
351351
if(i['email_notify']):
352-
self.send_email_notification(doc_type,doc_name)
352+
self.send_email_notification(doc_type, doc_name)
353353

354-
def send_email_notification(self,doc_type,doc_name):
354+
def send_email_notification(self, doc_type, doc_name):
355355
""" Notify user about auto creation of indent"""
356356

357357
from webnotes.utils.email_lib import sendmail
@@ -360,6 +360,7 @@ def send_email_notification(self,doc_type,doc_name):
360360
and parent not in ('Administrator', 'All', 'Guest')""")]
361361
msg="""A Purchase Request has been raised
362362
for item %s: %s on %s """ % (doc_type, doc_name, nowdate())
363+
363364
sendmail(email_list, subject='Auto Purchase Request Generation Notification', msg = msg)
364365

365366
def validate(self):

stock/doctype/delivery_note/delivery_note.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ def update_stock_ledger(self, update_stock, is_stopped = 0):
351351
# Reduce reserved qty from reserved warehouse mentioned in so
352352
args = {
353353
"item_code": d['item_code'],
354-
"doc_type": self.doc.doctype,
355-
"doc_name": self.doc.name,
354+
"voucher_type": self.doc.doctype,
355+
"voucher_no": self.doc.name,
356356
"reserved_qty": flt(update_stock) * flt(d['reserved_qty']),
357357
"posting_date": self.doc.posting_date,
358358
"is_amended": self.doc.amended_from and 'Yes' or 'No'

0 commit comments

Comments
 (0)