Merge branch 'master' into edge

Conflicts:
	patches/patch_list.py
This commit is contained in:
Anand Doshi 2013-04-10 19:47:46 +05:30
commit 93b638af4d
15 changed files with 33 additions and 94 deletions

View File

@ -306,10 +306,8 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
}, },
make_account_by_name: function() { make_account_by_name: function() {
if(!this.account_by_name) { this.account_by_name = this.make_name_map(wn.report_dump.data["Account"]);
this.account_by_name = this.make_name_map(wn.report_dump.data["Account"]); this.make_voucher_acconuts_map();
this.make_voucher_acconuts_map();
}
}, },
make_voucher_acconuts_map: function() { make_voucher_acconuts_map: function() {

View File

@ -6,6 +6,7 @@ def execute():
ml = json.loads(webnotes.conn.get_global("modules_list") or "[]") ml = json.loads(webnotes.conn.get_global("modules_list") or "[]")
webnotes.conn.set_global("hidden_modules", if ml:
json.dumps(list(set(modules.keys()).difference(set(ml))))) webnotes.conn.set_global("hidden_modules",
json.dumps(list(set(modules.keys()).difference(set(ml)))))

View File

@ -0,0 +1,10 @@
import webnotes, json
import webnotes.utils
def execute():
modules = webnotes.get_config().modules
ml = json.loads(webnotes.conn.get_global("hidden_modules"))
if len(ml) == len(modules.keys()):
webnotes.conn.set_global("hidden_modules", json.dumps([]))

View File

@ -10,8 +10,6 @@ def execute():
and po_item.item_code = %s and po_item.warehouse = %s and po_item.item_code = %s and po_item.warehouse = %s
""", (d[0], d[1])) """, (d[0], d[1]))
if flt(d[3]) != flt(ordered_qty[0][0]): if flt(d[3]) != flt(ordered_qty[0][0]):
print d[3], ordered_qty[0][0]
webnotes.conn.sql("""update `tabBin` set ordered_qty = %s where name = %s""", webnotes.conn.sql("""update `tabBin` set ordered_qty = %s where name = %s""",
(ordered_qty and ordered_qty[0][0] or 0, d[2])) (ordered_qty and ordered_qty[0][0] or 0, d[2]))

View File

@ -17,8 +17,4 @@ def execute():
if ((r["against_voucher_type"]=='Sales Invoice' and flt(r["outstanding"]) >= 0) \ if ((r["against_voucher_type"]=='Sales Invoice' and flt(r["outstanding"]) >= 0) \
or (r["against_voucher_type"]=="Purchase Invoice" and flt(["outstanding"]) <= 0)): or (r["against_voucher_type"]=="Purchase Invoice" and flt(["outstanding"]) <= 0)):
webnotes.conn.set_value(r["against_voucher_type"], r["against_voucher"], webnotes.conn.set_value(r["against_voucher_type"], r["against_voucher"],
"outstanding_amount", abs(flt(r["outstanding"]))) "outstanding_amount", abs(flt(r["outstanding"])))
else:
print r["against_voucher_type"], r["against_voucher"], \
outstanding[0][1], abs(flt(r["outstanding"]))

View File

@ -34,10 +34,8 @@ def execute():
except Exception, e: except Exception, e:
# if duplicate entry, then dont update # if duplicate entry, then dont update
if e[0]!=1062: if e[0]!=1062:
print webnotes.getTraceback()
raise e raise e
print change_map
changed_keys = change_map.keys() changed_keys = change_map.keys()
@ -61,6 +59,5 @@ def execute():
except Exception, e: except Exception, e:
if e[0]!=1146: if e[0]!=1146:
print webnotes.getTraceback()
raise e raise e

View File

@ -23,7 +23,6 @@ def repost_reserved_qty():
i = 0 i = 0
for d in bins: for d in bins:
i += 1 i += 1
print i
reserved_qty = webnotes.conn.sql(""" reserved_qty = webnotes.conn.sql("""
select select
sum((dnpi_qty / so_item_qty) * (so_item_qty - so_item_delivered_qty)) sum((dnpi_qty / so_item_qty) * (so_item_qty - so_item_delivered_qty))
@ -54,7 +53,6 @@ def repost_reserved_qty():
""", (d[0], d[1])) """, (d[0], d[1]))
if flt(d[3]) != flt(reserved_qty[0][0]): if flt(d[3]) != flt(reserved_qty[0][0]):
print d[3], reserved_qty[0][0]
webnotes.conn.sql(""" webnotes.conn.sql("""
update `tabBin` set reserved_qty = %s where name = %s update `tabBin` set reserved_qty = %s where name = %s
""", (reserved_qty and reserved_qty[0][0] or 0, d[2])) """, (reserved_qty and reserved_qty[0][0] or 0, d[2]))
@ -77,7 +75,6 @@ def cleanup_wrong_sle():
) )
""") """)
if sle: if sle:
print sle
for d in sle: for d in sle:
webnotes.conn.sql("update `tabStock Ledger Entry` set is_cancelled = 'Yes' where name = %s", d[3]) webnotes.conn.sql("update `tabStock Ledger Entry` set is_cancelled = 'Yes' where name = %s", d[3])
create_comment(d[3]) create_comment(d[3])

