mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
[fix] [minor] fixed conflict while merging with master
This commit is contained in:
40
patches/august_2013/p02_rename_price_list.py
Normal file
40
patches/august_2013/p02_rename_price_list.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("website", "doctype", "shopping_cart_price_list")
|
||||
|
||||
for t in [
|
||||
("Supplier Quotation", "price_list_name", "buying_price_list"),
|
||||
("Purchase Order", "price_list_name", "buying_price_list"),
|
||||
("Purchase Invoice", "price_list_name", "buying_price_list"),
|
||||
("Purchase Receipt", "price_list_name", "buying_price_list"),
|
||||
("Quotation", "price_list_name", "selling_price_list"),
|
||||
("Sales Order", "price_list_name", "selling_price_list"),
|
||||
("Delivery Note", "price_list_name", "selling_price_list"),
|
||||
("Sales Invoice", "price_list_name", "selling_price_list"),
|
||||
("POS Setting", "price_list_name", "selling_price_list"),
|
||||
("Shopping Cart Price List", "price_list", "selling_price_list"),
|
||||
("Item Price", "price_list_name", "price_list"),
|
||||
("BOM", "price_list", "buying_price_list"),
|
||||
]:
|
||||
table_columns = webnotes.conn.get_table_columns(t[0])
|
||||
if t[2] in table_columns and t[1] in table_columns:
|
||||
# already reloaded, so copy into new column and drop old column
|
||||
webnotes.conn.sql("""update `tab%s` set `%s`=`%s`""" % (t[0], t[2], t[1]))
|
||||
webnotes.conn.sql_ddl("""alter table `tab%s` drop column `%s`""" % (t[0], t[1]))
|
||||
elif t[1] in table_columns:
|
||||
webnotes.conn.sql_ddl("alter table `tab%s` change `%s` `%s` varchar(180)" % t)
|
||||
|
||||
webnotes.reload_doc(webnotes.conn.get_value("DocType", t[0], "module"), "DocType", t[0])
|
||||
|
||||
webnotes.conn.sql("""update tabSingles set field='selling_price_list'
|
||||
where field='price_list_name' and doctype='Selling Settings'""")
|
||||
|
||||
webnotes.reload_doc("Selling", "DocType", "Selling Settings")
|
||||
webnotes.bean("Selling Settings").save()
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("accounts", "doctype", "pos_setting")
|
||||
if "customer_account" in webnotes.conn.get_table_columns("POS Setting"):
|
||||
customer_account = webnotes.conn.sql("""select customer_account, name from `tabPOS Setting`
|
||||
where ifnull(customer_account, '')!=''""")
|
||||
|
||||
for cust_acc, pos_name in customer_account:
|
||||
customer = webnotes.conn.sql("""select master_name, account_name from `tabAccount`
|
||||
where name=%s""", (cust_acc), as_dict=1)
|
||||
|
||||
if not customer[0].master_name:
|
||||
customer_name = webnotes.conn.get_value('Customer', customer[0].account_name, 'name')
|
||||
else:
|
||||
customer_name = customer[0].master_name
|
||||
|
||||
webnotes.conn.set_value('POS Setting', pos_name, 'customer', customer_name)
|
||||
|
||||
webnotes.conn.sql_ddl("""alter table `tabPOS Setting` drop column `customer_account`""")
|
||||
14
patches/august_2013/p05_employee_birthdays.py
Normal file
14
patches/august_2013/p05_employee_birthdays.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user