mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 12:49:10 +00:00
[minor] fixed conflict while merging perpetual branch into master
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import webnotes
|
||||
from webnotes.utils import cint
|
||||
|
||||
def execute():
|
||||
import patches.march_2013.p08_create_aii_accounts
|
||||
patches.march_2013.p08_create_aii_accounts.execute()
|
||||
11
patches/august_2013/p06_deprecate_is_cancelled.py
Normal file
11
patches/august_2013/p06_deprecate_is_cancelled.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import webnotes
|
||||
def execute():
|
||||
webnotes.reload_doc("stock", "doctype", "stock_ledger_entry")
|
||||
webnotes.reload_doc("stock", "doctype", "serial_no")
|
||||
webnotes.reload_doc("stock", "report", "stock_ledger")
|
||||
|
||||
webnotes.conn.sql("""delete from `tabStock Ledger Entry`
|
||||
where ifnull(is_cancelled, 'No') = 'Yes'""")
|
||||
|
||||
webnotes.reload_doc("accounts", "doctype", "gl_entry")
|
||||
webnotes.conn.sql("""delete from `tabGL Entry` where ifnull(is_cancelled, 'No') = 'Yes'""")
|
||||
@@ -6,7 +6,6 @@ import webnotes
|
||||
def execute():
|
||||
from_global_defaults = {
|
||||
"credit_controller": "Accounts Settings",
|
||||
"auto_inventory_accounting": "Accounts Settings",
|
||||
"acc_frozen_upto": "Accounts Settings",
|
||||
"bde_auth_role": "Accounts Settings",
|
||||
"auto_indent": "Stock Settings",
|
||||
|
||||
@@ -1,33 +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 now_datetime
|
||||
|
||||
def execute():
|
||||
webnotes.reload_doc("stock", "doctype", "delivery_note_item")
|
||||
webnotes.reload_doc("accounts", "doctype", "sales_invoice_item")
|
||||
|
||||
webnotes.conn.auto_commit_on_many_writes = True
|
||||
for company in webnotes.conn.sql("select name from `tabCompany`"):
|
||||
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`
|
||||
where ifnull(`is_cancelled`, "No") = "No" and company = %s
|
||||
order by item_code desc, warehouse desc,
|
||||
posting_date desc, posting_time desc, name desc""", company[0], as_dict=True)
|
||||
|
||||
dn_list = webnotes.conn.sql("""select name from `tabDelivery Note`
|
||||
where docstatus < 2 and company = %s""", company[0])
|
||||
|
||||
for dn in dn_list:
|
||||
dn = webnotes.get_obj("Delivery Note", dn[0], with_children = 1)
|
||||
dn.set_buying_amount(stock_ledger_entries)
|
||||
|
||||
si_list = webnotes.conn.sql("""select name from `tabSales Invoice`
|
||||
where docstatus < 2 and company = %s""", company[0])
|
||||
for si in si_list:
|
||||
si = webnotes.get_obj("Sales Invoice", si[0], with_children = 1)
|
||||
si.set_buying_amount(stock_ledger_entries)
|
||||
|
||||
webnotes.conn.auto_commit_on_many_writes = False
|
||||
@@ -8,7 +8,6 @@ def execute():
|
||||
create_chart_of_accounts_if_not_exists()
|
||||
add_group_accounts()
|
||||
add_ledger_accounts()
|
||||
add_aii_cost_center()
|
||||
set_default_accounts()
|
||||
|
||||
def set_default_accounts():
|
||||
@@ -45,7 +44,6 @@ def add_group_accounts():
|
||||
|
||||
def add_ledger_accounts():
|
||||
accounts_to_add = [
|
||||
["Stock In Hand", "Stock Assets", "Ledger", ""],
|
||||
["Cost of Goods Sold", "Stock Expenses", "Ledger", "Expense Account"],
|
||||
["Stock Adjustment", "Stock Expenses", "Ledger", "Expense Account"],
|
||||
["Expenses Included In Valuation", "Stock Expenses", "Ledger", "Expense Account"],
|
||||
@@ -79,26 +77,7 @@ def add_accounts(accounts_to_add, check_fn=None):
|
||||
"company": company
|
||||
})
|
||||
account.insert()
|
||||
|
||||
def add_aii_cost_center():
|
||||
for company, abbr in webnotes.conn.sql("""select name, abbr from `tabCompany`"""):
|
||||
if not webnotes.conn.sql("""select name from `tabCost Center` where cost_center_name =
|
||||
'Auto Inventory Accounting' and company = %s""", company):
|
||||
parent_cost_center = webnotes.conn.get_value("Cost Center",
|
||||
{"parent_cost_center['']": '', "company": company})
|
||||
|
||||
if not parent_cost_center:
|
||||
webnotes.errprint("Company " + company + "does not have a root cost center")
|
||||
continue
|
||||
|
||||
cc = webnotes.bean({
|
||||
"doctype": "Cost Center",
|
||||
"cost_center_name": "Auto Inventory Accounting",
|
||||
"parent_cost_center": parent_cost_center,
|
||||
"group_or_ledger": "Ledger",
|
||||
"company": company
|
||||
})
|
||||
cc.insert()
|
||||
|
||||
|
||||
def create_chart_of_accounts_if_not_exists():
|
||||
for company in webnotes.conn.sql("select name from `tabCompany`"):
|
||||
|
||||
@@ -1,29 +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.conn.get_value("Global Defaults", None,
|
||||
"auto_inventory_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
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@ import webnotes
|
||||
from webnotes.utils import cint
|
||||
|
||||
def execute():
|
||||
aii_enabled = cint(webnotes.conn.get_value("Global Defaults", None,
|
||||
"auto_inventory_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'
|
||||
|
||||
@@ -146,7 +146,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",
|
||||
@@ -194,12 +193,15 @@ patch_list = [
|
||||
"patches.july_2013.p10_change_partner_user_to_website_user",
|
||||
"patches.july_2013.p11_update_price_list_currency",
|
||||
"execute:webnotes.bean('Selling Settings').save() #2013-07-29",
|
||||
"patches.august_2013.p01_auto_accounting_for_stock_patch",
|
||||
"patches.august_2013.p01_hr_settings",
|
||||
"patches.august_2013.p02_rename_price_list",
|
||||
"patches.august_2013.p03_pos_setting_replace_customer_account",
|
||||
"patches.august_2013.p05_update_serial_no_status",
|
||||
"patches.august_2013.p05_employee_birthdays",
|
||||
"execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-08-16",
|
||||
"execute:webnotes.delete_doc('DocType', 'Stock Ledger')",
|
||||
"patches.august_2013.p06_deprecate_is_cancelled",
|
||||
"patches.august_2013.p06_fix_sle_against_stock_entry",
|
||||
"patches.september_2013.p01_add_user_defaults_from_pos_setting",
|
||||
"execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-09-02",
|
||||
@@ -208,6 +210,8 @@ patch_list = [
|
||||
"execute:webnotes.reload_doc('setup', 'doctype', 'features_setup') # 2013-09-05",
|
||||
"patches.september_2013.p02_fix_serial_no_status",
|
||||
"patches.september_2013.p03_modify_item_price_include_in_price_list",
|
||||
"patches.august_2013.p06_deprecate_is_cancelled",
|
||||
"execute:webnotes.delete_doc('DocType', 'Budget Control')",
|
||||
"patches.september_2013.p03_update_stock_uom_in_sle",
|
||||
"patches.september_2013.p03_move_website_to_framework",
|
||||
"execute:webnotes.bean('Style Settings').save() #2013-09-19",
|
||||
|
||||
Reference in New Issue
Block a user