View File

@ -24,7 +24,6 @@ def handle_custom_fields():
* Create property setter entry of previous field * Create property setter entry of previous field
* Remove custom fields from tabDocField * Remove custom fields from tabDocField
""" """
print "in handle custom fields"
cf = get_cf() cf = get_cf()
assign_idx(cf) assign_idx(cf)
create_prev_field_prop_setter(cf) create_prev_field_prop_setter(cf)
@ -120,7 +119,6 @@ def create_file_list():
webnotes.clear_cache(doctype=obj.doc.name) webnotes.clear_cache(doctype=obj.doc.name)
def change_to_decimal(): def change_to_decimal():
print "in change to decimal"
webnotes.conn.commit() webnotes.conn.commit()
tables = webnotes.conn.sql("SHOW TABLES") tables = webnotes.conn.sql("SHOW TABLES")
alter_tables_list = [] alter_tables_list = []

View File

@ -7,7 +7,6 @@ def execute():
webnotes.conn.auto_commit_on_many_writes = True webnotes.conn.auto_commit_on_many_writes = True
for company in webnotes.conn.sql("select name from `tabCompany`"): for company in webnotes.conn.sql("select name from `tabCompany`"):
print company[0]
stock_ledger_entries = webnotes.conn.sql("""select item_code, voucher_type, voucher_no, stock_ledger_entries = webnotes.conn.sql("""select item_code, voucher_type, voucher_no,
voucher_detail_no, posting_date, posting_time, stock_value, voucher_detail_no, posting_date, posting_time, stock_value,
warehouse, actual_qty as qty from `tabStock Ledger Entry` warehouse, actual_qty as qty from `tabStock Ledger Entry`
@ -17,7 +16,6 @@ def execute():
dn_list = webnotes.conn.sql("""select name from `tabDelivery Note` dn_list = webnotes.conn.sql("""select name from `tabDelivery Note`
where docstatus < 2 and company = %s""", company[0]) where docstatus < 2 and company = %s""", company[0])
print "Total Delivery Note: ", len(dn_list)
for dn in dn_list: for dn in dn_list:
dn = webnotes.get_obj("Delivery Note", dn[0], with_children = 1) dn = webnotes.get_obj("Delivery Note", dn[0], with_children = 1)
@ -25,7 +23,6 @@ def execute():
si_list = webnotes.conn.sql("""select name from `tabSales Invoice` si_list = webnotes.conn.sql("""select name from `tabSales Invoice`
where docstatus < 2 and company = %s""", company[0]) where docstatus < 2 and company = %s""", company[0])
print "Total Sales Invoice: ", len(si_list)
for si in si_list: for si in si_list:
si = webnotes.get_obj("Sales Invoice", si[0], with_children = 1) si = webnotes.get_obj("Sales Invoice", si[0], with_children = 1)
si.set_buying_amount(stock_ledger_entries) si.set_buying_amount(stock_ledger_entries)

View File

@ -56,8 +56,8 @@ def add_accounts(accounts_to_add, check_fn=None):
where company=%s and ifnull(parent_account, '')=''""", company)[0][0] where company=%s and ifnull(parent_account, '')=''""", company)[0][0]
if count > 4: if count > 4:
print "Company", company, \ webnotes.errprint("Company" + company +
"has more than 4 root accounts. cannot apply patch to this company." "has more than 4 root accounts. cannot apply patch to this company.")
continue continue
for account_name, parent_account_name, group_or_ledger, account_type in accounts_to_add: for account_name, parent_account_name, group_or_ledger, account_type in accounts_to_add:
@ -82,7 +82,7 @@ def add_aii_cost_center():
{"parent_cost_center['']": '', "company_name": company}) {"parent_cost_center['']": '', "company_name": company})
if not parent_cost_center: if not parent_cost_center:
print "Company", company, "does not have a root cost center" webnotes.errprint("Company " + company + "does not have a root cost center")
continue continue
cc = webnotes.bean({ cc = webnotes.bean({

View File

@ -12,6 +12,5 @@ def execute():
'Sales Invoice Spartan', 'Sales Invoice Spartan',
'Sales Invoice Modern' 'Sales Invoice Modern'
]: ]:
print r.get('name')
webnotes.modules.reload_doc(r.get('module'), 'Print Format', r.get('name')) webnotes.modules.reload_doc(r.get('module'), 'Print Format', r.get('name'))

View File

@ -12,5 +12,4 @@ def execute():
where voucher_type = %s and voucher_no = %s""", where voucher_type = %s and voucher_no = %s""",
(entry['voucher_type'], entry['voucher_no'])) (entry['voucher_type'], entry['voucher_no']))
except Exception, e: except Exception, e:
print entry pass
print e

