mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
Merge branch 'responsive' of https://github.com/webnotes/erpnext into responsive
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import webnotes, webnotes.utils, os
|
||||
from webnotes.modules.export_file import export_to_files
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("core", "doctype", "file_data")
|
||||
@@ -71,4 +70,4 @@ def update_for_doc(doctype, doc):
|
||||
pass
|
||||
else:
|
||||
webnotes.conn.sql("""delete from `tabFile Data` where name=%s""",
|
||||
fileid)
|
||||
fileid)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
for dt, fieldname in \
|
||||
(("Journal Voucher Detail", "cost_center"),
|
||||
("Sales Taxes and Charges", "cost_center_other_charges"),
|
||||
("Purchase Taxes and Charges", "cost_center"), ("Delivery Note Item", "cost_center"),
|
||||
("Purchase Invoice Item", "cost_center"), ("Sales Invoice Item", "cost_center")):
|
||||
webnotes.conn.sql_ddl("""alter table `tab%s` alter `%s` drop default""" % (dt, fieldname))
|
||||
webnotes.reload_doc("Stock", "DocType", "Delivery Note Item")
|
||||
for dt in ("Journal Voucher Detail", "Sales Taxes and Charges",
|
||||
"Purchase Taxes and Charges", "Delivery Note Item",
|
||||
"Purchase Invoice Item", "Sales Invoice Item"):
|
||||
webnotes.conn.sql_ddl("""alter table `tab%s` alter `cost_center` drop default""" \
|
||||
% (dt,))
|
||||
webnotes.reload_doc(webnotes.conn.get_value("DocType", dt, "module"), "DocType", dt)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import webnotes
|
||||
|
||||
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""")
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("Setup", "DocType", "Price List")
|
||||
webnotes.conn.sql("""update `tabPrice List` set valid_for_all_countries=1""")
|
||||
@@ -1,4 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("delete from `tabSearch Criteria` where name = 'cash_flow_statement'")
|
||||
@@ -15,8 +15,6 @@ def execute():
|
||||
webnotes.conn.sql("drop table if exists `tab%s`" % dt)
|
||||
webnotes.conn.begin()
|
||||
|
||||
delete_doc("Search Criteria", "tds_return")
|
||||
|
||||
# Add tds entry in tax table for purchase invoice
|
||||
pi_list = webnotes.conn.sql("""select name from `tabPurchase Invoice`
|
||||
where ifnull(tax_code, '')!='' and ifnull(ded_amount, 0)!=0""")
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc("accounts", "search_criteria", "debtors_ledger")
|
||||
reload_doc("accounts", "search_criteria", "creditors_ledger")
|
||||
@@ -8,8 +8,6 @@ def execute():
|
||||
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")
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
for mapper in webnotes.conn.sql("""select name from `tabGL Mapper`"""):
|
||||
webnotes.delete_doc("GL Mapper", mapper[0])
|
||||
try:
|
||||
for mapper in webnotes.conn.sql("""select name from `tabGL Mapper`"""):
|
||||
webnotes.delete_doc("GL Mapper", mapper[0])
|
||||
except Exception, e:
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.delete_doc("Search Criteria", "sales_order_pending_items")
|
||||
@@ -1,9 +0,0 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
for sc in ["itemwise_price_list", "itemwise_receipt_details",
|
||||
"shortage_to_purchase_request", "stock_aging_report",
|
||||
"stock_ledger", "stock_level", "stock_report",
|
||||
"custom_test2", "custom_test3", "custom_test4",
|
||||
"test_so2", "test_so3"]:
|
||||
webnotes.delete_doc("Search Criteria", sc)
|
||||
@@ -4,6 +4,6 @@ def execute():
|
||||
webnotes.reload_doc("stock", "doctype", "item_price")
|
||||
|
||||
# check for selling
|
||||
webnotes.conn.sql("""update `tabItem Price` set selling=1
|
||||
where ifnull(selling, 0)=0 and ifnull(buying, 0)=0""")
|
||||
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling = "Selling"
|
||||
where ifnull(buying_or_selling, '')=''""")
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import webnotes
|
||||
def execute():
|
||||
for sc in ["warranty-amc_expiry_details", "warranty-amc_summary"]:
|
||||
webnotes.delete_doc("Search Criteria", sc)
|
||||
@@ -1,5 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('accounts', 'search_criteria', 'trial_balance')
|
||||
@@ -6,9 +6,4 @@ def execute():
|
||||
delete from `tabDocPerm`
|
||||
where parent in ('Report', 'Search Criteria')""")
|
||||
|
||||
webnotes.conn.commit()
|
||||
|
||||
webnotes.reload_doc('core', 'doctype', 'search_criteria')
|
||||
webnotes.reload_doc('core', 'doctype', 'report')
|
||||
|
||||
webnotes.conn.begin()
|
||||
6
patches/june_2013/p02_update_project_completed.py
Normal file
6
patches/june_2013/p02_update_project_completed.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("projects", "doctype", "project")
|
||||
for p in webnotes.conn.sql_list("""select name from tabProject"""):
|
||||
webnotes.bean("Project", p).controller.update_percent_complete()
|
||||
18
patches/june_2013/p03_buying_selling_for_price_list.py
Normal file
18
patches/june_2013/p03_buying_selling_for_price_list.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import webnotes
|
||||
from webnotes.utils import cint
|
||||
|
||||
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)
|
||||
|
||||
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))
|
||||
87
patches/june_2013/p05_remove_unused_doctypes.py
Normal file
87
patches/june_2013/p05_remove_unused_doctypes.py
Normal file
@@ -0,0 +1,87 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
doctypes = [
|
||||
"Announcement",
|
||||
"Authorization Rules",
|
||||
"Blog Subscriber",
|
||||
"Books",
|
||||
"Call Log",
|
||||
"Call Log Details",
|
||||
"Campaign Expense",
|
||||
"Communication Log",
|
||||
"Compaint Note",
|
||||
"Company Control",
|
||||
"Competitor",
|
||||
"Complaint Detail",
|
||||
"Desktop Item",
|
||||
"DocType Label",
|
||||
"Employee Training",
|
||||
"Featured Item",
|
||||
"GL Control",
|
||||
"GL Mapper",
|
||||
"GL Mapper Detail",
|
||||
"Holiday Block List",
|
||||
"Holiday Block List Allow",
|
||||
"Holiday Block List Date",
|
||||
"Home Control",
|
||||
"Home Settings",
|
||||
"Item Parameter",
|
||||
"Item Parameter Value",
|
||||
"Lead Email CC Detail",
|
||||
"Manage Account",
|
||||
"Market Segment",
|
||||
"Multi Ledger Report Detail",
|
||||
"Naming Series Options",
|
||||
"Navigation Control",
|
||||
"Online Contact",
|
||||
"Order Reconciliation",
|
||||
"Order Reconciliation Detail",
|
||||
"Other Income Detail",
|
||||
"Partner Target Detail",
|
||||
"Permission Control",
|
||||
"Permission Rules",
|
||||
"Print Style",
|
||||
"Product Catalogue Control",
|
||||
"Product Group",
|
||||
"Product Settings",
|
||||
"Products Settings",
|
||||
"Profile Control",
|
||||
"Project Activity",
|
||||
"Project Activity Update",
|
||||
"Project Control",
|
||||
"Project Cost Breakup",
|
||||
"Related Page",
|
||||
"RV Detail",
|
||||
"Sales Browser Control",
|
||||
"Sandbox",
|
||||
"Search Criteria",
|
||||
"Series Detail",
|
||||
"Shipping Address",
|
||||
"SMS Receiver",
|
||||
"State",
|
||||
"TC Detail",
|
||||
"Territory Target Detail",
|
||||
"Timesheet",
|
||||
"Timesheet Detail",
|
||||
"Top Bar Settings",
|
||||
"Training Session",
|
||||
"Training Session Details",
|
||||
"Transfer Ownership",
|
||||
"Trash Control",
|
||||
"Trend Analyzer Control",
|
||||
"Update Delivery Date",
|
||||
"User Setting-Profile",
|
||||
"User Setting-Role Permission",
|
||||
"User Setting-Role User",
|
||||
"User Settings",
|
||||
"Valuation Control",
|
||||
"Website Product Category",
|
||||
"Workflow Action Detail",
|
||||
"Workflow Engine",
|
||||
"Workflow Rule",
|
||||
"Workflow Rule Detail"
|
||||
]
|
||||
|
||||
for d in doctypes:
|
||||
webnotes.delete_doc("DocType", d)
|
||||
78
patches/june_2013/p06_drop_unused_tables.py
Normal file
78
patches/june_2013/p06_drop_unused_tables.py
Normal file
@@ -0,0 +1,78 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
tables = [
|
||||
"About Us Team",
|
||||
"Account Balance",
|
||||
"Announcement",
|
||||
"Answer",
|
||||
"Blog Subscriber",
|
||||
"Books",
|
||||
"Call Log",
|
||||
"Call Log Details",
|
||||
"Campaign Expense",
|
||||
"Communication Log",
|
||||
"Compaint Note",
|
||||
"Competitor",
|
||||
"Complaint Detail",
|
||||
"Desktop Item",
|
||||
"DocType Label",
|
||||
"Employee Training",
|
||||
"Featured Item",
|
||||
"GL Mapper",
|
||||
"GL Mapper Detail",
|
||||
"Holiday Block List",
|
||||
"Holiday Block List Allow",
|
||||
"Holiday Block List Date",
|
||||
"Item Parameter",
|
||||
"Item Parameter Value",
|
||||
"Landed Cost Master",
|
||||
"Landed Cost Master Detail",
|
||||
"Lead Email CC Detail",
|
||||
"Lease Agreement",
|
||||
"Lease Installment",
|
||||
"Market Segment",
|
||||
"Multi Ledger Report Detail",
|
||||
"Naming Series Options",
|
||||
"Online Contact",
|
||||
"Order Reconciliation Detail",
|
||||
"Other Income Detail",
|
||||
"Partner Target Detail",
|
||||
"Period",
|
||||
"Print Style",
|
||||
"Product",
|
||||
"Product Group",
|
||||
"Project Activity",
|
||||
"Project Activity Update",
|
||||
"Project Cost Breakup",
|
||||
"Question",
|
||||
"RV Detail",
|
||||
"Related Page",
|
||||
"SMS Receiver",
|
||||
"Sales and Purchase Return Item",
|
||||
"Sandbox",
|
||||
"Series Detail",
|
||||
"Service Order Detail",
|
||||
"Service Quotation Detail",
|
||||
"Shipping Address",
|
||||
"State",
|
||||
"TC Detail",
|
||||
"Territory Target Detail",
|
||||
"Timesheet",
|
||||
"Timesheet Detail",
|
||||
"Training Session",
|
||||
"Training Session Details",
|
||||
"User Setting-Profile",
|
||||
"User Setting-Role Permission",
|
||||
"User Setting-Role User",
|
||||
"Website Product Category",
|
||||
"Workflow Action Detail",
|
||||
"Workflow Rule",
|
||||
"Workflow Rule Detail",
|
||||
]
|
||||
|
||||
webnotes.conn.sql("commit")
|
||||
all_tables = webnotes.conn.sql_list("show tables")
|
||||
for t in tables:
|
||||
if ("tab" + t) in all_tables:
|
||||
webnotes.conn.sql("drop table `tab%s`" % t)
|
||||
25
patches/june_2013/p07_taxes_price_list_for_territory.py
Normal file
25
patches/june_2013/p07_taxes_price_list_for_territory.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("setup", "doctype", "for_territory")
|
||||
webnotes.reload_doc("setup", "doctype", "price_list")
|
||||
webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master")
|
||||
|
||||
from setup.utils import get_root_of
|
||||
root_territory = get_root_of("Territory")
|
||||
|
||||
for parenttype in ["Sales Taxes and Charges Master", "Price List"]:
|
||||
for name in webnotes.conn.sql_list("""select name from `tab%s` main
|
||||
where not exists (select parent from `tabFor Territory` territory
|
||||
where territory.parenttype=%s and territory.parent=main.name)""" % \
|
||||
(parenttype, "%s"), (parenttype,)):
|
||||
|
||||
doc = webnotes.doc({
|
||||
"doctype": "For Territory",
|
||||
"__islocal": 1,
|
||||
"parenttype": parenttype,
|
||||
"parentfield": "valid_for_territories",
|
||||
"parent": name,
|
||||
"territory": root_territory
|
||||
})
|
||||
doc.save()
|
||||
11
patches/june_2013/p08_shopping_cart_settings.py
Normal file
11
patches/june_2013/p08_shopping_cart_settings.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("website", "doctype", "shopping_cart_settings")
|
||||
|
||||
# create two default territories, one for home country and one named Rest of the World
|
||||
from setup.doctype.setup_control.setup_control import create_territories
|
||||
create_territories()
|
||||
|
||||
webnotes.conn.set_value("Shopping Cart Settings", None, "default_territory", "Rest of the World")
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
import webnotes.modules
|
||||
webnotes.modules.reload_doc('selling', 'search_criteria', 'customer_address_contact')
|
||||
@@ -1,7 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('selling', 'search_criteria', 'itemwise_sales_details')
|
||||
reload_doc('selling', 'search_criteria', 'itemwise_delivery_details')
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.model import delete_doc
|
||||
delete_doc("Search Criteria", "sales_order_pending_items1")
|
||||
|
||||
webnotes.conn.sql("update `tabSearch Criteria` set module = 'Selling' where module = 'CRM'")
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('selling', 'search_criteria', 'sales_order_pending_items')
|
||||
@@ -1,100 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
rendt = {
|
||||
'Receivable Voucher' : 'Sales Invoice',
|
||||
'RV Detail' : 'Sales Invoice Item',
|
||||
'RV Tax Detail' : 'Sales Taxes and Charges',
|
||||
'Payable Voucher' : 'Purchase Invoice',
|
||||
'PV Detail' : 'Purchase Invoice Item',
|
||||
'Purchase Tax Detail' : 'Purchase Taxes and Charges',
|
||||
'Indent' : 'Material Request',
|
||||
'Indent Detail' : 'Material Request Item',
|
||||
'QA Inspection Report' : 'Quality Inspection',
|
||||
'Ticket' : 'Task',
|
||||
'Manage Account' : 'Global Defaults',
|
||||
'ToDo Item' : 'ToDo',
|
||||
'Term' : 'Terms and Conditions',
|
||||
'Static Parameter Detail' : 'SMS Parameter',
|
||||
'SS Earning Detail' : 'Salary Slip Earning',
|
||||
'SS Deduction Detail' : 'Salary Slip Deduction',
|
||||
'Sales Order Detail' : 'Sales Order Item',
|
||||
'Sales BOM Detail' : 'Sales BOM Item',
|
||||
'Return Detail' : 'Sales and Purchase Return Item',
|
||||
'Ref Rate Detail' : 'Item Price',
|
||||
'Receiver Detail' : 'SMS Receiver',
|
||||
'Quotation Detail' : 'Quotation Item',
|
||||
'QA Specification Detail' : 'Quality Inspection Reading',
|
||||
'Purchase Receipt Detail' : 'Purchase Receipt Item',
|
||||
'Purchase Other Charges' : 'Purchase Taxes and Charges Master',
|
||||
'PR Raw Material Detail' : 'Purchase Receipt Item Supplied',
|
||||
'PP SO Detail' : 'Production Plan Sales Order',
|
||||
'PP Detail' : 'Production Plan Item',
|
||||
'PO Raw Material Detail' : 'Purchase Order Item Supplied',
|
||||
'PO Detail' : 'Purchase Order Item',
|
||||
'Packing Slip Detail' : 'Packing Slip Item',
|
||||
'Other Charges' : 'Sales Taxes and Charges Master',
|
||||
'Order Lost Reason' : 'Quotation Lost Reason',
|
||||
'Manage Account' : 'Global Defaults',
|
||||
'Maintenance Visit Detail' : 'Maintenance Visit Purpose',
|
||||
'Ledger Balance Export' : 'Multi Ledger Report',
|
||||
'LC PR Detail' : 'Landed Cost Purchase Receipt',
|
||||
'Landed Cost Detail' : 'Landed Cost Item',
|
||||
'KRA Template' : 'Appraisal Template',
|
||||
'KRA Sheet' : 'Appraisal Template Goal',
|
||||
'Item Specification Detail' : 'Item Quality Inspection Parameter',
|
||||
'Item Maintenance Detail' : 'Maintenance Schedule Item',
|
||||
'IR Payment Detail' : 'Payment to Invoice Matching Tool Detail',
|
||||
'Internal Reconciliation' : 'Payment to Invoice Matching Tool',
|
||||
'Installed Item Details' : 'Installation Note Item',
|
||||
'Holiday List Detail' : 'Holiday',
|
||||
'Follow up' : 'Communication Log',
|
||||
'Flat BOM Detail' : 'BOM Explosion Item',
|
||||
'Expense Voucher Detail' : 'Expense Claim Detail',
|
||||
'Expense Voucher' : 'Expense Claim',
|
||||
'Expense Type' : 'Expense Claim Type',
|
||||
'Enquiry Detail' : 'Opportunity Item',
|
||||
'Enquiry' : 'Opportunity',
|
||||
'Earning Detail' : 'Salary Structure Earning',
|
||||
'DocLayerField' : 'Customize Form Field',
|
||||
'DocLayer' : 'Customize Form',
|
||||
'Delivery Note Detail' : 'Delivery Note Item',
|
||||
'Deduction Detail' : 'Salary Structure Deduction',
|
||||
'Comment Widget Record' : 'Comment',
|
||||
'BOM Material' : 'BOM Item',
|
||||
'Bill Of Materials' : 'BOM',
|
||||
'Appraisal Detail' : 'Appraisal Goal',
|
||||
'Advance Allocation Detail' : 'Purchase Invoice Advance',
|
||||
'Advance Adjustment Detail' : 'Sales Invoice Advance',
|
||||
'Ledger Detail' : 'Multi Ledger Report Detail',
|
||||
'TA Control' : 'Trend Analyzer Control',
|
||||
'Sales and Purchase Return Wizard' : 'Sales and Purchase Return Tool',
|
||||
'Educational Qualifications Detail' : 'Employee Education',
|
||||
'Delivery Note Packing Detail' : 'Delivery Note Packing Item',
|
||||
'Experience In Company Detail' : 'Employee Internal Work History',
|
||||
'Professional Training Details' : 'Employee Training',
|
||||
'Previous Experience Detail' : 'Employee External Work History',
|
||||
}
|
||||
|
||||
for d in rendt:
|
||||
webnotes.conn.sql("""
|
||||
update
|
||||
`tabSearch Criteria`
|
||||
set
|
||||
doc_type = replace(doc_type, %s, %s),
|
||||
filters = replace(filters, %s, %s),
|
||||
columns = replace(columns, %s, %s),
|
||||
parent_doc_type = replace(parent_doc_type, %s, %s),
|
||||
add_cond = replace(add_cond, %s, %s),
|
||||
add_col = replace(add_col, %s, %s),
|
||||
add_tab = replace(add_tab, %s, %s),
|
||||
dis_filters = replace(dis_filters, %s, %s),
|
||||
group_by = replace(group_by, %s, %s),
|
||||
sort_by = replace(sort_by, %s, %s),
|
||||
report_script = replace(report_script, %s, %s),
|
||||
server_script = replace(server_script, %s, %s),
|
||||
custom_query = replace(custom_query, %s, %s)
|
||||
""", (d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d],
|
||||
d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d], d, rendt[d]))
|
||||
|
||||
|
||||
16
patches/may_2013/p01_selling_net_total_export.py
Normal file
16
patches/may_2013/p01_selling_net_total_export.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.utils import cint
|
||||
|
||||
def execute():
|
||||
for module, doctype in (("Accounts", "Sales Invoice"), ("Selling", "Sales Order"), ("Selling", "Quotation"),
|
||||
("Stock", "Delivery Note")):
|
||||
webnotes.reload_doc(module, "DocType", doctype)
|
||||
webnotes.conn.sql("""update `tab%s`
|
||||
set net_total_export = round(net_total / if(conversion_rate=0, 1, ifnull(conversion_rate, 1)), 2),
|
||||
other_charges_total_export = round(grand_total_export - net_total_export, 2)""" %
|
||||
(doctype,))
|
||||
|
||||
for module, doctype in (("Accounts", "Sales Invoice Item"), ("Selling", "Sales Order Item"), ("Selling", "Quotation Item"),
|
||||
("Stock", "Delivery Note Item")):
|
||||
webnotes.reload_doc(module, "DocType", doctype)
|
||||
28
patches/may_2013/p06_make_notes.py
Normal file
28
patches/may_2013/p06_make_notes.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import webnotes, markdown2
|
||||
|
||||
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:
|
||||
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()
|
||||
|
||||
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'""")
|
||||
24
patches/may_2013/p06_update_billed_amt_po_pr.py
Normal file
24
patches/may_2013/p06_update_billed_amt_po_pr.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
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)
|
||||
23
patches/may_2013/p07_move_update_stock_to_pos.py
Normal file
23
patches/may_2013/p07_move_update_stock_to_pos.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import webnotes, webnotes.defaults
|
||||
from webnotes.utils import cint
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("accounts", "doctype", "pos_setting")
|
||||
|
||||
webnotes.conn.sql("""update `tabPOS Setting` set update_stock=%s""",
|
||||
cint(webnotes.defaults.get_global_default("update_stock")))
|
||||
|
||||
webnotes.conn.sql("""delete from `tabSingles`
|
||||
where doctype='Global Defaults' and field='update_stock'""")
|
||||
|
||||
webnotes.conn.sql("""delete from `tabDefaultValue`
|
||||
where parent='Control Panel' and defkey="update_stock" """)
|
||||
|
||||
webnotes.defaults.clear_cache("Control Panel")
|
||||
|
||||
webnotes.reload_doc("setup", "doctype", "global_defaults")
|
||||
|
||||
# previously, update_stock was valid only when is_pos was checked
|
||||
# henceforth it is valid, and hence the patch
|
||||
webnotes.conn.sql("""update `tabSales Invoice` set update_stock=0
|
||||
where ifnull(is_pos, 0)=0""")
|
||||
23
patches/may_2013/p08_change_item_wise_tax.py
Normal file
23
patches/may_2013/p08_change_item_wise_tax.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import webnotes
|
||||
import json
|
||||
from webnotes.utils import flt
|
||||
|
||||
def execute():
|
||||
for doctype in ["Purchase Taxes and Charges", "Sales Taxes and Charges"]:
|
||||
for tax_name, item_wise_tax_detail in \
|
||||
webnotes.conn.sql("""select name, item_wise_tax_detail from `tab%s`""" % doctype):
|
||||
if not item_wise_tax_detail or not isinstance(item_wise_tax_detail, basestring):
|
||||
continue
|
||||
|
||||
try:
|
||||
json.loads(item_wise_tax_detail)
|
||||
except ValueError:
|
||||
out = {}
|
||||
for t in item_wise_tax_detail.split("\n"):
|
||||
if ":" in t:
|
||||
account_head, amount = t.split(":")
|
||||
out[account_head.strip()] = flt(amount.strip())
|
||||
|
||||
if out:
|
||||
webnotes.conn.sql("""update `tab%s` set item_wise_tax_detail=%s
|
||||
where name=%s""" % (doctype, "%s", "%s"), (json.dumps(out), tax_name))
|
||||
@@ -3,11 +3,12 @@ import webnotes
|
||||
def execute():
|
||||
webnotes.clear_perms("Profile")
|
||||
webnotes.reload_doc("core", "doctype", "profile")
|
||||
webnotes.conn.sql("""delete from `tabDefaultValue` where defkey='theme'""")
|
||||
webnotes.delete_doc("Page", "profile-settings")
|
||||
return
|
||||
|
||||
for name in webnotes.conn.sql("""select name from tabProfile"""):
|
||||
theme = webnotes.conn.get_default("theme", name[0])
|
||||
if theme:
|
||||
webnotes.conn.set_value("Profile", name[0], "theme", theme)
|
||||
|
||||
webnotes.conn.sql("""delete from `tabDefaultValue` where defkey='theme'""")
|
||||
webnotes.delete_doc("Page", "profile-settings")
|
||||
@@ -1,3 +0,0 @@
|
||||
def execute():
|
||||
from webnotes.model import delete_doc
|
||||
delete_doc("Search Criteria", "itemwise_sales_register1")
|
||||
@@ -1,7 +0,0 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.delete_doc("Search Criteria", "delivery_note_itemwise_pending_to_bill")
|
||||
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc("accounts", "report", "delivered_items_to_be_billed")
|
||||
@@ -1,7 +0,0 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
webnotes.conn.sql("""delete from `tabSearch Criteria`
|
||||
where name ='employee_leave_balance_report1'""")
|
||||
webnotes.conn.sql("""delete from `tabSearch Criteria`
|
||||
where name ='employee_leave_balance_report2'""")
|
||||
@@ -1,8 +0,0 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("""delete from `tabSearch Criteria` \
|
||||
where name = 'customer_address_contact'""")
|
||||
|
||||
webnotes.reload_doc("core", "doctype", "docfield")
|
||||
webnotes.reload_doc("core", "doctype", "report")
|
||||
webnotes.reload_doc('selling', 'report', 'customer_addresses_and_contacts')
|
||||
@@ -1,6 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
from webnotes.model import delete_doc
|
||||
|
||||
def execute():
|
||||
# remove search criteria
|
||||
delete_doc("Search Criteria", "trial_balance")
|
||||
@@ -38,19 +38,15 @@ patch_list = [
|
||||
"patches.may_2012.cleanup_property_setter",
|
||||
"patches.may_2012.rename_prev_doctype",
|
||||
"patches.may_2012.cleanup_notification_control",
|
||||
"patches.may_2012.renamedt_in_custom_search_criteria",
|
||||
"patches.may_2012.stock_reco_patch",
|
||||
"patches.may_2012.reload_reports",
|
||||
"patches.may_2012.page_role_series_fix",
|
||||
"patches.may_2012.reload_sales_invoice_pf",
|
||||
"patches.may_2012.std_pf_readonly",
|
||||
"patches.may_2012.reload_so_pending_items",
|
||||
"patches.may_2012.customize_form_cleanup",
|
||||
"patches.may_2012.cs_server_readonly",
|
||||
"patches.may_2012.clear_session_cache",
|
||||
"patches.may_2012.same_purchase_rate_patch",
|
||||
"patches.may_2012.create_report_manager_role",
|
||||
"patches.may_2012.reload_customer_address_contact",
|
||||
"patches.may_2012.profile_perm_patch",
|
||||
"patches.may_2012.remove_euro_currency",
|
||||
"patches.may_2012.remove_communication_log",
|
||||
@@ -81,7 +77,6 @@ patch_list = [
|
||||
"patches.august_2012.task_allocated_to_assigned",
|
||||
"patches.august_2012.change_profile_permission",
|
||||
"patches.august_2012.repost_billed_amt",
|
||||
"patches.august_2012.remove_cash_flow_statement",
|
||||
"patches.september_2012.stock_report_permissions_for_accounts",
|
||||
"patches.september_2012.communication_delete_permission",
|
||||
"patches.september_2012.all_permissions_patch",
|
||||
@@ -96,20 +91,15 @@ patch_list = [
|
||||
"patches.october_2012.update_permission",
|
||||
"patches.october_2012.reload_gl_mapper",
|
||||
"patches.october_2012.fix_wrong_vouchers",
|
||||
"patches.october_2012.remove_old_customer_contact_address",
|
||||
"patches.october_2012.company_fiscal_year_docstatus_patch",
|
||||
"patches.october_2012.update_account_property",
|
||||
"patches.october_2012.remove_old_trial_bal",
|
||||
"patches.october_2012.fix_cancelled_gl_entries",
|
||||
"patches.october_2012.custom_script_delete_permission",
|
||||
"patches.november_2012.custom_field_insert_after",
|
||||
"patches.november_2012.delete_item_sales_register1",
|
||||
"patches.november_2012.rename_employee_leave_balance_report",
|
||||
"patches.november_2012.report_permissions",
|
||||
"patches.november_2012.customer_issue_allocated_to_assigned",
|
||||
"patches.november_2012.reset_appraisal_permissions",
|
||||
"patches.november_2012.disable_cancelled_profiles",
|
||||
"patches.november_2012.remove_old_unbilled_items_report",
|
||||
"patches.november_2012.support_ticket_response_to_communication",
|
||||
"patches.november_2012.cancelled_bom_patch",
|
||||
"patches.november_2012.communication_sender_and_recipient",
|
||||
@@ -123,7 +113,6 @@ patch_list = [
|
||||
"patches.december_2012.expense_leave_reload",
|
||||
"patches.december_2012.repost_ordered_qty",
|
||||
"patches.december_2012.repost_projected_qty",
|
||||
"patches.december_2012.reload_debtors_creditors_ledger",
|
||||
"patches.december_2012.website_cache_refactor",
|
||||
"patches.december_2012.production_cleanup",
|
||||
"patches.december_2012.fix_default_print_format",
|
||||
@@ -138,8 +127,6 @@ patch_list = [
|
||||
"patches.december_2012.remove_project_mapper",
|
||||
"patches.december_2012.update_print_width",
|
||||
"patches.january_2013.remove_bad_permissions",
|
||||
"patches.january_2013.deprecate_stock_search_criteria",
|
||||
"patches.january_2013.remove_support_search_criteria",
|
||||
"patches.january_2013.holiday_list_patch",
|
||||
"patches.january_2013.stock_reconciliation_patch",
|
||||
"patches.january_2013.report_permission",
|
||||
@@ -163,7 +150,6 @@ patch_list = [
|
||||
"patches.february_2013.remove_gl_mapper",
|
||||
"patches.february_2013.reload_bom_replace_tool_permission",
|
||||
"patches.february_2013.payment_reconciliation_reset_values",
|
||||
"patches.february_2013.remove_sales_order_pending_items",
|
||||
"patches.february_2013.account_negative_balance",
|
||||
"patches.february_2013.remove_account_utils_folder",
|
||||
"patches.february_2013.update_company_in_leave_application",
|
||||
@@ -187,14 +173,11 @@ patch_list = [
|
||||
"execute:webnotes.delete_doc('DocType', 'Service Quotation Detail')",
|
||||
"patches.february_2013.p06_material_request_mappers",
|
||||
"execute:webnotes.delete_doc('Page', 'Query Report')",
|
||||
"execute:webnotes.delete_doc('Search Criteria', 'employeewise_balance_leave_report')",
|
||||
"execute:webnotes.delete_doc('Search Criteria', 'employee_leave_balance_report')",
|
||||
"patches.february_2013.repost_reserved_qty",
|
||||
"execute:webnotes.reload_doc('core', 'doctype', 'report') # 2013-02-25",
|
||||
"execute:webnotes.conn.sql(\"update `tabReport` set report_type=if(ifnull(query, '')='', 'Report Builder', 'Query Report') where is_standard='No'\")",
|
||||
"execute:webnotes.conn.sql(\"update `tabReport` set report_name=name where ifnull(report_name,'')='' and is_standard='No'\")",
|
||||
"patches.february_2013.p08_todo_query_report",
|
||||
"execute:webnotes.delete_doc('Search Criteria', 'gross_profit') # 2013-02-26",
|
||||
'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Classic") # 2013-02-26',
|
||||
'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Modern") # 2013-02-26',
|
||||
'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Spartan") # 2013-02-26',
|
||||
@@ -208,7 +191,6 @@ patch_list = [
|
||||
"execute:webnotes.delete_doc('DocType', 'Attendance Control Panel')",
|
||||
"patches.march_2013.p02_get_global_default",
|
||||
"patches.march_2013.p03_rename_blog_to_blog_post",
|
||||
"execute:webnotes.reload_doc('hr', 'search_criteria', 'monthly_attendance_details')",
|
||||
"patches.march_2013.p04_pos_update_stock_check",
|
||||
"patches.march_2013.p05_payment_reconciliation",
|
||||
"patches.march_2013.p06_remove_sales_purchase_return_tool",
|
||||
@@ -234,25 +216,33 @@ patch_list = [
|
||||
'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Modern") # 2013-04-02',
|
||||
'execute:webnotes.reload_doc("selling", "Print Format", "Quotation Spartan") # 2013-04-02',
|
||||
"patches.april_2013.p04_reverse_modules_list",
|
||||
"execute:webnotes.delete_doc('Search Criteria', 'time_log_summary')",
|
||||
"patches.april_2013.p04_update_role_in_pages",
|
||||
"patches.april_2013.p05_update_file_data",
|
||||
"patches.april_2013.p06_update_file_size",
|
||||
"patches.april_2013.p05_fixes_in_reverse_modules",
|
||||
"execute:webnotes.delete_doc('DocType Mapper', 'Delivery Note-Packing Slip')",
|
||||
"execute:webnotes.reload_doc('Stock', 'DocType', 'Delivery Note Item')",
|
||||
"patches.april_2013.p07_rename_cost_center_other_charges",
|
||||
"patches.april_2013.p06_default_cost_center",
|
||||
"execute:webnotes.reset_perms('File Data')",
|
||||
"patches.april_2013.p07_update_file_data_2",
|
||||
"patches.april_2013.rebuild_sales_browser",
|
||||
"patches.april_2013.p08_price_list_country",
|
||||
"patches.may_2013.p01_selling_net_total_export",
|
||||
"patches.may_2013.repost_stock_for_no_posting_time",
|
||||
"patches.may_2013.p01_conversion_factor_and_aii",
|
||||
"patches.may_2013.p02_update_valuation_rate",
|
||||
"patches.may_2013.p03_update_support_ticket",
|
||||
"patches.may_2013.p04_reorder_level",
|
||||
"patches.may_2013.p05_update_cancelled_gl_entries",
|
||||
"patches.may_2013.p06_make_notes",
|
||||
"patches.may_2013.p06_update_billed_amt_po_pr",
|
||||
"patches.may_2013.p07_move_update_stock_to_pos",
|
||||
"patches.may_2013.p08_change_item_wise_tax",
|
||||
"patches.june_2013.p01_update_bom_exploded_items",
|
||||
"patches.june_2013.p02_update_project_completed",
|
||||
"execute:webnotes.delete_doc('DocType', 'System Console')",
|
||||
"patches.june_2013.p03_buying_selling_for_price_list",
|
||||
"patches.june_2013.p04_fix_event_for_lead_oppty_project",
|
||||
"patches.june_2013.p05_remove_unused_doctypes",
|
||||
"patches.june_2013.p06_drop_unused_tables",
|
||||
"patches.june_2013.p08_shopping_cart_settings",
|
||||
]
|
||||
@@ -7,7 +7,4 @@ def execute():
|
||||
for dt in ["Period", "Account Balance", "Multi Ledger Report",
|
||||
"Multi Ledger Report Detail", "Period Control", "Reposting Tool",
|
||||
"Lease Agreement", "Lease Installment"]:
|
||||
delete_doc("DocType", dt)
|
||||
|
||||
# remove search criteria
|
||||
delete_doc("Search Criteria", "Trial Balance")
|
||||
delete_doc("DocType", dt)
|
||||
Reference in New Issue
Block a user