reorder level fixes
This commit is contained in:
parent
d921e4db52
commit
03d957027c
@ -432,8 +432,8 @@ class DocType(TransactionBase):
|
|||||||
"item_code": d['item_code'],
|
"item_code": d['item_code'],
|
||||||
"reserved_qty": flt(update_stock) * flt(d['qty']),
|
"reserved_qty": flt(update_stock) * flt(d['qty']),
|
||||||
"posting_date": self.doc.transaction_date,
|
"posting_date": self.doc.transaction_date,
|
||||||
"doc_type": self.doc.doctype,
|
"voucher_type": self.doc.doctype,
|
||||||
"doc_name": self.doc.name,
|
"voucher_no": self.doc.name,
|
||||||
"is_amended": self.doc.amended_from and 'Yes' or 'No'
|
"is_amended": self.doc.amended_from and 'Yes' or 'No'
|
||||||
}
|
}
|
||||||
get_obj('Warehouse', d['reserved_warehouse']).update_bin(args)
|
get_obj('Warehouse', d['reserved_warehouse']).update_bin(args)
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class DocType:
|
|||||||
|
|
||||||
if (flt(args.get("actual_qty")) < 0 or flt(args.get("reserved_qty")) > 0) \
|
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':
|
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"):
|
if args.get("actual_qty"):
|
||||||
# update valuation and qty after transaction for post dated entry
|
# update valuation and qty after transaction for post dated entry
|
||||||
@ -346,12 +346,12 @@ class DocType:
|
|||||||
webnotes.conn.set(indent_obj.doc,'docstatus',1)
|
webnotes.conn.set(indent_obj.doc,'docstatus',1)
|
||||||
indent_obj.on_submit()
|
indent_obj.on_submit()
|
||||||
msgprint("""Item: %s is to be re-ordered. Purchase Request %s raised.
|
msgprint("""Item: %s is to be re-ordered. Purchase Request %s raised.
|
||||||
It was generated from %s %s""" %
|
It was generated from %s: %s""" %
|
||||||
(self.doc.item_code, indent.name,doc_type, doc_name ))
|
(self.doc.item_code, indent.name, doc_type, doc_name ))
|
||||||
if(i['email_notify']):
|
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"""
|
""" Notify user about auto creation of indent"""
|
||||||
|
|
||||||
from webnotes.utils.email_lib import sendmail
|
from webnotes.utils.email_lib import sendmail
|
||||||
@ -360,6 +360,7 @@ class DocType:
|
|||||||
and parent not in ('Administrator', 'All', 'Guest')""")]
|
and parent not in ('Administrator', 'All', 'Guest')""")]
|
||||||
msg="""A Purchase Request has been raised
|
msg="""A Purchase Request has been raised
|
||||||
for item %s: %s on %s """ % (doc_type, doc_name, nowdate())
|
for item %s: %s on %s """ % (doc_type, doc_name, nowdate())
|
||||||
|
|
||||||
sendmail(email_list, subject='Auto Purchase Request Generation Notification', msg = msg)
|
sendmail(email_list, subject='Auto Purchase Request Generation Notification', msg = msg)
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
|||||||
@ -351,8 +351,8 @@ class DocType(TransactionBase):
|
|||||||
# Reduce reserved qty from reserved warehouse mentioned in so
|
# Reduce reserved qty from reserved warehouse mentioned in so
|
||||||
args = {
|
args = {
|
||||||
"item_code": d['item_code'],
|
"item_code": d['item_code'],
|
||||||
"doc_type": self.doc.doctype,
|
"voucher_type": self.doc.doctype,
|
||||||
"doc_name": self.doc.name,
|
"voucher_no": self.doc.name,
|
||||||
"reserved_qty": flt(update_stock) * flt(d['reserved_qty']),
|
"reserved_qty": flt(update_stock) * flt(d['reserved_qty']),
|
||||||
"posting_date": self.doc.posting_date,
|
"posting_date": self.doc.posting_date,
|
||||||
"is_amended": self.doc.amended_from and 'Yes' or 'No'
|
"is_amended": self.doc.amended_from and 'Yes' or 'No'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user