fix in setup control and patch to fix existing docstatus problem

This commit is contained in:
Anand Doshi
2012-10-05 15:12:32 +05:30
5 changed files with 47 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
import webnotes
def execute():
webnotes.conn.sql("""update `tabCompany` set docstatus = 0
where docstatus is null""")
webnotes.conn.sql("""update `tabFiscal Year` set docstatus = 0
where docstatus is null""")

View File

@@ -0,0 +1,6 @@
from __future__ import unicode_literals
from webnotes.model import delete_doc
def execute():
# remove search criteria
delete_doc("Search Criteria", "trial_balance")

View File

@@ -0,0 +1,14 @@
def execute():
import webnotes
from webnotes.utils.nestedset import rebuild_tree
rebuild_tree('Account', 'parent_account')
roots = webnotes.conn.sql("""
select lft, rgt, debit_or_credit, is_pl_account, company from `tabAccount`
where ifnull(parent_account, '') = ''
""", as_dict=1)
for acc in roots:
webnotes.conn.sql("""update tabAccount set debit_or_credit = %(debit_or_credit)s,
is_pl_account = %(is_pl_account)s, company = %(company)s
where lft > %(lft)s and rgt < %(rgt)s""", acc, debug=1)