fix
This commit is contained in:
parent
d82e8df7e5
commit
04da8741c3
@ -311,15 +311,15 @@ class DocType:
|
|||||||
msgprint(get_value('Manage Account', None, 'auto_indent'))
|
msgprint(get_value('Manage Account', None, 'auto_indent'))
|
||||||
if get_value('Manage Account', None, 'auto_indent'):
|
if get_value('Manage Account', None, 'auto_indent'):
|
||||||
#check if re-order is required
|
#check if re-order is required
|
||||||
indent_detail_fields = sql("select re_order_level,item_name,description,brand,item_group,lead_time_days,min_order_qty from tabItem where item_code = %s",(self.doc.item_code),as_dict=1)
|
indent_detail_fields = sql("select re_order_level,item_name,description,brand,item_group,lead_time_days,min_order_qty,email_notify from tabItem where item_code = %s",(self.doc.item_code),as_dict=1)
|
||||||
i = indent_detail_fields[0]
|
i = indent_detail_fields[0]
|
||||||
item_reorder_level = i['re_order_level'] or 0
|
item_reorder_level = i['re_order_level'] or 0
|
||||||
if ((flt(item_reorder_level) > flt(self.doc.projected_qty)) and item_reorder_level) :
|
if ((flt(item_reorder_level) > flt(self.doc.projected_qty)) and item_reorder_level) :
|
||||||
self.reorder_indent(i,item_reorder_level,doc_type,doc_name)
|
self.reorder_indent(i,item_reorder_level,doc_type,doc_name,email_notify=i['email_notify'])
|
||||||
|
|
||||||
|
|
||||||
# Re order Auto Intent Generation
|
# Re order Auto Intent Generation
|
||||||
def reorder_indent(self,i,item_reorder_level,doc_type,doc_name):
|
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'
|
||||||
@ -347,12 +347,12 @@ 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 ))
|
||||||
email_list=[d for d in sql("select parent from tabUserRole where role in ('Purchase Manager','Material Manager') ")]
|
if(email_notify)
|
||||||
|
email_list=[d for d in sql("select from tabUserRole where role in ('Purchase Manager','Material Manager') ")]
|
||||||
#if getattr():
|
#if getattr():
|
||||||
msg='An Indent has been raised for %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())
|
||||||
msgprint(email_list)
|
sendmail(email_list, sender='automail@webnotestech.com', \
|
||||||
sendmail(['nijil@iwebnotes.com'], sender='automail@webnotestech.com', \
|
subject='Auto Indent Generation Notification', parts=[['text/plain',msg1]])
|
||||||
subject='Auto Indent Generation Notification', parts=[['text/plain',msg]])
|
|
||||||
# validate
|
# validate
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_mandatory()
|
self.validate_mandatory()
|
||||||
|
Loading…
Reference in New Issue
Block a user