Merge remote-tracking branch 'frappe/develop' into v5.0

Conflicts:
	erpnext/__version__.py
	erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py
	erpnext/accounts/doctype/chart_of_accounts/charts/account_properties.py
	erpnext/hooks.py
	erpnext/patches.txt
	erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
	erpnext/stock/get_item_details.py
	erpnext/translations/ar.csv
	erpnext/translations/bs.csv
	erpnext/translations/ca.csv
	erpnext/translations/el.csv
	erpnext/translations/es.csv
	erpnext/translations/fr.csv
	erpnext/translations/hr.csv
	erpnext/translations/id.csv
	erpnext/translations/is.csv
	erpnext/translations/ja.csv
	erpnext/translations/nl.csv
	erpnext/translations/pl.csv
	erpnext/translations/pt-BR.csv
	erpnext/translations/ru.csv
	erpnext/translations/tr.csv
	erpnext/translations/zh-cn.csv
	erpnext/translations/zh-tw.csv
	setup.py
This commit is contained in:
Anand Doshi 2015-02-24 18:12:17 +05:30
commit d35354cc06
84 changed files with 115 additions and 27 deletions

View File

@ -1 +1,2 @@
from __future__ import unicode_literals
__version__ = '5.0.0-alpha'

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest, json, copy

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
from frappe.desk.moduleview import add_setup_section

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
from frappe import _
def get_data():

View File

