本文整理汇总了Python中webnotes.model.doc.Document.status方法的典型用法代码示例。如果您正苦于以下问题:Python Document.status方法的具体用法?Python Document.status怎么用?Python Document.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webnotes.model.doc.Document
的用法示例。
在下文中一共展示了Document.status方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_material_request
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def create_material_request(self,args):
mr=Document('Material Request')
mr.material_request_type='Purchase'
mr.naming_series='MREQ-'
mr.company='InnoWorth'
mr.transaction_date=nowdate()
mr.fiscal_year=webnotes.conn.get_value("Global Defaults", None, "current_fiscal_year")
mr.status='Submitted'
mr.docstatus=1
mr.save()
mrc=Document('Material Request Item')
mrc.parent=mr.name
mrc.item_code=args[0][0]
mrc.qty=args[0][1]
mrc.schedule_date=args[0][2]
mrc.docstatus=1
mrc.warehouse=args[0][3]
mrc.item_name=args[0][4]
mrc.uom=args[0][5]
mrc.description=args[0][6]
mrc.parentfield='indent_details'
mrc.parenttype='Material Request'
mrc.save()
child_data=[]
child_data.append([mrc.item_code,mrc.qty,mrc.schedule_date,mr.name,mrc.warehouse,mrc.item_name,mrc.uom,mrc.description,mrc.name,args[0][7]])
data=[]
data.append({"item_code":mrc.item_code,"so_qty":cstr(mrc.qty),"proj_qty":('+'+cstr(mrc.qty)),"warehouse":mrc.warehouse,"bin_iqty":"Bin.indented_qty","bin_pqty":"Bin.projected_qty","type":"po"})
self.update_bin(data)
import_amount=self.create_child_po(child_data)
return import_amount
示例2: create_child
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def create_child(self):
from datetime import datetime
# date_a=cstr(datetime.combine(datetime.strptime(self.doc.encounter_date,'%Y-%m-%d').date(),datetime.strptime(self.doc.start_time,'%H:%M').time()))
# date_b=cstr(datetime.combine(datetime.strptime(self.doc.encounter_date,'%Y-%m-%d').date(),datetime.strptime(self.doc.end_time,'%H:%M').time()))
if self.doc.appointment_slot:
webnotes.errprint([self.doc.start_time])
check_confirmed=webnotes.conn.sql("select true from `tabSlot Child` where slot='"+self.doc.appointment_slot+"' and modality='"+self.doc.encounter+"' and study='"+self.doc.study+"' and date_format(start_time,'%Y-%m-%d %H:%M')=date_format('"+date_a+"','%Y-%m-%d %H:%M') and date_format(end_time,'%Y-%m-%d %H:%M')=date_format('"+date_b+"','%Y-%m-%d %H:%M') and status='Confirm'",debug=1)
webnotes.errprint(check_confirmed)
if not check_confirmed:
check_status=webnotes.conn.sql("select case when count(*)<2 then true else false end from `tabSlot Child` where slot='"+self.doc.appointment_slot+"' and modality='"+self.doc.encounter+"' and study='"+self.doc.study+"' and date_format(start_time,'%Y-%m-%d %H:%M')=date_format('"+date_a+"','%Y-%m-%d %H:%M') and date_format(end_time,'%Y-%m-%d %H:%M')=date_format('"+date_b+"','%Y-%m-%d %H:%M') and status<>'Cancel'",as_list=1)
webnotes.errprint(check_status[0][0])
if check_status[0][0]==1:
d=Document("Slot Child")
d.slot=self.doc.appointment_slot
d.modality=self.doc.encounter
d.study=self.doc.study
d.status='Waiting'
d.encounter=self.doc.name
d.start_time=date_a
d.end_time=date_b
d.save()
self.make_event(d.name)
self.doc.slot=d.name
else:
webnotes.msgprint("Selected slot is not available",raise_exception=1)
else:
webnotes.msgprint("Selected slot is not available",raise_exception=1)
示例3: close_session
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def close_session(session_id):
from webnotes.model.doc import Document
d = Document('Session',session_id)
d.status = 'Close'
d.save()
return{
'session_id':''
}
示例4: create_session
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def create_session():
from webnotes.model.doc import Document
d = Document('Session')
d.status = 'Open'
d.test_name='Interfacial Tension'
d.save()
return{
'session_id':d.name
}
示例5: create_test_results
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def create_test_results(test_detail):
d = Document("Test Results")
d.sample_no = test_detail.get("sample_no")
d.test_name = test_detail.get("test")
d.test_id= test_detail.get("name")
d.status=test_detail.get("status")
if test_detail.get("temperature"):
d.temperature=test_detail.get("temperature")
d.save()
return d.name
示例6: create_lead
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def create_lead(email):
"""create a lead if it does not exist"""
lead = Document("Lead")
lead.fields["__islocal"] = 1
lead.lead_name = email
lead.email_id = email
lead.status = "Open"
lead.naming_series = lead_naming_series or get_lead_naming_series()
lead.company = webnotes.conn.get_default("company")
lead.source = "Email"
lead.save()
示例7: update_test_log
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def update_test_log(test_details):
#webnotes.errprint(emp)
d = Document('Test Log')
d.sample_no = test_details.get("sample_no")
d.test = test_details.get("test")
d.status = test_details.get("workflow_state")
#webnotes.errprint(d.status)
d.tester=test_details.get("tested_by")
d.shift_incharge=test_details.get("shift_incharge")
d.lab_incharge=test_details.get("lab_incharge")
d.save()
示例8: add
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def add(email, sender, subject, message, text_content = None):
"""add to bulk mail queue"""
from webnotes.utils.email_lib.smtp import get_email
e = Document('Bulk Email')
e.sender = sender
e.recipient = email
e.message = get_email(email, sender=e.sender, msg=message, subject=subject,
text_content = text_content).as_string()
e.status = 'Not Sent'
e.save()
示例9: create_lead
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def create_lead(email_id):
"""create a lead if it does not exist"""
from email.utils import parseaddr
real_name, email_id = parseaddr(email_id)
lead = Document("Lead")
lead.fields["__islocal"] = 1
lead.lead_name = real_name or email_id
lead.email_id = email_id
lead.status = "Open"
lead.naming_series = lead_naming_series or get_lead_naming_series()
lead.company = webnotes.conn.get_default("company")
lead.source = "Email"
lead.save()
示例10: send
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def send(args):
"""create support ticket"""
args = json.loads(args)
from webnotes.model.doc import Document
d = Document("Support Ticket")
d.raised_by = args["email"]
d.description = "From: " + args["name"] + "\n\n" + args["message"]
d.subject = "Website Query"
d.status = "Open"
d.owner = "Guest"
d.save(1)
webnotes.msgprint("Thank you for your query. We will respond as soon as we can.")
示例11: set_delivery_serial_no_values
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def set_delivery_serial_no_values(self, obj, serial_no):
s = Document('Serial No', serial_no)
s.delivery_document_type = obj.doc.doctype
s.delivery_document_no = obj.doc.name
s.delivery_date = obj.doc.posting_date
s.delivery_time = obj.doc.posting_time
s.customer = obj.doc.customer
s.customer_name = obj.doc.customer_name
s.delivery_address = obj.doc.address_display
s.territory = obj.doc.territory
s.warranty_expiry_date = s.warranty_period and add_days(cstr(obj.doc.posting_date), s.warranty_period) or ''
s.docstatus = 1
s.status = 'Delivered'
s.modified = nowdate()
s.modified_by = session['user']
s.save()
示例12: add
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def add(email, sender, subject, message, text_content=None, ref_doctype=None, ref_docname=None):
"""add to bulk mail queue"""
from webnotes.utils.email_lib.smtp import get_email
e = Document('Bulk Email')
e.sender = sender
e.recipient = email
try:
e.message = get_email(email, sender=e.sender, msg=message, subject=subject,
text_content = text_content).as_string()
except webnotes.ValidationError:
# bad email id - don't add to queue
return
e.status = 'Not Sent'
e.ref_doctype = ref_doctype
e.ref_docname = ref_docname
e.save()
示例13: get_support_ticket
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def get_support_ticket(code,sender_no,message,_type='POST'):
#return "hello"
from webnotes.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate
today = nowdate()
from webnotes.model.doc import Document
import time
#return sender_no[-11:]
if code[1:-1] =="CRT":
#return "hello"
#return sender_no[1:-1]
msg="Dear Customer,According to your request ticket is created"
d= Document('Support Ticket')
d.opening_time=time.strftime("%H:%M:%S")
d.opening_date=today
d.subject=message[1:-1]
d.raised_by=sender_no[1:-1]
d.company='medsynaptic'
d.status='Open'
d.save()
webnotes.conn.commit()
#p=send_sms(message[1:-1],sender_no1[1:-1])
return d.name
elif code[1:-1]=="CLS":
#return "hii"
#msg="Ticket Closed"
#sender_no1=sender_no[-11:]
z="select name from `tabSupport Ticket` where raised_by="+sender_no[1:-1]+" and status='Open'"
x=webnotes.conn.sql(z)
#return x
msg="Dear Customer,according to your request respective ticket is closed"
if x:
g="update `tabSupport Ticket` set status='Closed' where name='%s'"%(x[0][0])
h=webnotes.conn.sql(g)
#e=send_sms(message[1:-1],sender_no1[1:-1])
return "Updated"
else:
pass
else:
pass
示例14: process_message
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def process_message(self, mail):
"""
Updates message from support email as either new or reply
"""
from home import update_feed
content, content_type = '[Blank Email]', 'text/plain'
if mail.text_content:
content, content_type = mail.text_content, 'text/plain'
else:
content, content_type = mail.html_content, 'text/html'
thread_id = mail.get_thread_id()
if webnotes.conn.exists('Support Ticket', thread_id):
from webnotes.model.code import get_obj
st = get_obj('Support Ticket', thread_id)
st.make_response_record(content, mail.mail['From'], content_type)
webnotes.conn.set(st.doc, 'status', 'Open')
update_feed(st.doc)
return
# new ticket
from webnotes.model.doc import Document
d = Document('Support Ticket')
d.description = content
d.subject = mail.mail['Subject']
d.raised_by = mail.mail['From']
d.content_type = content_type
d.status = 'Open'
try:
d.save(1)
# update feed
update_feed(d)
# send auto reply
self.send_auto_reply(d)
except:
d.description = 'Unable to extract message'
d.save(1)
示例15: update_serial_no
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import status [as 别名]
def update_serial_no(self, is_submit):
sl_obj = get_obj("Stock Ledger")
if is_submit:
sl_obj.validate_serial_no_warehouse(self, "mtn_details")
for d in getlist(self.doclist, "mtn_details"):
if d.serial_no:
serial_nos = sl_obj.get_sr_no_list(d.serial_no)
for x in serial_nos:
serial_no = x.strip()
if d.s_warehouse:
sl_obj.update_serial_delivery_details(self, d, serial_no, is_submit)
if d.t_warehouse:
sl_obj.update_serial_purchase_details(self, d, serial_no, is_submit, self.doc.purpose)
if self.doc.purpose == "Purchase Return":
# delete_doc("Serial No", serial_no)
serial_doc = Document("Serial No", serial_no)
serial_doc.status = "Purchase Returned"
serial_doc.docstatus = 2
serial_doc.save()