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() {
if(!this.account_by_name) {
this.account_by_name = this.make_name_map(wn.report_dump.data["Account"]);
this.make_voucher_acconuts_map();
}
this.account_by_name = this.make_name_map(wn.report_dump.data["Account"]);
this.make_voucher_acconuts_map();
},
make_voucher_acconuts_map: function() {

View File

@ -6,6 +6,7 @@ def execute():
ml = json.loads(webnotes.conn.get_global("modules_list") or "[]")
webnotes.conn.set_global("hidden_modules",
json.dumps(list(set(modules.keys()).difference(set(ml)))))
if 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
""", (d[0], d[1]))
if flt(d[3]) != flt(ordered_qty[0][0]):
print d[3], ordered_qty[0][0]
if flt(d[3]) != flt(ordered_qty[0][0]):
webnotes.conn.sql("""update `tabBin` set ordered_qty = %s where name = %s""",
(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) \
or (r["against_voucher_type"]=="Purchase Invoice" and flt(["outstanding"]) <= 0)):
webnotes.conn.set_value(r["against_voucher_type"], r["against_voucher"],
"outstanding_amount", abs(flt(r["outstanding"])))
else:
print r["against_voucher_type"], r["against_voucher"], \
outstanding[0][1], abs(flt(r["outstanding"]))
"outstanding_amount", abs(flt(r["outstanding"])))

View File

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

View File

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

View File

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

View File

@ -7,7 +7,6 @@ def execute():
webnotes.conn.auto_commit_on_many_writes = True
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,
voucher_detail_no, posting_date, posting_time, stock_value,
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`
where docstatus < 2 and company = %s""", company[0])
print "Total Delivery Note: ", len(dn_list)
for dn in dn_list:
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`
where docstatus < 2 and company = %s""", company[0])
print "Total Sales Invoice: ", len(si_list)
for si in si_list:
si = webnotes.get_obj("Sales Invoice", si[0], with_children = 1)
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]
if count > 4:
print "Company", company, \
"has more than 4 root accounts. cannot apply patch to this company."
webnotes.errprint("Company" + company +
"has more than 4 root accounts. cannot apply patch to this company.")
continue
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})
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
cc = webnotes.bean({

View File

@ -12,6 +12,5 @@ def execute():
'Sales Invoice Spartan',
'Sales Invoice Modern'
]:
print 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""",
(entry['voucher_type'], entry['voucher_no']))
except Exception, e:
print entry
print e
pass

View File

@ -231,7 +231,7 @@ patch_list = [
"patches.march_2013.p12_set_item_tax_rate_in_json",
"patches.march_2013.p07_update_valuation_rate",
"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.p02_add_country_and_currency",
"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.p05_update_file_data",
"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,
"modified": "2013-03-26 14:05:01",
"modified": "2013-04-10 11:49:11",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -23,13 +23,18 @@
"permlevel": 0
},
{
"amend": 0,
"create": 1,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Lead",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"submit": 0
"report": 1,
"submit": 0,
"write": 1
},
{
"doctype": "DocType",
@ -445,69 +450,13 @@
"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,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"report": 1,
"role": "Sales Manager",
"write": 1
"role": "Sales Manager"
},
{
"amend": 0,
"cancel": 0,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"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
"role": "Sales User"
}
]

View File

@ -79,7 +79,6 @@ class DocType(StockController):
values = [{
'item_code' : self.doc.item_code,
'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_time' : self.doc.purchase_time or '00:00',
'voucher_type' : 'Serial No',