@ -215,6 +215,7 @@ class SellingController(StockController):
'qty': d.qty,
'reserved_qty': reserved_qty_for_main_item,
'uom': d.stock_uom,
'stock_uom': d.stock_uom,
'batch_no': cstr(d.get("batch_no")).strip(),
'serial_no': cstr(d.get("serial_no")).strip(),
'name': d.name

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.permissions

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
app_name = "erpnext"
app_title = "ERPNext"
app_publisher = "Web Notes Technologies Pvt. Ltd. and Contributors"

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
test_ignore = ["Leave Block List"]

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Leave Allocation')

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -374,30 +374,23 @@ def get_bom_items_as_dict(bom, qty=1, fetch_exploded=1):
item.expense_account as expense_account,
item.buying_cost_center as cost_center
from
`tab%(table)s` bom_item, `tabBOM` bom, `tabItem` item
`tab{table}` bom_item, `tabBOM` bom, `tabItem` item
where
bom_item.parent = bom.name
and bom_item.docstatus < 2
and bom_item.parent = "%(bom)s"
and bom_item.parent = %(bom)s
and item.name = bom_item.item_code
%(conditions)s
{conditions}
group by item_code, stock_uom"""
if fetch_exploded:
items = frappe.db.sql(query % {
"qty": qty,
"table": "BOM Explosion Item",
"bom": bom,
"conditions": """and ifnull(item.is_pro_applicable, 'No') = 'No'
and ifnull(item.is_sub_contracted_item, 'No') = 'No' """
}, as_dict=True)
query = query.format(table="BOM Explosion Item",
conditions="""and ifnull(item.is_pro_applicable, 'No') = 'No'
and ifnull(item.is_sub_contracted_item, 'No') = 'No' """)
items = frappe.db.sql(query, { "qty": qty, "bom": bom }, as_dict=True)
else:
items = frappe.db.sql(query % {
"qty": qty,
"table": "BOM Item",
"bom": bom,
"conditions": ""
}, as_dict=True)
query = query.format(table="BOM Item", conditions="")
items = frappe.db.sql(query, { "qty": qty, "bom": bom }, as_dict=True)
# make unique
for item in items:

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -105,6 +105,7 @@ erpnext.patches.v4_2.party_model
erpnext.patches.v4_1.fix_jv_remarks
erpnext.patches.v4_2.update_landed_cost_voucher
erpnext.patches.v4_2.set_item_has_batch
erpnext.patches.v4_2.update_stock_uom_for_dn_in_sle
erpnext.patches.v5_0.recalculate_total_amount_in_jv
erpnext.patches.v5_0.remove_shopping_cart_app
erpnext.patches.v5_0.update_companywise_payment_account

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe
def execute():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe
def execute():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe
import frappe.model

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe
from frappe.templates.pages.style_settings import default_properties

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe
def execute():

View File

@ -1,3 +1,4 @@
from __future__ import unicode_literals
import frappe
def execute():

View File

@ -0,0 +1,11 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("""update `tabStock Ledger Entry` sle, tabItem item
set sle.stock_uom = item.stock_uom
where sle.voucher_type="Delivery Note" and item.name = sle.item_code
and sle.stock_uom != item.stock_uom""")

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
def execute():
from frappe.installer import remove_from_installed_apps

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.utils import flt

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt

View File

@ -94,6 +94,9 @@ class AuthorizationControl(TransactionBase):
self.validate_auth_rule(doctype_name, auth_value, based_on, add_cond, company)
def validate_approving_authority(self, doctype_name,company, total, doc_obj = ''):
if not frappe.db.count("Authorization Rule"):
return
av_dis = 0
if doc_obj:
price_list_rate, base_rate = 0, 0

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
test_ignore = ["Account", "Cost Center"]

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
test_ignore = ["Price List"]

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
test_dependencies = ["Employee"]

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.exceptions import ValidationError

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe

View File

@ -175,6 +175,12 @@ def get_basic_details(args, item):
"discount_percentage": 0.0
})
# if default specified in item is for another company, fetch from company
for d in [["Account", "income_account", "default_income_account"], ["Account", "expense_account", "default_expense_account"],
["Cost Center", "cost_center", "cost_center"], ["Warehouse", "warehouse", ""]]:
if not out[d[1]] or args.company != frappe.db.get_value(d[0], out.get(d[1]), "company"):
out[d[1]] = frappe.db.get_value("Company", args.company, d[2]) if d[2] else None
for fieldname in ("item_name", "item_group", "barcode", "brand", "stock_uom"):
out[fieldname] = item.get(fieldname)
@ -183,20 +189,17 @@ def get_basic_details(args, item):
def get_default_income_account(args, item):
return (item.income_account
or args.income_account
or frappe.db.get_value("Item Group", item.item_group, "default_income_account")
or frappe.db.get_value("Company", args.company, "default_income_account"))
or frappe.db.get_value("Item Group", item.item_group, "default_income_account"))
def get_default_expense_account(args, item):
return (item.expense_account
or args.expense_account
or frappe.db.get_value("Item Group", item.item_group, "default_expense_account")
or frappe.db.get_value("Company", args.company, "default_expense_account"))
or frappe.db.get_value("Item Group", item.item_group, "default_expense_account"))
def get_default_cost_center(args, item):
return (frappe.db.get_value("Project", args.get("project_name"), "cost_center")
or (item.selling_cost_center if args.get("transaction_type") == "selling" else item.buying_cost_center)
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
or frappe.db.get_value("Company", args.get("company"), "cost_center"))
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center"))
def get_price_list_rate(args, item_doc, out):
meta = frappe.get_meta(args.parenttype)

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _

View File

@ -22,7 +22,7 @@ def execute(filters=None):
item_map[item]["item_group"],
item_map[item]["brand"],
item_map[item]["description"], wh,
qty_dict.uom, qty_dict.opening_qty,
item_map[item]["stock_uom"], qty_dict.opening_qty,
qty_dict.opening_val, qty_dict.in_qty,
qty_dict.in_val, qty_dict.out_qty,
qty_dict.out_val, qty_dict.bal_qty,
@ -36,7 +36,7 @@ def get_columns(filters):
"""return columns based on filters"""
columns = ["Item:Link/Item:100", "Item Name::150", "Item Group::100", "Brand::90", \
"Description::140", "Warehouse:Link/Warehouse:100", "Stock UOM::90", "Opening Qty:Float:100", \
"Description::140", "Warehouse:Link/Warehouse:100", "Stock UOM:Link/UOM:90", "Opening Qty:Float:100", \
"Opening Value:Float:110", "In Qty:Float:80", "In Value:Float:80", "Out Qty:Float:80", \
"Out Value:Float:80", "Balance Qty:Float:100", "Balance Value:Float:100", \
"Valuation Rate:Float:90", "Company:Link/Company:100"]
@ -62,7 +62,7 @@ def get_conditions(filters):
def get_stock_ledger_entries(filters):
conditions = get_conditions(filters)
return frappe.db.sql("""select item_code, warehouse, posting_date, actual_qty, valuation_rate,
stock_uom, company, voucher_type, qty_after_transaction, stock_value_difference
company, voucher_type, qty_after_transaction, stock_value_difference
from `tabStock Ledger Entry`
where docstatus < 2 %s order by posting_date, posting_time, name""" %
conditions, as_dict=1)
@ -81,7 +81,6 @@ def get_item_warehouse_map(filters):
"val_rate": 0.0, "uom": None
}))
qty_dict = iwb_map[d.company][d.item_code][d.warehouse]
qty_dict.uom = d.stock_uom
if d.voucher_type == "Stock Reconciliation":
qty_diff = flt(d.qty_after_transaction) - qty_dict.bal_qty
@ -109,7 +108,7 @@ def get_item_warehouse_map(filters):
def get_item_details(filters):
item_map = {}
for d in frappe.db.sql("select name, item_name, item_group, brand, \
for d in frappe.db.sql("select name, item_name, stock_uom, item_group, brand, \
description from tabItem", as_dict=1):
item_map.setdefault(d.name, d)

View File

@ -1,6 +1,7 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import json

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from __future__ import unicode_literals

View File

@ -1,5 +1,6 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe