当前位置: 首页>>代码示例>>Python>>正文


Python Document.date方法代码示例

本文整理汇总了Python中webnotes.model.doc.Document.date方法的典型用法代码示例。如果您正苦于以下问题:Python Document.date方法的具体用法?Python Document.date怎么用?Python Document.date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webnotes.model.doc.Document的用法示例。


在下文中一共展示了Document.date方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_feed_and_todo

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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)
开发者ID:NorrWing,项目名称:erpnext,代码行数:29,代码来源:setup_control.py

示例2: add

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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
开发者ID:beliezer,项目名称:wnframework,代码行数:34,代码来源:assign_to.py

示例3: create_todo_preparation

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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)	
开发者ID:saurabh6790,项目名称:tru_app_back,代码行数:12,代码来源:sample_allocation.py

示例4: create_todo

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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)
开发者ID:saurabh6790,项目名称:trufil_app,代码行数:13,代码来源:sample_allocation.py

示例5: service_visit_post

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [as 别名]
	def service_visit_post(self, args):
		"""
			Posts the service visit
		"""
		data = json.loads(args)
		
		sv = Document('Service Visit')
		sv.date = data['visit_date']
		sv.serial_number = data['serial_number']
		sv.details = data['visit_details']
		sv.save(1)
开发者ID:tobrahma,项目名称:erpnext,代码行数:13,代码来源:service_agreement.py

示例6: assign_to

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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)
开发者ID:saurabh6790,项目名称:trufil_app,代码行数:13,代码来源:__init__.py

示例7: assign_to

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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)
开发者ID:saurabh6790,项目名称:trufil_app,代码行数:14,代码来源:stock_entry.py

示例8: add_todo_item

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [as 别名]
	def add_todo_item(self,args):
		args = json.loads(args)

		d = Document('ToDo Item', args.get('name') or None)
		d.description = args['description']
		d.date = args['date']
		d.priority = args['priority']
		d.checked = args.get('checked', 0)
		d.owner = session['user']
		d.save(not args.get('name') and 1 or 0)

		return d.name
开发者ID:Morphnus-IT-Solutions,项目名称:trimos,代码行数:14,代码来源:home_control.py

示例9: log

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [as 别名]
def log(event, details):
	return
	import time
	d = Document(doctype = "Error Log")
	d.event =  event
	d.time = time.strftime('%H:%M')
	d.date = time.strftime('%d-%m-%Y')
	d.user = session['user']
	d.detail = details
	try:
		d.save(1)
	except:
		pass # bc
开发者ID:ranjithtenz,项目名称:stable,代码行数:15,代码来源:__init__.py

示例10: create_todo

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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)
开发者ID:saurabh6790,项目名称:tru_app_back,代码行数:15,代码来源:sample_allocation.py

示例11: create_feed_and_todo

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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)
开发者ID:bindscha,项目名称:erpnext-fork,代码行数:38,代码来源:setup_control.py

示例12: edit

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [as 别名]
def edit(arg=None):
	args = webnotes.form_dict

	d = Document('ToDo', args.get('name') or None)
	d.description = args['description']
	d.date = args['date']
	d.priority = args['priority']
	d.checked = args.get('checked', 0)
	d.owner = webnotes.session['user']
	d.save(not args.get('name') and 1 or 0)

	if args.get('name') and d.checked:
		notify_assignment(d)

	return d.name
开发者ID:NorrWing,项目名称:erpnext,代码行数:17,代码来源:todo.py

示例13: assign_to

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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+"'")
开发者ID:saurabh6790,项目名称:tru_app_back,代码行数:18,代码来源:training.py

示例14: add

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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
开发者ID:gangadhar-kadam,项目名称:prjlib,代码行数:46,代码来源:assign_to.py

示例15: create_feed_and_todo

# 需要导入模块: from webnotes.model.doc import Document [as 别名]
# 或者: from webnotes.model.doc.Document import date [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 = '<a href="#Setup">Complete ERPNext Setup</a>'
        d.priority = "High"
        d.date = nowdate()
        d.save(1)
开发者ID:kritinline,项目名称:erpnext,代码行数:23,代码来源:setup_control.py


注:本文中的webnotes.model.doc.Document.date方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。