• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python webnotes.reload_doc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中webnotes.reload_doc函数的典型用法代码示例。如果您正苦于以下问题:Python reload_doc函数的具体用法?Python reload_doc怎么用?Python reload_doc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: execute

def execute():
	webnotes.reload_doc("setup", "doctype", "company")
	create_chart_of_accounts_if_not_exists()
	add_group_accounts()
	add_ledger_accounts()
	add_aii_cost_center()
	set_default_accounts()
开发者ID:BillTheBest,项目名称:erpnext,代码行数:7,代码来源:p08_create_aii_accounts.py


示例2: execute

def execute():
	webnotes.reload_doc("hr", "doctype", "leave_application")
	
	if not webnotes.get_doctype("Leave Application").get({"doctype": "DocField", 
			"parent": "Leave Application", "permlevel": 2}):
		webnotes.conn.sql("""update `tabDocPerm` set permlevel=1 
			where parent="Leave Application" and permlevel=2""")
开发者ID:Anirudh887,项目名称:erpnext,代码行数:7,代码来源:p05_leave_application.py


示例3: execute

def execute():
	webnotes.reload_doc("utilities", "doctype", "note")
	webnotes.reload_doc("utilities", "doctype", "note_user")
	
	for question in webnotes.conn.sql("""select * from tabQuestion""", as_dict=True):
		if question.question:
			try:
				name = question.question[:180]
				if webnotes.conn.exists("Note", name):
					webnotes.delete_doc("Note", name)

				similar_questions = webnotes.conn.sql_list("""select name from `tabQuestion`
					where question like %s""", "%s%%" % name)
				answers = [markdown2.markdown(c) for c in webnotes.conn.sql_list("""
						select answer from tabAnswer where question in (%s)""" % \
						", ".join(["%s"]*len(similar_questions)), similar_questions)]

				webnotes.bean({
					"doctype":"Note",
					"title": name,
					"content": "<hr>".join(answers),
					"owner": question.owner,
					"creation": question.creation,
					"public": 1
				}).insert()
			
			except NameError:
				pass
			except Exception, e:
				if e.args[0] != 1062:
					raise
开发者ID:aalishanmatrix,项目名称:erpnext,代码行数:31,代码来源:p06_make_notes.py


示例4: execute

def execute():
	import webnotes
	import webnotes.model.doc
	webnotes.conn.sql("delete from `tabDocPerm` where parent='Profile' and permlevel=1")
	new_perms = [
		{
			'parent': 'Profile',
			'parentfield': 'permissions',
			'parenttype': 'DocType',
			'role': 'Administrator',			
			'permlevel': 1,
			'read': 1,
			'write': 1
		},
		{
			'parent': 'Profile',
			'parentfield': 'permissions',
			'parenttype': 'DocType',
			'role': 'System Manager',
			'permlevel': 1,
			'read': 1,
			'write': 1
		},
		
	]
	for perms in new_perms:
		doc = webnotes.model.doc.Document('DocPerm')
		doc.fields.update(perms)
		doc.save()
	webnotes.conn.commit()
	webnotes.conn.begin()
	
	webnotes.reload_doc('core', 'doctype', 'profile')
开发者ID:BANSALJEE,项目名称:erpnext,代码行数:33,代码来源:change_profile_permission.py


示例5: execute

