reorder level fixes

This commit is contained in:
Nabin Hait 2012-10-30 12:43:04 +05:30
parent d921e4db52
commit 03d957027c
3 changed files with 10 additions and 9 deletions

View File

@ -432,8 +432,8 @@ class DocType(TransactionBase):
"item_code": d['item_code'],
"reserved_qty": flt(update_stock) * flt(d['qty']),
"posting_date": self.doc.transaction_date,
"doc_type": self.doc.doctype,
"doc_name": self.doc.name,
"voucher_type": self.doc.doctype,
"voucher_no": self.doc.name,
"is_amended": self.doc.amended_from and 'Yes' or 'No'
}
get_obj('Warehouse', d['reserved_warehouse']).update_bin(args)

View File

@ -40,7 +40,7 @@ class DocType:
if (flt(args.get("actual_qty")) < 0 or flt(args.get("reserved_qty")) > 0) \
and args.get("is_cancelled") == 'No' and args.get("is_amended")=='No':
self.reorder_item(args.get("doc_type"), args.get("doc_name"))
self.reorder_item(args.get("voucher_type"), args.get("voucher_no"))
if args.get("actual_qty"):
# update valuation and qty after transaction for post dated entry
@ -346,12 +346,12 @@ class DocType:
webnotes.conn.set(indent_obj.doc,'docstatus',1)
indent_obj.on_submit()
msgprint("""Item: %s is to be re-ordered. Purchase Request %s raised.
It was generated from %s %s""" %
(self.doc.item_code, indent.name,doc_type, doc_name ))
It was generated from %s: %s""" %
(self.doc.item_code, indent.name, doc_type, doc_name ))
if(i['email_notify']):
self.send_email_notification(doc_type,doc_name)
self.send_email_notification(doc_type, doc_name)
def send_email_notification(self,doc_type,doc_name):
def send_email_notification(self, doc_type, doc_name):
""" Notify user about auto creation of indent"""
from webnotes.utils.email_lib import sendmail
@ -360,6 +360,7 @@ class DocType:
and parent not in ('Administrator', 'All', 'Guest')""")]
msg="""A Purchase Request has been raised
for item %s: %s on %s """ % (doc_type, doc_name, nowdate())
sendmail(email_list, subject='Auto Purchase Request Generation Notification', msg = msg)
def validate(self):

View File

@ -351,8 +351,8 @@ class DocType(TransactionBase):
# Reduce reserved qty from reserved warehouse mentioned in so
args = {
"item_code": d['item_code'],
"doc_type": self.doc.doctype,
"doc_name": self.doc.name,
"voucher_type": self.doc.doctype,
"voucher_no": self.doc.name,
"reserved_qty": flt(update_stock) * flt(d['reserved_qty']),
"posting_date": self.doc.posting_date,
"is_amended": self.doc.amended_from and 'Yes' or 'No'