View File

@ -231,7 +231,7 @@ patch_list = [
"patches.march_2013.p12_set_item_tax_rate_in_json", "patches.march_2013.p12_set_item_tax_rate_in_json",
"patches.march_2013.p07_update_valuation_rate", "patches.march_2013.p07_update_valuation_rate",
"patches.march_2013.p08_create_aii_accounts", "patches.march_2013.p08_create_aii_accounts",
"patches.march_2013.p03_update_buying_amount", # "patches.march_2013.p03_update_buying_amount",
"patches.april_2013.p01_update_serial_no_valuation_rate", "patches.april_2013.p01_update_serial_no_valuation_rate",
"patches.april_2013.p02_add_country_and_currency", "patches.april_2013.p02_add_country_and_currency",
"patches.april_2013.p03_fixes_for_lead_in_quotation", "patches.april_2013.p03_fixes_for_lead_in_quotation",
@ -243,4 +243,5 @@ patch_list = [
"patches.april_2013.p04_update_role_in_pages", "patches.april_2013.p04_update_role_in_pages",
"patches.april_2013.p05_update_file_data", "patches.april_2013.p05_update_file_data",
"patches.april_2013.p06_update_file_size", "patches.april_2013.p06_update_file_size",
"patches.april_2013.p05_fixes_in_reverse_modules",
] ]

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-28 17:07:01", "creation": "2013-04-10 11:45:37",
"docstatus": 0, "docstatus": 0,
"modified": "2013-03-26 14:05:01", "modified": "2013-04-10 11:49:11",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -23,13 +23,18 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"amend": 0,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"name": "__common__", "name": "__common__",
"parent": "Lead", "parent": "Lead",
"parentfield": "permissions", "parentfield": "permissions",
"parenttype": "DocType", "parenttype": "DocType",
"permlevel": 0,
"read": 1, "read": 1,
"submit": 0 "report": 1,
"submit": 0,
"write": 1
}, },
{ {
"doctype": "DocType", "doctype": "DocType",
@ -445,69 +450,13 @@
"label": "Blog Subscriber" "label": "Blog Subscriber"
}, },
{ {
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"report": 1,
"role": "Guest",
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"permlevel": 1,
"report": 0,
"role": "Sales User",
"write": 0
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"permlevel": 1,
"report": 0,
"role": "Sales Manager",
"write": 0
},
{
"amend": 0,
"cancel": 1, "cancel": 1,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"permlevel": 0, "role": "Sales Manager"
"report": 1,
"role": "Sales Manager",
"write": 1
}, },
{ {
"amend": 0,
"cancel": 0, "cancel": 0,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"permlevel": 0, "role": "Sales User"
"report": 1,
"role": "Sales User",
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"permlevel": 1,
"role": "All"
},
{
"amend": 0,
"cancel": 0,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"report": 1,
"role": "System Manager",
"write": 1
} }
] ]

View File

@ -79,7 +79,6 @@ class DocType(StockController):
values = [{ values = [{
'item_code' : self.doc.item_code, 'item_code' : self.doc.item_code,
'warehouse' : self.doc.warehouse, 'warehouse' : self.doc.warehouse,
'transaction_date' : nowdate(),
'posting_date' : self.doc.purchase_date or (self.doc.creation and self.doc.creation.split(' ')[0]) or nowdate(), 'posting_date' : self.doc.purchase_date or (self.doc.creation and self.doc.creation.split(' ')[0]) or nowdate(),
'posting_time' : self.doc.purchase_time or '00:00', 'posting_time' : self.doc.purchase_time or '00:00',
'voucher_type' : 'Serial No', 'voucher_type' : 'Serial No',