mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00:00
[minor] merged with master branch
This commit is contained in:
@@ -9,9 +9,6 @@ def execute():
|
||||
webnotes.conn.sql("""update tabAddress set address_title = customer_name where ifnull(customer_name,'')!=''""")
|
||||
webnotes.conn.sql("""update tabAddress set address_title = supplier_name where ifnull(supplier_name,'')!=''""")
|
||||
webnotes.conn.sql("""update tabAddress set address_title = sales_partner where ifnull(sales_partner,'')!=''""")
|
||||
|
||||
webnotes.reload_doc("website", "doctype", "product_settings")
|
||||
webnotes.reset_perms("Product Settings")
|
||||
|
||||
# move code to new doctype
|
||||
webnotes.conn.set_value("Website Script", None, "javascript",
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.utils import cint
|
||||
import MySQLdb
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("setup", "doctype", "price_list")
|
||||
webnotes.reload_doc("stock", "doctype", "item_price")
|
||||
|
||||
for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""):
|
||||
buying, selling = False, False
|
||||
for b, s in webnotes.conn.sql("""select distinct buying, selling
|
||||
from `tabItem Price` where price_list_name=%s""", price_list):
|
||||
buying = buying or cint(b)
|
||||
selling = selling or cint(s)
|
||||
try:
|
||||
for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""):
|
||||
buying, selling = False, False
|
||||
for b, s in webnotes.conn.sql("""select distinct buying, selling
|
||||
from `tabItem Price` where price_list_name=%s""", price_list):
|
||||
buying = buying or cint(b)
|
||||
selling = selling or cint(s)
|
||||
|
||||
buying_or_selling = "Selling" if selling else "Buying"
|
||||
webnotes.conn.set_value("Price List", price_list, "buying_or_selling", buying_or_selling)
|
||||
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling=%s
|
||||
where price_list_name=%s""", (buying_or_selling, price_list))
|
||||
buying_or_selling = "Selling" if selling else "Buying"
|
||||
webnotes.conn.set_value("Price List", price_list, "buying_or_selling", buying_or_selling)
|
||||
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling=%s
|
||||
where price_list_name=%s""", (buying_or_selling, price_list))
|
||||
except MySQLdb.OperationalError, e:
|
||||
if e.args[0] == 1054:
|
||||
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling="Selling" """)
|
||||
else:
|
||||
raise e
|
||||
|
||||
@@ -263,7 +263,9 @@ patch_list = [
|
||||
"execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-09-02",
|
||||
"patches.september_2013.p01_fix_buying_amount_gl_entries",
|
||||
"patches.september_2013.p01_update_communication",
|
||||
"execute:webnotes.reload_doc('setup', 'doctype', 'features_setup') # 2013-09-05",
|
||||
"patches.september_2013.p02_fix_serial_no_status",
|
||||
"patches.august_2013.p06_deprecate_is_cancelled",
|
||||
"execute:webnotes.delete_doc('DocType', 'Budget Control')",
|
||||
"patches.september_2013.p03_update_stock_uom_in_sle",
|
||||
]
|
||||
@@ -1,15 +1,22 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
import MySQLdb
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("core", "doctype", "communication")
|
||||
webnotes.conn.sql("""update tabCommunication set communication_date = creation where
|
||||
ifnull(communication_date, '')='' """)
|
||||
|
||||
for doctype in ("Contact", "Lead", "Job Applicant", "Supplier", "Customer", "Quotation", "Sales Person", "Support Ticket"):
|
||||
fieldname = doctype.replace(" ", '_').lower()
|
||||
webnotes.conn.sql("""update tabCommunication
|
||||
set parenttype=%s, parentfield='communications',
|
||||
parent=`%s`
|
||||
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
|
||||
|
||||
webnotes.reload_doc("core", "doctype", "communication")
|
||||
|
||||
webnotes.conn.sql("""update tabCommunication set communication_date = creation where
|
||||
ifnull(communication_date, '')='' """)
|
||||
|
||||
try:
|
||||
fieldname = doctype.replace(" ", '_').lower()
|
||||
webnotes.conn.sql("""update tabCommunication
|
||||
set parenttype=%s, parentfield='communications',
|
||||
parent=`%s`
|
||||
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
|
||||
except MySQLdb.OperationalError, e:
|
||||
if e.args[0] != 1054:
|
||||
raise e
|
||||
|
||||
9
patches/september_2013/p03_update_stock_uom_in_sle.py
Normal file
9
patches/september_2013/p03_update_stock_uom_in_sle.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# 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.conn.sql("""update `tabStock Ledger Entry` sle, tabItem i
|
||||
set sle.stock_uom = i.stock_uom
|
||||
where sle.item_code = i.name and ifnull(sle.stock_uom, '') = ''""")
|
||||
Reference in New Issue
Block a user