def execute():
	webnotes.reload_doc("stock", "doctype", "delivery_note_item")
	webnotes.reload_doc("accounts", "doctype", "sales_invoice_item")

	webnotes.conn.auto_commit_on_many_writes = True
	for company in webnotes.conn.sql("select name from `tabCompany`"):
		stock_ledger_entries = webnotes.conn.sql("""select item_code, voucher_type, voucher_no,
			voucher_detail_no, posting_date, posting_time, stock_value, 
			warehouse, actual_qty as qty from `tabStock Ledger Entry` 
			where ifnull(`is_cancelled`, "No") = "No" and company = %s
			order by item_code desc, warehouse desc, 
			posting_date desc, posting_time desc, name desc""", company[0], as_dict=True)
		
		dn_list = webnotes.conn.sql("""select name from `tabDelivery Note` 
			where docstatus < 2 and company = %s""", company[0])
		
		for dn in dn_list:
			dn = webnotes.get_obj("Delivery Note", dn[0], with_children = 1)
			dn.set_buying_amount(stock_ledger_entries)
		
		si_list = webnotes.conn.sql("""select name from `tabSales Invoice` 
			where docstatus < 2	and company = %s""", company[0])
		for si in si_list:
			si = webnotes.get_obj("Sales Invoice", si[0], with_children = 1)
			si.set_buying_amount(stock_ledger_entries)
		
	webnotes.conn.auto_commit_on_many_writes = False
开发者ID:BANSALJEE,项目名称:erpnext,代码行数:27,代码来源:p03_update_buying_amount.py


示例6: execute

def execute():
	webnotes.reload_doc("Accounts", "DocType", "Sales Taxes and Charges")
	webnotes.conn.sql("""update `tabSales Taxes and Charges`
		set cost_center = cost_center_other_charges""")
	webnotes.conn.sql_ddl("""alter table `tabSales Taxes and Charges`
		drop column cost_center_other_charges""")
	
开发者ID:Anirudh887,项目名称:erpnext,代码行数:6,代码来源:p07_rename_cost_center_other_charges.py


示例7: execute

def execute():
	webnotes.reload_doc("core", "doctype", "docfield")
	webnotes.reload_doc("support", "doctype", "support_ticket")
	
	# customer issue resolved_by should be Profile
	if webnotes.conn.sql("""select count(*) from `tabCustomer Issue` 
		where ifnull(resolved_by,"")!="" """)[0][0]:
		webnotes.make_property_setter({
			"doctype":"Customer Issue", 
			"fieldname": "resolved_by", 
			"property": "options",
			"value": "Sales Person"
		})
		
	def get_communication_time(support_ticket, sort_order = 'asc'):
		tmp = webnotes.conn.sql("""select creation from tabCommunication where
			support_ticket=%s order by creation %s limit 1""" % ("%s", sort_order), 
			support_ticket)
		return tmp and tmp[0][0] or None
		
	# update in support ticket
	webnotes.conn.auto_commit_on_many_writes = True
	for st in webnotes.conn.sql("""select name, modified, status from 
		`tabSupport Ticket`""", as_dict=1):
		
		webnotes.conn.sql("""update `tabSupport Ticket` set first_responded_on=%s where 
			name=%s""", (get_communication_time(st.name) or st.modified, st.name))
		if st.status=="Closed":
			webnotes.conn.sql("""update `tabSupport Ticket` set resolution_date=%s where 
				name=%s""", (get_communication_time(st.name, 'desc') or st.modified, st.name))
开发者ID:BillTheBest,项目名称:erpnext,代码行数:30,代码来源:update_closed_on.py


示例8: execute

def execute():
	webnotes.reload_doc("utilities", "doctype", "note")
	webnotes.reload_doc("utilities", "doctype", "note_user")
	
	for question in webnotes.conn.sql("""select * from tabQuestion""", as_dict=True):
		if question.question:
			try:
				name = question.question[:180]
				if webnotes.conn.exists("Note", name):
					webnotes.delete_doc("Note", name)
				note = webnotes.bean({
					"doctype":"Note",
					"title": name,
					"content": "<hr>".join([markdown2.markdown(c) for c in webnotes.conn.sql_list("""
						select answer from tabAnswer where question=%s""", question.name)]),
					"owner": question.owner,
					"creation": question.creation,
					"public": 1
				}).insert()
			except NameError:
				pass

	webnotes.delete_doc("DocType", "Question")
	webnotes.delete_doc("DocType", "Answer")
	webnotes.bean("Style Settings").save()
	
	# update comment delete
	webnotes.conn.sql("""update tabDocPerm \
		set cancel=1 where parent='Comment' and role='System Manager'""")
