[minor] renamed perpetual accounting to make_accounting_entry_for_every_stock_entry

This commit is contained in:
Nabin Hait
2013-08-28 19:24:52 +05:30
parent 2e296fa46f
commit d85d63bb81
30 changed files with 138 additions and 187 deletions

View File

@@ -0,0 +1,9 @@
import webnotes
from webnotes.utils import cint
def execute():
import patches.september_2012.repost_stock
patches.september_2012.repost_stock.execute()
import patches.march_2013.p08_create_aii_accounts
patches.march_2013.p08_create_aii_accounts.execute()

View File

@@ -1,39 +0,0 @@
import webnotes
from webnotes.utils import cint
def execute():
import patches.september_2012.repost_stock
patches.september_2012.repost_stock.execute()
import patches.march_2013.p08_create_aii_accounts
patches.march_2013.p08_create_aii_accounts.execute()
copy_perpetual_accounting_settings()
set_missing_cost_center()
def set_missing_cost_center():
reload_docs = [
["stock", "doctype", "serial_no"],
["stock", "doctype", "stock_reconciliation"],
["stock", "doctype", "stock_entry"]
]
for d in reload_docs:
webnotes.reload_doc(d[0], d[1], d[2])
if cint(webnotes.defaults.get_global_default("perpetual_accounting")):
for dt in ["Serial No", "Stock Reconciliation", "Stock Entry"]:
webnotes.conn.sql("""update `tab%s` t1, tabCompany t2
set t1.cost_center=t2.cost_center where t1.company = t2.name""" % dt)
def copy_perpetual_accounting_settings():
webnotes.reload_doc("accounts", "doctype", "accounts_settings")
aii_enabled = cint(webnotes.conn.get_value("Global Defaults", None,
"auto_inventory_accounting"))
if aii_enabled:
try:
bean= webnotes.bean("Account Settings")
bean.doc.perpetual_accounting = aii_enabled
bean.save()
except:
pass

View File

@@ -1,28 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
import webnotes
from webnotes.utils import cint
from accounts.utils import create_stock_in_hand_jv
def execute():
webnotes.conn.auto_commit_on_many_writes = True
aii_enabled = cint(webnotes.defaults.get_global_default("perpetual_accounting"))
if aii_enabled:
create_stock_in_hand_jv(reverse = True)
webnotes.conn.sql("""update `tabPurchase Invoice Item` pi_item
set conversion_factor = (select ifnull(if(conversion_factor=0, 1, conversion_factor), 1)
from `tabUOM Conversion Detail`
where parent = pi_item.item_code and uom = pi_item.uom limit 1
)
where ifnull(conversion_factor, 0)=0""")
if aii_enabled:
create_stock_in_hand_jv()
webnotes.conn.auto_commit_on_many_writes = False

View File

@@ -6,7 +6,7 @@ import webnotes
from webnotes.utils import cint
def execute():
aii_enabled = cint(webnotes.defaults.get_global_default("perpetual_accounting"))
aii_enabled = cint(webnotes.defaults.get_global_default("auto_accounting_for_stock"))
if aii_enabled:
webnotes.conn.sql("""update `tabGL Entry` gle set is_cancelled = 'Yes'

View File

@@ -201,7 +201,6 @@ patch_list = [
"patches.april_2013.rebuild_sales_browser",
"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",