Update erpnext/stock/doctype/bin/bin.py
This commit is contained in:
parent
2c19960996
commit
b36bebe9f0
@ -37,7 +37,6 @@ class DocType:
|
|||||||
self.doc.projected_qty = flt(self.doc.actual_qty) + flt(self.doc.ordered_qty) + flt(self.doc.indented_qty) + flt(self.doc.planned_qty) - flt(self.doc.reserved_qty)
|
self.doc.projected_qty = flt(self.doc.actual_qty) + flt(self.doc.ordered_qty) + flt(self.doc.indented_qty) + flt(self.doc.planned_qty) - flt(self.doc.reserved_qty)
|
||||||
self.doc.save()
|
self.doc.save()
|
||||||
if(( flt(actual_qty)<0 or flt(reserved_qty)>0 )and is_cancelled == 'No' and is_amended=='No'):
|
if(( flt(actual_qty)<0 or flt(reserved_qty)>0 )and is_cancelled == 'No' and is_amended=='No'):
|
||||||
msgprint('is_amended '+is_amended)
|
|
||||||
self.reorder_item(doc_type,doc_name)
|
self.reorder_item(doc_type,doc_name)
|
||||||
|
|
||||||
if actual_qty:
|
if actual_qty:
|
||||||
@ -319,13 +318,13 @@ class DocType:
|
|||||||
|
|
||||||
|
|
||||||
# Re order Auto Intent Generation
|
# Re order Auto Intent Generation
|
||||||
def reorder_indent(self,i,item_reorder_level,doc_type,doc_name,email_notify='1'):
|
def reorder_indent(self,i,item_reorder_level,doc_type,doc_name,email_notify=1):
|
||||||
indent = Document('Indent')
|
indent = Document('Indent')
|
||||||
indent.transaction_date = nowdate()
|
indent.transaction_date = nowdate()
|
||||||
indent.naming_series = 'IDT'
|
indent.naming_series = 'IDT'
|
||||||
indent.company = get_defaults()['company']
|
indent.company = get_defaults()['company']
|
||||||
indent.fiscal_year = get_defaults()['fiscal_year']
|
indent.fiscal_year = get_defaults()['fiscal_year']
|
||||||
indent.remark = "This is an auto generated Indent. It was raised because the projected quantity has fallen below the minimum re-order level"
|
indent.remark = "This is an auto generated Indent. It was raised because the projected quantity has fallen below the minimum re-order level when %s %s was created"%(doc_type,doc_name)
|
||||||
indent.save(1)
|
indent.save(1)
|
||||||
indent_obj = get_obj('Indent',indent.name,with_children=1)
|
indent_obj = get_obj('Indent',indent.name,with_children=1)
|
||||||
indent_details_child = addchild(indent_obj.doc,'indent_details','Indent Detail',0)
|
indent_details_child = addchild(indent_obj.doc,'indent_details','Indent Detail',0)
|
||||||
@ -347,9 +346,11 @@ class DocType:
|
|||||||
set(indent_obj.doc,'docstatus',1)
|
set(indent_obj.doc,'docstatus',1)
|
||||||
indent_obj.on_submit()
|
indent_obj.on_submit()
|
||||||
msgprint("Item: " + self.doc.item_code + " is to be re-ordered. Indent %s raised.Was generated from %s %s"%(indent.name,doc_type, doc_name ))
|
msgprint("Item: " + self.doc.item_code + " is to be re-ordered. Indent %s raised.Was generated from %s %s"%(indent.name,doc_type, doc_name ))
|
||||||
if(email_notify)
|
if(email_notify):
|
||||||
|
send_email_notification(doc_type,doc_name)
|
||||||
|
|
||||||
|
def send_email_notification(self,doc_type,doc_name)
|
||||||
email_list=[d for d in sql("select from tabUserRole where role in ('Purchase Manager','Material Manager') ")]
|
email_list=[d for d in sql("select from tabUserRole where role in ('Purchase Manager','Material Manager') ")]
|
||||||
#if getattr():
|
|
||||||
msg1='An Indent has been raised for item %s: %s on %s '%(doc_type, doc_name, nowdate())
|
msg1='An Indent has been raised for item %s: %s on %s '%(doc_type, doc_name, nowdate())
|
||||||
sendmail(email_list, sender='automail@webnotestech.com', \
|
sendmail(email_list, sender='automail@webnotestech.com', \
|
||||||
subject='Auto Indent Generation Notification', parts=[['text/plain',msg1]])
|
subject='Auto Indent Generation Notification', parts=[['text/plain',msg1]])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user