本文整理汇总了Python中webnotes.model.doc.Document.reference_type方法的典型用法代码示例。如果您正苦于以下问题:Python Document.reference_type方法的具体用法?Python Document.reference_type怎么用?Python Document.reference_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webnotes.model.doc.Document
的用法示例。
在下文中一共展示了Document.reference_type方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_feed_and_todo
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def create_feed_and_todo(self):
"""update activty feed and create todo for creation of item, customer, vendor"""
import home
home.make_feed('Comment', 'ToDo', '', webnotes.session['user'],
'<i>"' + 'Setup Complete. Please check your <a href="#!todo">\
To Do List</a>' + '"</i>', '#6B24B3')
d = Document('ToDo')
d.description = 'Create your first Customer'
d.priority = 'High'
d.date = nowdate()
d.reference_type = 'Customer'
d.save(1)
d = Document('ToDo')
d.description = 'Create your first Item'
d.priority = 'High'
d.date = nowdate()
d.reference_type = 'Item'
d.save(1)
d = Document('ToDo')
d.description = 'Create your first Supplier'
d.priority = 'High'
d.date = nowdate()
d.reference_type = 'Supplier'
d.save(1)
示例2: add
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def add():
"""add in someone's to do list"""
if webnotes.conn.sql("""select owner from `tabToDo Item`
where reference_type=%(doctype)s and reference_name=%(name)s
and owner=%(assign_to)s""", webnotes.form_dict):
webnotes.msgprint("Already in todo")
return
else:
from webnotes.model.doc import Document
from webnotes.utils import nowdate
d = Document("ToDo Item")
d.owner = webnotes.form_dict['assign_to']
d.reference_type = webnotes.form_dict['doctype']
d.reference_name = webnotes.form_dict['name']
d.description = webnotes.form_dict['description']
d.priority = webnotes.form_dict.get('priority', 'Medium')
d.date = webnotes.form_dict.get('date', nowdate())
d.assigned_by = webnotes.user.name
d.save(1)
# notify
notify_assignment(d.assigned_by, d.owner, d.reference_type, d.reference_name, action='ASSIGN', notify=webnotes.form_dict.get('notify'))
# update feeed
try:
import home
from webnotes.utils import get_fullname
home.make_feed('Assignment', d.reference_type, d.reference_name, webnotes.session['user'],
'[%s] Assigned to %s' % (d.priority, get_fullname(d.owner)), '#C78F58')
except ImportError, e:
pass
示例3: create_todo_preparation
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def create_todo_preparation(self, parent, tester, test_name):
# webnotes.errprint("in create to do test preparation")
d = Document("ToDo")
d.owner = webnotes.conn.get_value("Employee",tester,'user_id')
d.reference_type = 'Neutralization Value' if test_name == 'Neutralization Value' else 'Test Preparation'
d.reference_name = parent
d.priority = 'Medium'
d.date = nowdate()
d.assigned_by = webnotes.user.name
d.save(1)
示例4: assign_to
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def assign_to(session_userid,test_details):
from webnotes.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate
today = nowdate()
d = Document("ToDo")
d.owner = session_userid[0][0]
d.reference_type = test_details.get("test")
d.reference_name = test_details.get("name")
d.priority = 'Medium'
d.date = today
d.assigned_by = webnotes.user.name
d.save(1)
示例5: create_todo
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def create_todo(self, sample, test_id):
user = webnotes.conn.sql("select user_id from tabEmployee where name = '%s'"%(sample.get("tester")),as_list=1)
if user:
d = Document("ToDo")
d.owner = user[0][0]
d.reference_type = sample.get("test")
d.reference_name = test_id
d.priority = 'Medium'
d.date = nowdate()
d.assigned_by = webnotes.user.name
d.save(1)
示例6: assign_to
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def assign_to(self,owner):
from webnotes.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate
#webnotes.errprint(owner)
today = nowdate()
d = Document("ToDo")
d.owner = owner
d.reference_type = "Stock Entry"
d.reference_name = self.doc.name
d.priority = 'Medium'
d.date = today
d.assigned_by = webnotes.user.name
d.save(1)
示例7: create_todo
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def create_todo(self, sample, test_name, test_id):
# webnotes.errprint("in create to do")
userid = webnotes.conn.sql("select user_id from tabEmployee where name = '%s'"%(self.doc.tester),as_list=1)
# webnotes.errprint([userid , sample, sample.get("tester")])
if userid:
d = Document("ToDo")
d.owner = userid[0][0]
d.reference_type = test_name
d.reference_name = test_id
d.priority = 'Medium'
d.date = nowdate()
d.assigned_by = webnotes.user.name
d.save(1)
示例8: create_feed_and_todo
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def create_feed_and_todo(self):
"""update activty feed and create todo for creation of item, customer, vendor"""
import home
home.make_feed(
"Comment",
"ToDo",
"",
webnotes.session["user"],
'<i>"'
+ 'Setup Complete. Please check your <a href="#!todo">\
To Do List</a>'
+ '"</i>',
"#6B24B3",
)
d = Document("ToDo")
d.description = "Create your first Customer"
d.priority = "High"
d.date = nowdate()
d.reference_type = "Customer"
d.save(1)
d = Document("ToDo")
d.description = "Create your first Item"
d.priority = "High"
d.date = nowdate()
d.reference_type = "Item"
d.save(1)
d = Document("ToDo")
d.description = "Create your first Supplier"
d.priority = "High"
d.date = nowdate()
d.reference_type = "Supplier"
d.save(1)
示例9: assign_to
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def assign_to(self):
userid=webnotes.conn.sql("select user_id from `tabEmployee` where employee='"+self.doc.employee+"'",as_list=1)
#webnotes.errprint(userid)
from webnotes.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate
today = nowdate()
if userid:
d = Document("ToDo")
d.owner = userid[0][0]
d.reference_type = 'Training'
d.reference_name = self.doc.name
d.priority = 'Medium'
d.date = today
d.assigned_by = webnotes.user.name
d.save(1)
else:
webnotes.msgprint("Please Mention User Id for the Employe='"+self.doc.employee+"'")
示例10: add
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def add(args=None):
"""add in someone's to do list"""
if not args:
args = webnotes.local.form_dict
if webnotes.conn.sql("""select owner from `tabToDo`
where reference_type=%(doctype)s and reference_name=%(name)s
and owner=%(assign_to)s""", args):
webnotes.msgprint("Already in todo", raise_exception=True)
return
else:
from webnotes.model.doc import Document
from webnotes.utils import nowdate
d = Document("ToDo")
d.owner = args['assign_to']
d.reference_type = args['doctype']
d.reference_name = args['name']
d.description = args.get('description')
d.priority = args.get('priority', 'Medium')
d.date = args.get('date', nowdate())
d.assigned_by = args.get('assigned_by', webnotes.user.name)
d.save(1)
if args['doctype']=='Opportunity':
update_assign_to(args)
# set assigned_to if field exists
from webnotes.model.meta import has_field
if has_field(args['doctype'], "assigned_to"):
webnotes.conn.set_value(args['doctype'], args['name'], "assigned_to", args['assign_to'])
# notify
if not args.get("no_notification"):
notify_assignment(d.assigned_by, d.owner, d.reference_type, d.reference_name, action='ASSIGN', description=args.get("description"), notify=args.get('notify'))
# update feeed
try:
import home
from webnotes.utils import get_fullname
home.make_feed('Assignment', d.reference_type, d.reference_name, webnotes.session['user'],
'[%s] Assigned to %s' % (d.priority, get_fullname(d.owner)), '#C78F58')
except ImportError, e:
pass
示例11: create_todo
# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import reference_type [as 别名]
def create_todo(self,userid,test_id):
#webnotes.errprint(userid[0][0])
for key in test_id:
#webnotes.errprint([key, test_id[key]])
d = Document("ToDo")
d.owner = userid[0][0]
d.reference_type = key
d.reference_name = test_id[key]
d.priority = 'Medium'
d.date = nowdate()
d.assigned_by = webnotes.user.name
d.save(1)
# @webnotes.whitelist()
# def calculate_testing_of_extract(source_name,target_doclist=None):
# #webnotes.errprint(source_name)
# return _calculate_testing_of_extract(source_name, target_doclist)
# def _calculate_testing_of_extract(source_name, target_doclist=None, ignore_permissions=False):
# from webnotes.model.mapper import get_mapped_doclist
# doclist = get_mapped_doclist("Test Preparation", source_name, {
# "Test Preparation": {
# "doctype": "Test Of Extract",
# "validation": {
# "docstatus": ["=", 1]
# }
# }
# },target_doclist)
# return [d.fields for d in doclist]
# @webnotes.whitelist()
# def calculate_furan_content(source_name, target_doclist=None):
# #webnotes.errprint(source_name)
# return _calculate_furan_content(source_name, target_doclist)
# def _calculate_furan_content(source_name, target_doclist=None, ignore_permissions=False):
# from webnotes.model.mapper import get_mapped_doclist
# doclist = get_mapped_doclist("Test Preparation", source_name, {
# "Test Preparation": {
# "doctype": "Furan Content",
# "validation": {
# "docstatus": ["=", 1]
# }
# }
# },target_doclist)
# return [d.fields for d in doclist]
# @webnotes.whitelist()
# def calculate_oxidation_stability(source_name, target_doclist=None):
# #webnotes.errprint(source_name)
# return _calculate_oxidation_stability(source_name, target_doclist)
# def _calculate_oxidation_stability(source_name, target_doclist=None, ignore_permissions=False):
# from webnotes.model.mapper import get_mapped_doclist
# doclist = get_mapped_doclist("Test Preparation", source_name, {
# "Test Preparation": {
# "doctype": "Oxidation Stability",
# "validation": {
# "docstatus": ["=", 1]
# }
# }
# },target_doclist)
# return [d.fields for d in doclist]
# @webnotes.whitelist()
# def calculate_corrosive_sulphur(source_name, target_doclist=None):
# #webnotes.errprint(source_name)
# return _calculate_corrosive_sulphur(source_name, target_doclist)
# def _calculate_corrosive_sulphur(source_name, target_doclist=None, ignore_permissions=False):
# from webnotes.model.mapper import get_mapped_doclist
# doclist = get_mapped_doclist("Test Preparation", source_name, {
# "Test Preparation": {
# "doctype": "Corrossive Sulphur",
# "validation": {
# "docstatus": ["=", 1]
# }
# }
# },target_doclist)
# return [d.fields for d in doclist]
#.........这里部分代码省略.........