Merge pull request #5080 from nabinhait/fy_overlap
[fix] Added overlap validation in fiscal year
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index ce03877..8fc7b55 100644
--- a/erpnext/accounts/doctype/account/account.json
+++ b/erpnext/accounts/doctype/account/account.json
@@ -17,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -41,6 +42,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -64,6 +66,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Account Name",
@@ -90,6 +93,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Group",
@@ -114,6 +118,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
@@ -140,6 +145,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Root Type",
@@ -164,6 +170,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Report Type",
@@ -189,6 +196,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Currency",
@@ -214,6 +222,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -237,6 +246,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Parent Account",
@@ -264,6 +274,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Account Type",
@@ -271,7 +282,7 @@
"no_copy": 0,
"oldfieldname": "account_type",
"oldfieldtype": "Select",
- "options": "\nBank\nCash\nDepreciation\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nRound Off\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary",
+ "options": "\nAccumulated Depreciation\nBank\nCash\nChargeable\nCost of Goods Sold\nDepreciation\nEquity\nExpense Account\nExpenses Included In Valuation\nFixed Asset\nIncome Account\nPayable\nReceivable\nRound Off\nStock\nStock Adjustment\nStock Received But Not Billed\nTax\nTemporary\nWarehouse",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
@@ -291,6 +302,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Rate",
@@ -317,6 +329,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Frozen",
@@ -343,6 +356,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse",
@@ -367,6 +381,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Balance must be",
@@ -391,6 +406,7 @@
"fieldtype": "Int",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Lft",
@@ -414,6 +430,7 @@
"fieldtype": "Int",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Rgt",
@@ -437,6 +454,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Old Parent",
@@ -463,7 +481,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-12-12 10:19:54.365839",
+ "modified": "2016-03-31 05:15:51.062604",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
@@ -572,5 +590,7 @@
],
"read_only": 0,
"read_only_onload": 0,
- "search_fields": ""
+ "search_fields": "",
+ "sort_order": "ASC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
index 532a015..ee1d007 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
@@ -53,7 +53,9 @@
_("Plant and Machinery"): {
"account_type": "Fixed Asset"
},
- _("Accumulated Depreciations"): {}
+ _("Accumulated Depreciation"): {
+ "account_type": "Accumulated Depreciation"
+ }
},
_("Investments"): {
"is_group": 1
@@ -89,7 +91,7 @@
"account_type": "Expense Account"
},
_("Depreciation"): {
- "account_type": "Expense Account"
+ "account_type": "Depreciation"
},
_("Entertainment Expenses"): {
"account_type": "Expense Account"
diff --git a/erpnext/accounts/doctype/asset/asset.json b/erpnext/accounts/doctype/asset/asset.json
index bf46074..b23b472 100644
--- a/erpnext/accounts/doctype/asset/asset.json
+++ b/erpnext/accounts/doctype/asset/asset.json
@@ -108,7 +108,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -576,14 +576,14 @@
],
"hide_heading": 0,
"hide_toolbar": 0,
- "idx": 0,
+ "idx": 72,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-30 05:25:56.710106",
+ "modified": "2016-03-31 05:02:49.890116",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset",
@@ -609,26 +609,6 @@
"share": 1,
"submit": 1,
"write": 1
- },
- {
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
- "write": 1
}
],
"read_only": 0,
diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/asset/asset.py
index d6547a6..3b141f6 100644
--- a/erpnext/accounts/doctype/asset/asset.py
+++ b/erpnext/accounts/doctype/asset/asset.py
@@ -10,60 +10,60 @@
class Asset(Document):
def validate(self):
- self.set_status()
+ self.status = self.get_status()
self.validate_fixed_asset_item()
self.validate_asset_values()
self.set_depreciation_settings()
self.make_depreciation_schedule()
self.validate_depreciation_settings_in_company()
-
+
def on_submit(self):
self.set_status()
-
+
def on_cancel(self):
self.validate_cancellation()
self.delete_depreciation_entries()
self.set_status()
-
+
def validate_fixed_asset_item(self):
item = frappe.get_doc("Item", self.item_code)
if item.disabled:
frappe.throw(_("Item {0} has been disabled").format(self.item_code))
if item.is_stock_item:
frappe.throw(_("Item {0} must be a non-stock item").format(self.item_code))
-
+
def validate_asset_values(self):
if flt(self.expected_value_after_useful_life) >= flt(self.gross_purchase_amount):
frappe.throw(_("Expected Value After Useful Life must be less than Gross Purchase Amount"))
-
+
if not flt(self.gross_purchase_amount):
frappe.throw(_("Gross Purchase Amount is mandatory"), frappe.MandatoryError)
-
+
if not self.current_value and self.next_depreciation_date:
self.current_value = flt(self.gross_purchase_amount)
else:
if flt(self.current_value) > flt(self.gross_purchase_amount):
frappe.throw(_("Current Value After Depreciation must be less than equal to {0}")
.format(flt(self.gross_purchase_amount)))
-
+
def set_depreciation_settings(self):
asset_category = frappe.get_doc("Asset Category", self.asset_category)
-
+
for field in ("depreciation_method", "number_of_depreciations", "number_of_months_in_a_period"):
if not self.get(field):
self.set(field, asset_category.get(field))
-
+
def make_depreciation_schedule(self):
self.schedules = []
if not self.get("schedules") and self.next_depreciation_date:
accumulated_depreciation = 0
value_after_depreciation = flt(self.current_value)
for n in xrange(self.number_of_depreciations):
- schedule_date = add_months(self.next_depreciation_date,
+ schedule_date = add_months(self.next_depreciation_date,
n * cint(self.number_of_months_in_a_period))
-
+
depreciation_amount = self.get_depreciation_amount(value_after_depreciation)
-
+
self.append("schedules", {
"schedule_date": schedule_date,
"depreciation_amount": depreciation_amount,
@@ -71,10 +71,10 @@
})
accumulated_depreciation += flt(depreciation_amount)
value_after_depreciation -= flt(depreciation_amount)
-
+
def get_depreciation_amount(self, depreciable_value):
if self.depreciation_method == "Straight Line":
- depreciation_amount = (flt(self.current_value) -
+ depreciation_amount = (flt(self.current_value) -
flt(self.expected_value_after_useful_life)) / cint(self.number_of_depreciations)
else:
factor = 200.0 / cint(self.number_of_depreciations)
@@ -85,45 +85,51 @@
depreciation_amount = flt(depreciable_value) - flt(self.expected_value_after_useful_life)
return depreciation_amount
-
+
def validate_cancellation(self):
if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):
frappe.throw(_("Asset cannot be cancelled, as it is already {0}").format(self.status))
-
+
if self.purchase_invoice:
frappe.throw(_("Please cancel Purchase Invoice {0} first").format(self.purchase_invoice))
-
+
def delete_depreciation_entries(self):
total_depreciation_amount = 0
for d in self.get("schedules"):
if d.journal_entry:
frappe.get_doc("Journal Entry", d.journal_entry).cancel()
-
+
d.db_set("journal_entry", None)
total_depreciation_amount += flt(d.depreciation_amount)
self.db_set("current_value", (self.current_value + total_depreciation_amount))
-
+
def validate_depreciation_settings_in_company(self):
company = frappe.get_doc("Company", self.company)
- for field in ("accumulated_depreciation_account", "depreciation_expense_account",
+ for field in ("accumulated_depreciation_account", "depreciation_expense_account",
"disposal_account", "depreciation_cost_center"):
if not company.get(field):
frappe.throw(_("Please set {0} in Company {1}")
.format(company.meta.get_label(field), self.company))
-
- def set_status(self, status=None):
- if not status:
- if self.docstatus == 0:
- status = "Draft"
- elif self.docstatus == 1:
- status = "Submitted"
- if self.journal_entry_for_scrap:
- status = "Scrapped"
- elif flt(self.current_value) <= flt(self.expected_value_after_useful_life):
- status = "Fully Depreciated"
- elif flt(self.current_value) < flt(self.gross_purchase_amount):
- status = 'Partially Depreciated'
- elif self.docstatus == 2:
- status = "Cancelled"
- self.db_set("status", status)
\ No newline at end of file
+ def set_status(self, status=None):
+ '''Set asset and update status'''
+ if not status:
+ status = self.get_status()
+ self.db_set("status", status)
+
+ def get_status(self):
+ '''Returns status based on whether it is draft, submitted, scrapped or depreciated'''
+ if self.docstatus == 0:
+ status = "Draft"
+ elif self.docstatus == 1:
+ status = "Submitted"
+ if self.journal_entry_for_scrap:
+ status = "Scrapped"
+ elif flt(self.current_value) <= flt(self.expected_value_after_useful_life):
+ status = "Fully Depreciated"
+ elif flt(self.current_value) < flt(self.gross_purchase_amount):
+ status = 'Partially Depreciated'
+ elif self.docstatus == 2:
+ status = "Cancelled"
+
+ return status
diff --git a/erpnext/accounts/doctype/asset/depreciation.py b/erpnext/accounts/doctype/asset/depreciation.py
index 993489c..95fbdbd 100644
--- a/erpnext/accounts/doctype/asset/depreciation.py
+++ b/erpnext/accounts/doctype/asset/depreciation.py
@@ -13,24 +13,24 @@
for asset in get_depreciable_assets(date):
make_depreciation_entry(asset, date)
frappe.db.commit()
-
+
def get_depreciable_assets(date):
return frappe.db.sql_list("""select a.name
from tabAsset a, `tabDepreciation Schedule` ds
- where a.name = ds.parent and a.docstatus=1 and ds.schedule_date<=%s
- and a.status in ('Submitted', 'Partially Depreciated')
+ where a.name = ds.parent and a.docstatus=1 and ds.schedule_date<=%s
+ and a.status in ('Submitted', 'Partially Depreciated')
and ifnull(ds.journal_entry, '')=''""", date)
def make_depreciation_entry(asset_name, date=None):
if not date:
date = today()
-
+
asset = frappe.get_doc("Asset", asset_name)
fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account = \
get_depreciation_accounts(asset)
-
+
depreciation_cost_center = frappe.db.get_value("Company", asset.company, "depreciation_cost_center")
-
+
for d in asset.get("schedules"):
if not d.journal_entry and getdate(d.schedule_date) <= getdate(date):
je = frappe.new_doc("Journal Entry")
@@ -38,14 +38,14 @@
je.posting_date = d.schedule_date
je.company = asset.company
je.remark = "Depreciation Entry against {0} worth {1}".format(asset_name, d.depreciation_amount)
-
+
je.append("accounts", {
"account": accumulated_depreciation_account,
"credit_in_account_currency": d.depreciation_amount,
"reference_type": "Asset",
"reference_name": asset.name
})
-
+
je.append("accounts", {
"account": depreciation_expense_account,
"debit_in_account_currency": d.depreciation_amount,
@@ -53,44 +53,48 @@
"reference_name": asset.name,
"cost_center": depreciation_cost_center
})
-
+
je.flags.ignore_permissions = True
je.submit()
-
+
d.db_set("journal_entry", je.name)
asset.current_value -= d.depreciation_amount
-
+
asset.db_set("current_value", asset.current_value)
asset.set_status()
-
+
def get_depreciation_accounts(asset):
- accounts = frappe.db.sql("""select fixed_asset_account, accumulated_depreciation_account,
- depreciation_expense_account from `tabAsset Category Account`
- where parent=%s and company=%s""", (asset.asset_category, asset.company), as_dict=1)[0]
-
+ accounts = frappe.get_all("Asset Category Account",
+ fields = ['fixed_asset_account', 'accumulated_depreciation_account',
+ 'depreciation_expense_account'],
+ filters={'parent': asset.asset_category, 'company_name': asset.company})
+
+ if accounts:
+ accounts = accounts[0]
+
fixed_asset_account = accounts.fixed_asset_account
accumulated_depreciation_account = accounts.accumulated_depreciation_account
depreciation_expense_account = accounts.depreciation_expense_account
-
+
if not accumulated_depreciation_account or not depreciation_expense_account:
- accounts = frappe.db.get_value("Company", asset.company,
+ accounts = frappe.db.get_value("Company", asset.company,
["accumulated_depreciation_account", "depreciation_expense_account"])
-
+
if not accumulated_depreciation_account:
accumulated_depreciation_account = accounts[0]
if not depreciation_expense_account:
depreciation_expense_account = accounts[1]
-
+
if not fixed_asset_account or not accumulated_depreciation_account or not depreciation_expense_account:
frappe.throw(_("Please set Depreciation related Accounts in Asset Category {0} or Company {1}")
.format(asset.asset_category, asset.company))
-
+
return fixed_asset_account, accumulated_depreciation_account, depreciation_expense_account
-
+
@frappe.whitelist()
def scrap_asset(asset_name):
asset = frappe.get_doc("Asset", asset_name)
-
+
if asset.docstatus != 1:
frappe.throw(_("Asset {0} must be submitted").format(asset.name))
elif asset.status in ("Cancelled", "Sold", "Scrapped"):
@@ -101,49 +105,49 @@
je.posting_date = today()
je.company = asset.company
je.remark = "Scrap Entry for asset {0}".format(asset_name)
-
+
for entry in get_gl_entries_on_asset_disposal(asset):
entry.update({
"reference_type": "Asset",
"reference_name": asset_name
})
je.append("accounts", entry)
-
+
je.flags.ignore_permissions = True
je.submit()
-
+
frappe.db.set_value("Asset", asset_name, "journal_entry_for_scrap", je.name)
asset.set_status("Scrapped")
-
+
@frappe.whitelist()
def restore_asset(asset_name):
asset = frappe.get_doc("Asset", asset_name)
-
+
je = asset.journal_entry_for_scrap
asset.db_set("journal_entry_for_scrap", None)
frappe.get_doc("Journal Entry", je).cancel()
-
+
asset.set_status()
-
+
@frappe.whitelist()
def get_gl_entries_on_asset_disposal(asset, selling_amount=0):
fixed_asset_account, accumulated_depr_account, depr_expense_account = get_depreciation_accounts(asset)
disposal_account, depreciation_cost_center = get_disposal_account_and_cost_center(asset.company)
accumulated_depr_amount = flt(asset.gross_purchase_amount) - flt(asset.current_value)
-
+
gl_entries = [
{
"account": fixed_asset_account,
"credit_in_account_currency": asset.gross_purchase_amount,
"credit": asset.gross_purchase_amount
- },
+ },
{
"account": accumulated_depr_account,
"debit_in_account_currency": accumulated_depr_amount,
"debit": accumulated_depr_amount
}
]
-
+
profit_amount = flt(selling_amount) - flt(asset.current_value)
if flt(asset.current_value) and profit_amount:
debit_or_credit = "debit" if profit_amount < 0 else "credit"
@@ -153,16 +157,16 @@
debit_or_credit: abs(profit_amount),
debit_or_credit + "_in_account_currency": abs(profit_amount)
})
-
+
return gl_entries
-
+
def get_disposal_account_and_cost_center(company):
- disposal_account, depreciation_cost_center = frappe.db.get_value("Company", company,
+ disposal_account, depreciation_cost_center = frappe.db.get_value("Company", company,
["disposal_account", "depreciation_cost_center"])
-
+
if not disposal_account:
frappe.throw(_("Please set 'Asset Disposal Account' in Company {0}").format(company))
if not depreciation_cost_center:
frappe.throw(_("Please set 'Asset Depreciation Cost Center' in Company {0}").format(company))
-
+
return disposal_account, depreciation_cost_center
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset/test_asset.py b/erpnext/accounts/doctype/asset/test_asset.py
index 9902034..7ea9e36 100644
--- a/erpnext/accounts/doctype/asset/test_asset.py
+++ b/erpnext/accounts/doctype/asset/test_asset.py
@@ -13,142 +13,142 @@
def setUp(self):
set_depreciation_settings_in_company()
create_asset()
-
+
def test_fixed_asset_must_be_non_stock_item(self):
item = frappe.get_doc("Item", "Macbook Pro")
item.is_stock_item = 1
self.assertRaises(frappe.ValidationError, item.save)
-
+
def test_schedule_for_straight_line_method(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
-
+
self.assertEqual(asset.status, "Draft")
-
+
expected_schedules = [
["2015-12-31", 30000, 30000],
["2016-03-31", 30000, 60000],
["2016-06-30", 30000, 90000]
]
-
- schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
+
+ schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
for d in asset.get("schedules")]
-
+
self.assertEqual(schedules, expected_schedules)
-
-
+
+
def test_schedule_for_double_declining_method(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
asset.depreciation_method = "Double Declining Balance"
asset.save()
-
+
expected_schedules = [
["2015-12-31", 66667, 66667],
["2016-03-31", 22222, 88889],
["2016-06-30", 1111, 90000]
]
-
- schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
+
+ schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
for d in asset.get("schedules")]
-
+
self.assertEqual(schedules, expected_schedules)
-
+
def test_depreciation(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
asset.submit()
asset.load_from_db()
self.assertEqual(asset.status, "Submitted")
-
+
post_depreciation_entries(date="2016-01-01")
asset.load_from_db()
-
+
self.assertEqual(asset.status, "Partially Depreciated")
-
+
expected_gle = (
("_Test Accumulated Depreciations - _TC", 0.0, 30000.0),
("_Test Depreciations - _TC", 30000.0, 0.0)
)
-
- gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
+
+ gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
where against_voucher_type='Asset' and against_voucher = %s
order by account""", asset.name)
-
+
self.assertEqual(gle, expected_gle)
self.assertEqual(asset.get("current_value"), 70000)
-
-
+
+
def test_scrap_asset(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
asset.submit()
post_depreciation_entries(date="2016-01-01")
-
+
scrap_asset("Macbook Pro 1")
-
+
asset.load_from_db()
self.assertEqual(asset.status, "Scrapped")
self.assertTrue(asset.journal_entry_for_scrap)
-
+
expected_gle = (
("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
("_Test Fixed Asset - _TC", 0.0, 100000.0),
("_Test Gain/Loss on Asset Disposal - _TC", 70000.0, 0.0)
)
-
- gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
+
+ gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
where voucher_type='Journal Entry' and voucher_no = %s
order by account""", asset.journal_entry_for_scrap)
-
+
self.assertEqual(gle, expected_gle)
-
+
restore_asset("Macbook Pro 1")
-
+
asset.load_from_db()
self.assertFalse(asset.journal_entry_for_scrap)
self.assertEqual(asset.status, "Partially Depreciated")
-
+
def test_asset_sale(self):
frappe.get_doc("Asset", "Macbook Pro 1").submit()
post_depreciation_entries(date="2016-01-01")
-
+
si = create_sales_invoice(item_code="Macbook Pro", rate=25000, do_not_save=True)
si.get("items")[0].asset = "Macbook Pro 1"
si.submit()
-
+
self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Sold")
-
+
expected_gle = (
("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
("_Test Fixed Asset - _TC", 0.0, 100000.0),
("_Test Gain/Loss on Asset Disposal - _TC", 45000.0, 0.0),
("Debtors - _TC", 25000.0, 0.0)
)
-
- gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
+
+ gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
where voucher_type='Sales Invoice' and voucher_no = %s
order by account""", si.name)
-
+
self.assertEqual(gle, expected_gle)
-
+
si.cancel()
-
+
self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Partially Depreciated")
-
+
def tearDown(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
-
+
if asset.docstatus == 1 and asset.status not in ("Scrapped", "Sold", "Draft", "Cancelled"):
asset.cancel()
-
+
self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Cancelled")
-
+
frappe.delete_doc("Asset", "Macbook Pro 1")
def create_asset():
if not frappe.db.exists("Asset Category", "Computers"):
create_asset_category()
-
+
if not frappe.db.exists("Item", "Macbook Pro"):
create_fixed_asset_item()
-
+
asset = frappe.get_doc({
"doctype": "Asset",
"asset_name": "Macbook Pro 1",
@@ -164,9 +164,9 @@
asset.save()
except frappe.DuplicateEntryError:
pass
-
+
return asset
-
+
def create_asset_category():
asset_category = frappe.new_doc("Asset Category")
asset_category.asset_category_name = "Computers"
@@ -179,7 +179,7 @@
"depreciation_expense_account": "_Test Depreciations - _TC"
})
asset_category.insert()
-
+
def create_fixed_asset_item():
try:
frappe.get_doc({
@@ -189,12 +189,11 @@
"description": "Macbook Pro Retina Display",
"item_group": "All Item Groups",
"stock_uom": "Nos",
- "is_fixed_asset": 1,
"is_stock_item": 0
}).insert()
except frappe.DuplicateEntryError:
pass
-
+
def set_depreciation_settings_in_company():
company = frappe.get_doc("Company", "_Test Company")
company.accumulated_depreciation_account = "_Test Accumulated Depreciations - _TC"
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.js b/erpnext/accounts/doctype/asset_category/asset_category.js
index 862a202..3130f6b 100644
--- a/erpnext/accounts/doctype/asset_category/asset_category.js
+++ b/erpnext/accounts/doctype/asset_category/asset_category.js
@@ -1,36 +1,44 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
-cur_frm.fields_dict['accounts'].grid.get_field('fixed_asset_account').get_query = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- return {
- "filters": {
- "account_type": "Fixed Asset",
- "root_type": "Asset",
- "is_group": 0,
- "company": d.company
- }
- };
-}
+frappe.ui.form.on('Asset Category', {
+ onload: function(frm) {
+ frm.add_fetch('company_name', 'accumulated_depreciation_account', 'accumulated_depreciation_account');
+ frm.add_fetch('company_name', 'depreciation_expense_account', 'depreciation_expense_account');
-cur_frm.fields_dict['accounts'].grid.get_field('accumulated_depreciation_account').get_query = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- return {
- "filters": {
- "root_type": "Asset",
- "is_group": 0,
- "company": d.company
- }
- };
-}
+ frm.set_query('fixed_asset_account', 'accounts', function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ return {
+ "filters": {
+ "account_type": "Fixed Asset",
+ "root_type": "Asset",
+ "is_group": 0,
+ "company": d.company
+ }
+ };
+ });
-cur_frm.fields_dict['accounts'].grid.get_field('depreciation_expense_account').get_query = function(doc, cdt, cdn) {
- var d = locals[cdt][cdn];
- return {
- "filters": {
- "root_type": "Expense",
- "is_group": 0,
- "company": d.company
- }
- };
-}
\ No newline at end of file
+ frm.set_query('accumulated_depreciation_account', 'accounts', function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ return {
+ "filters": {
+ "root_type": "Asset",
+ "is_group": 0,
+ "company": d.company
+ }
+ };
+ });
+
+ frm.set_query('depreciation_expense_account', 'accounts', function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ return {
+ "filters": {
+ "root_type": "Expense",
+ "is_group": 0,
+ "company": d.company
+ }
+ };
+ });
+
+ }
+});
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.json b/erpnext/accounts/doctype/asset_category/asset_category.json
index 0f0d330..741147b 100644
--- a/erpnext/accounts/doctype/asset_category/asset_category.json
+++ b/erpnext/accounts/doctype/asset_category/asset_category.json
@@ -181,7 +181,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -196,7 +196,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-30 05:25:38.518509",
+ "modified": "2016-03-31 05:37:48.481012",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Category",
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.py b/erpnext/accounts/doctype/asset_category/asset_category.py
index 7acd883..c863f54 100644
--- a/erpnext/accounts/doctype/asset_category/asset_category.py
+++ b/erpnext/accounts/doctype/asset_category/asset_category.py
@@ -9,7 +9,6 @@
class AssetCategory(Document):
def validate(self):
- for field in ("depreciation_method", "number_of_depreciations",
- "number_of_months_in_a_period", "accounts"):
- if not self.get(field):
- frappe.throw(_("{0} is mandatory").format(self.meta.get_label(field)), frappe.MandatoryError)
\ No newline at end of file
+ for field in ("number_of_depreciations", "number_of_months_in_a_period"):
+ if int(self.get(field))<1:
+ frappe.throw(_("{0} must be greater than 0").format(self.meta.get_label(field)))
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category_account/asset_category_account.json b/erpnext/accounts/doctype/asset_category_account/asset_category_account.json
index 5144e85..049b3e9 100644
--- a/erpnext/accounts/doctype/asset_category_account/asset_category_account.json
+++ b/erpnext/accounts/doctype/asset_category_account/asset_category_account.json
@@ -12,7 +12,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "company",
+ "fieldname": "company_name",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -122,7 +122,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-03-07 19:02:09.879979",
+ "modified": "2016-03-31 05:46:47.759015",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Category Account",
@@ -132,5 +132,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 0e47a75..29455d3 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -825,7 +825,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -2684,7 +2684,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file-text",
- "idx": 1,
+ "idx": 204,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2692,7 +2692,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-25 07:32:03.043734",
+ "modified": "2016-03-31 06:00:01.650702",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 7a3202f..230e4d2 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -1002,7 +1002,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -2686,14 +2686,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-file-text",
- "idx": 1,
+ "idx": 105,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-25 07:32:01.820327",
+ "modified": "2016-03-31 06:00:27.249960",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index c9bcc46..2564fbd 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -672,7 +672,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -1772,7 +1772,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-shopping-cart",
- "idx": 1,
+ "idx": 29,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -1780,7 +1780,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-25 07:32:02.711099",
+ "modified": "2016-03-31 06:01:49.420673",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py
index 42b847e..a036760 100644
--- a/erpnext/controllers/recurring_document.py
+++ b/erpnext/controllers/recurring_document.py
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
import frappe
+import calendar
import frappe.utils
import frappe.defaults
@@ -166,14 +167,24 @@
elif not (doc.from_date and doc.to_date):
frappe.throw(_("Period From and Period To dates mandatory for recurring {0}").format(doc.doctype))
-
+
def validate_recurring_next_date(doc):
posting_date = doc.get("posting_date") or doc.get("transaction_date")
if getdate(posting_date) > getdate(doc.next_date):
frappe.throw(_("Next Date must be greater than Posting Date"))
- if getdate(doc.next_date).day != doc.repeat_on_day_of_month:
- frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal"))
+ next_date = getdate(doc.next_date)
+ if next_date.day != doc.repeat_on_day_of_month:
+
+ # if the repeat day is the last day of the month (31)
+ # and the current month does not have as many days,
+ # then the last day of the current month is a valid date
+ lastday = calendar.monthrange(next_date.year, next_date.month)[1]
+ if doc.repeat_on_day_of_month < lastday:
+
+ # the specified day of the month is not same as the day specified
+ # or the last day of the month
+ frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal"))
def convert_to_recurring(doc, posting_date):
if doc.is_recurring:
@@ -181,13 +192,13 @@
doc.db_set("recurring_id", doc.name)
set_next_date(doc, posting_date)
-
+
if doc.next_date:
validate_recurring_next_date(doc)
-
+
elif doc.recurring_id:
doc.db_set("recurring_id", None)
-
+
def validate_notification_email_id(doc):
if doc.notify_by_email:
if doc.notification_email_address:
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index 6882034..fee39aa 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -239,7 +239,7 @@
def notify(self, args):
args = frappe._dict(args)
- from frappe.desk.page.messages.messages import post
+ from frappe.desk.page.chat.chat import post
post(**{"txt": args.message, "contact": args.message_to, "subject": args.subject,
"notify": cint(self.follow_via_email)})
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index d190f34..e4ac864 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -11,6 +11,57 @@
"project_name": frm.doc.name
}
}
+
+ frm.set_query('customer', 'erpnext.controllers.queries.customer_query');
+
+ // sales order
+ frm.set_query('sales_order', function() {
+ var filters = {
+ 'project': ["in", frm.doc.__islocal ? [""] : [frm.doc.name, ""]]
+ };
+
+ if (frm.doc.customer) {
+ filters["customer"] = frm.doc.customer;
+ }
+
+ return {
+ filters: filters
+ }
+ });
+ },
+ refresh: function(frm) {
+ if(frm.doc.__islocal) {
+ frm.web_link && frm.web_link.remove();
+ } else {
+ frm.add_web_link("/projects?project=" + encodeURIComponent(frm.doc.name));
+
+ if(frappe.model.can_read("Task")) {
+ frm.add_custom_button(__("Gantt Chart"), function() {
+ frappe.route_options = {"project": frm.doc.name,
+ "start": frm.doc.expected_start_date, "end": frm.doc.expected_end_date};
+ frappe.set_route("Gantt", "Task");
+ }, __("View"), true);
+ frm.add_custom_button(__("Tasks"), function() {
+ frappe.route_options = {"project": frm.doc.name}
+ frappe.set_route("List", "Task");
+ }, __("View"), true);
+ }
+
+ if(frappe.model.can_read("Time Log")) {
+ frm.add_custom_button(__("Time Logs"), function() {
+ frappe.route_options = {"project": frm.doc.name}
+ frappe.set_route("List", "Time Log");
+ }, __("View"), true);
+ }
+
+ if(frappe.model.can_read("Expense Claim")) {
+ frm.add_custom_button(__("Expense Claims"), function() {
+ frappe.route_options = {"project": frm.doc.name}
+ frappe.set_route("List", "Expense Claim");
+ }, __("View"), true);
+ }
+ }
+
}
});
@@ -23,51 +74,3 @@
}
})
-// show tasks
-cur_frm.cscript.refresh = function(doc) {
- if(!doc.__islocal) {
- if(frappe.model.can_read("Task")) {
- cur_frm.add_custom_button(__("Gantt Chart"), function() {
- frappe.route_options = {"project": doc.name, "start": doc.expected_start_date, "end": doc.expected_end_date};
- frappe.set_route("Gantt", "Task");
- }, __("View"), true);
- cur_frm.add_custom_button(__("Tasks"), function() {
- frappe.route_options = {"project": doc.name}
- frappe.set_route("List", "Task");
- }, __("View"), true);
- }
- if(frappe.model.can_read("Time Log")) {
- cur_frm.add_custom_button(__("Time Logs"), function() {
- frappe.route_options = {"project": doc.name}
- frappe.set_route("List", "Time Log");
- }, __("View"), true);
- }
-
- if(frappe.model.can_read("Expense Claim")) {
- cur_frm.add_custom_button(__("Expense Claims"), function() {
- frappe.route_options = {"project": doc.name}
- frappe.set_route("List", "Expense Claim");
- }, __("View"), true);
- }
- }
-}
-
-cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
- return{
- query: "erpnext.controllers.queries.customer_query"
- }
-}
-
-cur_frm.fields_dict['sales_order'].get_query = function(doc) {
- var filters = {
- 'project': ["in", doc.__islocal ? [""] : [doc.name, ""]]
- };
-
- if (doc.customer) {
- filters["customer"] = doc.customer;
- }
-
- return {
- filters: filters
- }
-}
diff --git a/erpnext/projects/doctype/project/project.json b/erpnext/projects/doctype/project/project.json
index 34bb36f..ada5909 100644
--- a/erpnext/projects/doctype/project/project.json
+++ b/erpnext/projects/doctype/project/project.json
@@ -352,6 +352,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "description": "Project will be accessible on the website to these users",
"fieldname": "users",
"fieldtype": "Table",
"hidden": 0,
@@ -965,14 +966,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-puzzle-piece",
- "idx": 1,
+ "idx": 24,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 4,
- "modified": "2016-03-25 06:46:29.485193",
+ "modified": "2016-03-31 01:34:05.703925",
"modified_by": "Administrator",
"module": "Projects",
"name": "Project",
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index edfd964..90a2cb2 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -37,7 +37,7 @@
self.sync_tasks()
self.tasks = []
self.send_welcome_email()
-
+
def validate_dates(self):
if self.expected_start_date and self.expected_end_date:
if getdate(self.expected_end_date) < getdate(self.expected_start_date):
@@ -124,7 +124,7 @@
from `tabPurchase Invoice Item` where project = %s and docstatus=1""", self.name)
self.total_purchase_cost = total_purchase_cost and total_purchase_cost[0][0] or 0
-
+
def send_welcome_email(self):
url = get_url("/project/{0}".format(self.name))
messages = (
@@ -143,7 +143,7 @@
print user.welcome_email_sent
frappe.sendmail(user.user, subject=_("Project Collaboration Invitation"), content=content.format(*messages), bulk=True)
user.welcome_email_sent=1
-
+
def get_project_list(doctype, txt, filters, limit_start, limit_page_length=20):
return frappe.db.sql('''select distinct project.*
@@ -163,7 +163,7 @@
return {
"title": _("My Projects"),
"get_list": get_project_list,
- "row_template": "templates/includes/project_row.html"
+ "row_template": "templates/includes/projects/project_row.html"
}
@frappe.whitelist()
diff --git a/erpnext/selling/doctype/installation_note/installation_note.json b/erpnext/selling/doctype/installation_note/installation_note.json
index 29e9a43..5062c4d 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.json
+++ b/erpnext/selling/doctype/installation_note/installation_note.json
@@ -578,7 +578,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -594,7 +594,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-03-03 02:27:41.801292",
+ "modified": "2016-03-31 06:03:07.972376",
"modified_by": "Administrator",
"module": "Selling",
"name": "Installation Note",
@@ -646,5 +646,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "customer",
- "title_field": "customer_name"
+ "title_field": "customer_name",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 7cfee77..5babcf9 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -713,7 +713,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
@@ -2121,7 +2121,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-shopping-cart",
- "idx": 1,
+ "idx": 82,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2129,7 +2129,7 @@
"istable": 0,
"max_attachments": 1,
"menu_index": 0,
- "modified": "2016-03-25 07:31:44.251525",
+ "modified": "2016-03-31 06:03:41.806264",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation",
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 6689d66..97a689a 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -30,16 +30,16 @@
self.validate_abbr()
self.validate_default_accounts()
self.validate_currency()
-
+
def validate_abbr(self):
self.abbr = self.abbr.strip()
-
+
if self.get('__islocal') and len(self.abbr) > 5:
frappe.throw(_("Abbreviation cannot have more than 5 characters"))
if not self.abbr.strip():
frappe.throw(_("Abbreviation is mandatory"))
-
+
if frappe.db.sql("select abbr from tabCompany where name!=%s and abbr=%s", (self.name, self.abbr)):
frappe.throw(_("Abbreviation already used for another company"))
@@ -111,6 +111,8 @@
self._set_default_account("default_cash_account", "Cash")
self._set_default_account("default_bank_account", "Bank")
self._set_default_account("round_off_account", "Round Off")
+ self._set_default_account("accumulated_depreciation_account", "Accumulated Depreciation")
+ self._set_default_account("depreciation_expense_account", "Depreciation")
if cint(frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock")):
self._set_default_account("stock_received_but_not_billed", "Stock Received But Not Billed")
@@ -159,6 +161,7 @@
frappe.db.set(self, "cost_center", _("Main") + " - " + self.abbr)
frappe.db.set(self, "round_off_cost_center", _("Main") + " - " + self.abbr)
+ frappe.db.set(self, "depreciation_cost_center", _("Main") + " - " + self.abbr)
def before_rename(self, olddn, newdn, merge=False):
if merge:
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index 9b0278d..a8308b2 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -191,15 +191,15 @@
frappe.set_user("test_cart_user@example.com")
def login_as_customer(self):
- self.create_user_if_not_exists("test_contact_customer@example.com")
+ self.create_user_if_not_exists("test_contact_customer@example.com",
+ "_Test Contact For _Test Customer")
frappe.set_user("test_contact_customer@example.com")
def remove_all_items_from_cart(self):
quotation = _get_cart_quotation()
- quotation.set("items", [])
- quotation.save(ignore_permissions=True)
+ quotation.delete()
- def create_user_if_not_exists(self, email):
+ def create_user_if_not_exists(self, email, first_name = None):
if frappe.db.exists("User", email):
return
@@ -208,7 +208,7 @@
"user_type": "Website User",
"email": email,
"send_welcome_email": 0,
- "first_name": email.split("@")[0]
+ "first_name": first_name or email.split("@")[0]
}).insert(ignore_permissions=True)
test_dependencies = ["Sales Taxes and Charges Template", "Price List", "Item Price", "Shipping Rule", "Currency Exchange",
diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json
index 8f552bf..c947b7b 100644
--- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json
+++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json
@@ -17,6 +17,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Company",
@@ -25,6 +26,7 @@
"options": "Company",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -40,6 +42,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Purchase Receipts",
@@ -48,9 +51,10 @@
"options": "Landed Cost Purchase Receipt",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -63,6 +67,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Items From Purchase Receipts",
@@ -70,6 +75,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -85,6 +91,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Purchase Receipt Items",
@@ -93,9 +100,10 @@
"options": "Landed Cost Item",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -108,6 +116,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Taxes and Charges",
@@ -116,6 +125,7 @@
"options": "Landed Cost Taxes and Charges",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -131,6 +141,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -139,6 +150,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -154,6 +166,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Total Taxes and Charges",
@@ -162,6 +175,7 @@
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 1,
@@ -177,6 +191,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -185,6 +200,7 @@
"options": "Landed Cost Voucher",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -200,6 +216,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -207,6 +224,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -223,6 +241,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Distribute Charges Based On",
@@ -232,6 +251,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -247,6 +267,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -254,6 +275,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -269,6 +291,7 @@
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Landed Cost Help",
@@ -277,6 +300,7 @@
"options": "",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -288,13 +312,14 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-usd",
+ "idx": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:49.180775",
+ "modified": "2016-03-31 06:04:21.629139",
"modified_by": "Administrator",
"module": "Stock",
"name": "Landed Cost Voucher",
@@ -325,5 +350,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json
index 7234522..dc72a2c 100644
--- a/erpnext/stock/doctype/material_request/material_request.json
+++ b/erpnext/stock/doctype/material_request/material_request.json
@@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
@@ -16,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -41,6 +43,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
@@ -65,6 +68,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Type",
@@ -89,6 +93,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -111,6 +116,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -137,6 +143,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -166,6 +173,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
@@ -194,6 +202,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -219,6 +228,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Items",
@@ -232,7 +242,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -245,6 +255,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
@@ -270,6 +281,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Requested For",
@@ -293,6 +305,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Transaction Date",
@@ -320,6 +333,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -345,6 +359,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Status",
@@ -374,6 +389,7 @@
"fieldtype": "Percent",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "% Ordered",
@@ -399,6 +415,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Printing Details",
@@ -423,6 +440,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Letter Head",
@@ -449,6 +467,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Print Heading",
@@ -474,6 +493,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Terms and Conditions",
@@ -499,6 +519,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Terms",
@@ -525,6 +546,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Terms and Conditions Content",
@@ -546,7 +568,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-ticket",
- "idx": 1,
+ "idx": 70,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -554,7 +576,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-01-19 06:56:12.592797",
+ "modified": "2016-03-31 06:01:35.169396",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request",
@@ -646,5 +668,6 @@
"search_fields": "status,transaction_date",
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "title"
+ "title_field": "title",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.json b/erpnext/stock/doctype/packing_slip/packing_slip.json
index 5a59d94..d8c7952 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.json
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.json
@@ -18,6 +18,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -25,6 +26,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -40,12 +42,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -62,6 +66,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Delivery Note",
@@ -70,6 +75,7 @@
"options": "Delivery Note",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -85,12 +91,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -106,6 +114,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
@@ -114,6 +123,7 @@
"options": "PS-",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -129,12 +139,14 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -150,12 +162,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -172,6 +186,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "From Package No.",
@@ -179,6 +194,7 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -195,12 +211,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -217,6 +235,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "To Package No.",
@@ -224,6 +243,7 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -240,6 +260,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -247,6 +268,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -262,6 +284,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Items",
@@ -269,6 +292,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -284,6 +308,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Items",
@@ -292,9 +317,10 @@
"options": "Packing Slip Item",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -307,6 +333,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Package Weight Details",
@@ -314,6 +341,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -330,6 +358,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Net Weight",
@@ -337,6 +366,7 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -352,6 +382,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Net Weight UOM",
@@ -360,6 +391,7 @@
"options": "UOM",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -375,12 +407,14 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -397,6 +431,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Gross Weight",
@@ -404,6 +439,7 @@
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -419,6 +455,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Gross Weight UOM",
@@ -427,6 +464,7 @@
"options": "UOM",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -442,6 +480,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Letter Head",
@@ -450,6 +489,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -465,6 +505,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Letter Head",
@@ -474,6 +515,7 @@
"permlevel": 0,
"precision": "",
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -489,6 +531,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -496,6 +539,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -511,6 +555,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -519,6 +564,7 @@
"options": "Packing Slip",
"permlevel": 0,
"print_hide": 1,
+ "print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
@@ -537,7 +583,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-11-16 06:29:51.222925",
+ "modified": "2016-03-31 06:02:41.545869",
"modified_by": "Administrator",
"module": "Stock",
"name": "Packing Slip",
@@ -646,5 +692,7 @@
],
"read_only": 0,
"read_only_onload": 1,
- "search_fields": "delivery_note"
+ "search_fields": "delivery_note",
+ "sort_order": "DESC",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 3c5780a..cd5dd91 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -836,7 +836,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -2408,7 +2408,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-truck",
- "idx": 1,
+ "idx": 261,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
@@ -2416,7 +2416,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-03-25 07:32:02.276482",
+ "modified": "2016-03-31 06:03:27.541919",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
index 1f49cae..2a2025a 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
@@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
@@ -16,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -41,6 +43,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Customer",
@@ -67,6 +70,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -91,6 +95,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Status",
@@ -117,6 +122,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Transaction Date",
@@ -142,6 +148,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
@@ -167,6 +174,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Items",
@@ -180,7 +188,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -193,6 +201,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Schedule",
@@ -218,6 +227,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Generate Schedule",
@@ -242,6 +252,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Schedules",
@@ -268,6 +279,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Info",
@@ -292,6 +304,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Customer Name",
@@ -318,6 +331,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Person",
@@ -343,6 +357,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Mobile No",
@@ -367,6 +382,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact Email",
@@ -390,6 +406,7 @@
"fieldtype": "Small Text",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact",
@@ -413,6 +430,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -436,6 +454,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Address",
@@ -460,6 +479,7 @@
"fieldtype": "Small Text",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Address",
@@ -485,6 +505,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Territory",
@@ -513,6 +534,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Customer Group",
@@ -537,6 +559,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Company",
@@ -563,6 +586,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -590,7 +614,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-03 01:09:50.703964",
+ "modified": "2016-03-31 06:02:28.862296",
"modified_by": "Administrator",
"module": "Support",
"name": "Maintenance Schedule",
@@ -621,5 +645,6 @@
"read_only_onload": 0,
"search_fields": "status,customer,customer_name",
"sort_order": "DESC",
- "timeline_field": "customer"
+ "timeline_field": "customer",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/templates/includes/project_row.html b/erpnext/templates/includes/projects/project_row.html
similarity index 86%
rename from erpnext/templates/includes/project_row.html
rename to erpnext/templates/includes/projects/project_row.html
index fc264c1..fcd0e22 100644
--- a/erpnext/templates/includes/project_row.html
+++ b/erpnext/templates/includes/projects/project_row.html
@@ -3,13 +3,13 @@
<a class="no-decoration" href="/projects?project={{ doc.name }}">
<div class="row">
<div class="col-xs-4">
-
+
{{ doc.name }}
</div>
<div class="col-xs-4">
{% if doc.percent_complete %}
<div class="progress" style="margin-bottom: 0!important; margin-top: 10px!important; height:5px;">
- <div class="progress-bar progress-bar-warning" role="progressbar"
+ <div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success"}}" role="progressbar"
aria-valuenow="{{ doc.percent_complete|round|int }}"
aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
</div>
diff --git a/erpnext/templates/includes/projects/timeline.html b/erpnext/templates/includes/projects/timeline.html
deleted file mode 100644
index 605404b..0000000
--- a/erpnext/templates/includes/projects/timeline.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% for timeline in doc.timelines %}
- <article class="timeline-entry">
- <div class="timeline-entry-inner">
- <div class="timeline-icon {{ "bg-danger" if ((timeline.reference_name).startswith('ISS') and (timeline.subject).startswith('Open')) else "bg-warning" if ((timeline.reference_name).startswith('TASK') and (timeline.subject).startswith('Open')) else "bg-success" if (timeline.subject).startswith('Closed') else "bg-info"}}">
- </div>
- <div class="timeline-label">
- <span class="avatar avatar-small" title="{{ timeline.modified_by }}"> <img src="{{ timeline.user_image }}"></span>
- <span class='indicator'>
- {{timeline.reference_name}} {{timeline.subject }}
- </span>
- <span class='indicator pull-right'>
- {{ frappe.utils.pretty_date(timeline.creation) }}
- </span>
- </div>
- </div>
- </article>
-{% endfor %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/projects.html b/erpnext/templates/pages/projects.html
index 0663dbf..6ecdfb6 100644
--- a/erpnext/templates/pages/projects.html
+++ b/erpnext/templates/pages/projects.html
@@ -38,7 +38,7 @@
<div class="col-xs-6">
{% if doc.percent_complete %}
<div class="progress progress-hg">
- <div class="progress-bar progress-bar-warning active" role="progressbar"
+ <div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success" }} active" role="progressbar"
aria-valuenow="{{ doc.percent_complete|round|int }}"
aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
</div>
diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py
index ae2fdfb..312b0b1 100644
--- a/erpnext/utilities/doctype/contact/contact.py
+++ b/erpnext/utilities/doctype/contact/contact.py
@@ -98,7 +98,7 @@
contact_name = frappe.db.get_value("Contact", {"email_id": doc.name})
if contact_name:
contact = frappe.get_doc("Contact", contact_name)
- contact.first_name = doc.first_name
- contact.last_name = doc.last_name
- contact.phone = doc.phone
+ for key in ("first_name", "last_name", "phone"):
+ if doc.get(key):
+ contact.set(key, doc.get(key))
contact.save(ignore_permissions=True)