开发者ID:cocoy,项目名称:erpnext,代码行数:29,代码来源:p06_make_notes.py


示例9: execute

def execute():
	webnotes.reload_doc("stock", "doctype", "stock_ledger_entry")
	webnotes.reload_doc("stock", "doctype", "stock_reconciliation")
	
	rename_fields()
	move_remarks_to_comments()
	store_stock_reco_json()
开发者ID:BillTheBest,项目名称:erpnext,代码行数:7,代码来源:stock_reconciliation_patch.py


示例10: execute

def execute():
	import webnotes
	webnotes.reload_doc("buying", "doctype", "purchase_order_item")
	webnotes.reload_doc("stock", "doctype", "purchase_receipt_item")
	for pi in webnotes.conn.sql("""select name from `tabPurchase Invoice` where docstatus = 1"""):
		webnotes.get_obj("Purchase Invoice", pi[0], 
			with_children=1).update_qty(change_modified=False)
开发者ID:antaryaami,项目名称:erpnext,代码行数:7,代码来源:p06_update_billed_amt_po_pr.py


示例11: execute

def execute():
	webnotes.reload_doc("stock", "doctype", "price_list")
	webnotes.reload_doc("stock", "doctype", "item_price")

	webnotes.conn.sql("""update `tabPrice List` pl, `tabItem Price` ip 
		set pl.selling=ip.selling, pl.buying=ip.buying 
		where pl.name=ip.price_list_name""")
开发者ID:RanjithP,项目名称:erpnext,代码行数:7,代码来源:p03_buying_selling_for_price_list.py


示例12: execute

def execute():
	webnotes.reload_doc("core", "doctype", "event")
	webnotes.conn.sql("""delete from `tabEvent` where repeat_on='Every Year' and ref_type='Employee'""")
	for employee in webnotes.conn.sql_list("""select name from `tabEmployee` where status='Active' and 
		ifnull(date_of_birth, '')!=''"""):
			obj = webnotes.get_obj("Employee", employee)
			obj.update_dob_event()
开发者ID:BANSALJEE,项目名称:erpnext,代码行数:7,代码来源:p05_employee_birthdays.py


示例13: execute

def execute():
	import webnotes
	webnotes.reload_doc('stock', 'doctype', 'packed_item')
	for si in webnotes.conn.sql("""select name from `tabSales Invoice` where docstatus = 1"""):
		webnotes.get_obj("Sales Invoice", si[0], 
			with_children=1).update_qty(change_modified=False)
		webnotes.conn.commit()
开发者ID:Anirudh887,项目名称:erpnext,代码行数:7,代码来源:p07_repost_billed_amt_in_sales_cycle.py


示例14: execute

def execute():
	webnotes.reload_doc("stock", "doctype", "item_price")
	
	# check for selling
	webnotes.conn.sql("""update `tabItem Price` set buying_or_selling = "Selling"
		where ifnull(buying_or_selling, '')=''""")
	
开发者ID:cocoy,项目名称:erpnext,代码行数:6,代码来源:purchase_price_list.py


示例15: execute

def execute():
	import webnotes
	webnotes.conn.sql("""delete from `tabSearch Criteria` \
		where name = 'customer_address_contact'""")
	
	webnotes.reload_doc("core", "doctype", "report")
	webnotes.reload_doc('selling', 'report', 'customer_addresses_and_contacts')
开发者ID:AminfiBerlin,项目名称:erpnext,代码行数:7,代码来源:remove_old_customer_contact_address.py


示例16: execute

def execute():
	webnotes.reload_doc("core", "doctype", "doctype")
	
	tables = webnotes.conn.sql_list("show tables")
	if not "tabMaterial Request Item" in tables:
		webnotes.rename_doc("DocType", "Purchase Request Item", "Material Request Item", force=True)
	if not "tabMaterial Request" in tables:
		webnotes.rename_doc("DocType", "Purchase Request", "Material Request", force=True)
	webnotes.reload_doc("buying", "search_criteria", "pending_po_items_to_bill")
	webnotes.reload_doc("buying", "search_criteria", "pending_po_items_to_receive")

	webnotes.reload_doc("stock", "doctype", "material_request")
	webnotes.reload_doc("stock", "doctype", "material_request_item")
	
	webnotes.conn.sql("""update `tabMaterial Request` set material_request_type='Purchase'""")
	
	os.system("rm -rf app/buying/doctype/purchase_request")
	os.system("rm -rf app/buying/doctype/purchase_request_item")
	
	os.system("rm -rf app/hr/doctype/holiday_block_list")
	os.system("rm -rf app/hr/doctype/holiday_block_list_allow")
	os.system("rm -rf app/hr/doctype/holiday_block_list_date")
	
	for dt in ("Purchase Request", "Purchase Request Item"):
		if webnotes.conn.exists("DocType", dt):
			webnotes.delete_doc("DocType", dt)
开发者ID:bindscha,项目名称:erpnext-fork,代码行数:26,代码来源:p03_material_request.py


示例17: execute

def execute():
	webnotes.reload_doc('website', 'doctype', 'blogger')
	webnotes.rename_doc("DocType", "Blog", "Blog Post", force=True)
	webnotes.reload_doc('website', 'doctype', 'blog_post')
	webnotes.conn.sql('''update tabBlogger set posts=(select count(*) 
		from `tabBlog Post` where ifnull(blogger,"")=tabBlogger.name)''')
	webnotes.conn.sql("""update `tabBlog Post` set published_on=date(creation)""")
开发者ID:BillTheBest,项目名称:erpnext,代码行数:7,代码来源:p03_rename_blog_to_blog_post.py


示例18: execute

def execute():
	webnotes.reload_doc("setup", "doctype", "email_digest")
	
	from webnotes.profile import get_system_managers
	system_managers = get_system_managers(only_name=True)
	if not system_managers: 
		return
	
	# no default company
	company = webnotes.conn.get_default("company")
	if not company:
		company = webnotes.conn.sql_list("select name from `tabCompany`")
		if company:
			company = company[0]
	if not company:
		return
	
	# scheduler errors digest
	edigest = webnotes.new_bean("Email Digest")
	edigest.doc.fields.update({
		"name": "Scheduler Errors",
		"company": company,
		"frequency": "Daily",
		"enabled": 1,
		"recipient_list": "\n".join(system_managers),
		"scheduler_errors": 1
	})
	edigest.insert()
开发者ID:pegasus620,项目名称:erpnext,代码行数:28,代码来源:p07_scheduler_errors_digest.py


示例19: execute

def execute():
	webnotes.reload_doc("stock", "doctype", "delivery_note_item")
	webnotes.conn.sql("""update `tabDelivery Note Item` set against_sales_order=prevdoc_docname
		where prevdoc_doctype='Sales Order' """)
		
	webnotes.conn.sql("""update `tabDelivery Note Item` set against_sales_invoice=prevdoc_docname
		where prevdoc_doctype='Sales Invoice' """)
开发者ID:Jdfkat,项目名称:erpnext,代码行数:7,代码来源:p01_update_delivery_note_prevdocs.py


示例20: pre_import

def pre_import():
	webnotes.conn.begin()
	make_modules()
	make_roles()
	webnotes.conn.commit()
	webnotes.reload_doc("utilities", "doctype", "gl_mapper")
	webnotes.reload_doc("utilities", "doctype", "gl_mapper_detail")
开发者ID:BillTheBest,项目名称:erpnext,代码行数:7,代码来源:install.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python webnotes.rename_doc函数代码示例发布时间:2022-05-26
下一篇:
Python webnotes.new_bean函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap