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


Python webnotes.reload_doc函数代码示例

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


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


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