Minor fixes
diff --git a/.eslintrc b/.eslintrc
index c9cd552..4dd1216 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -132,6 +132,7 @@
"get_url_arg": true,
"get_server_fields": true,
"set_multiple": true,
- "QUnit": true
+ "QUnit": true,
+ "Chart": true
}
}
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 42f538d..334af63 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -4,7 +4,7 @@
import frappe
from erpnext.hooks import regional_overrides
-__version__ = '9.1.6'
+__version__ = '9.2.11'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py
index 0787a1f..b31c5d6 100644
--- a/erpnext/accounts/doctype/account/account.py
+++ b/erpnext/accounts/doctype/account/account.py
@@ -205,12 +205,10 @@
return new_account
def after_rename(self, old, new, merge=False):
+ super(Account, self).after_rename(old, new, merge)
+
if not merge:
- frappe.db.set_value("Account", new, "account_name",
- " - ".join(new.split(" - ")[:-1]))
- else:
- from frappe.utils.nestedset import rebuild_tree
- rebuild_tree("Account", "parent_account")
+ frappe.db.set_value("Account", new, "account_name", " - ".join(new.split(" - ")[:-1]))
def get_parent_account(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql("""select name from tabAccount
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/fr_plan_comptable_general.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/fr_plan_comptable_general.json
index f6015f3..018d368 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/fr_plan_comptable_general.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/fr_plan_comptable_general.json
@@ -851,7 +851,7 @@
"4457-Taxes sur le chiffre d'affaires collect\u00e9es par l'entreprise": {
"44571-TVA collect\u00e9e": {
"account_type": "Tax",
- "tax_rate": 20.0
+ "is_group": 1
},
"44578-Taxes assimil\u00e9es \u00e0 la TVA": {}
},
diff --git a/erpnext/accounts/doctype/asset/depreciation.py b/erpnext/accounts/doctype/asset/depreciation.py
index 495433a..c72cb96 100644
--- a/erpnext/accounts/doctype/asset/depreciation.py
+++ b/erpnext/accounts/doctype/asset/depreciation.py
@@ -151,11 +151,14 @@
asset.set_status()
@frappe.whitelist()
-def get_gl_entries_on_asset_disposal(asset, selling_amount=0):
+def get_gl_entries_on_asset_disposal(asset, is_sale=False):
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.value_after_depreciation)
+ expense_account, cost_center = get_disposal_account_and_cost_center(asset.company)
+ if is_sale:
+ expense_account = depr_expense_account
+
gl_entries = [
{
"account": fixed_asset_account,
@@ -169,14 +172,12 @@
}
]
- profit_amount = flt(selling_amount) - flt(asset.value_after_depreciation)
- if flt(asset.value_after_depreciation) and profit_amount:
- debit_or_credit = "debit" if profit_amount < 0 else "credit"
+ if flt(asset.value_after_depreciation):
gl_entries.append({
- "account": disposal_account,
- "cost_center": depreciation_cost_center,
- debit_or_credit: abs(profit_amount),
- debit_or_credit + "_in_account_currency": abs(profit_amount)
+ "account": expense_account,
+ "cost_center": cost_center,
+ "debit": flt(asset.value_after_depreciation),
+ "debit_in_account_currency": flt(asset.value_after_depreciation)
})
return gl_entries
diff --git a/erpnext/accounts/doctype/asset/test_asset.py b/erpnext/accounts/doctype/asset/test_asset.py
index 21596f1..fd66d1f 100644
--- a/erpnext/accounts/doctype/asset/test_asset.py
+++ b/erpnext/accounts/doctype/asset/test_asset.py
@@ -13,6 +13,7 @@
def setUp(self):
set_depreciation_settings_in_company()
create_asset()
+ frappe.db.sql("delete from `tabTax Rule`")
def test_purchase_asset(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
@@ -187,7 +188,6 @@
asset.load_from_db()
depr_entry = asset.get("schedules")[0].journal_entry
self.assertFalse(depr_entry)
-
def test_scrap_asset(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
@@ -233,8 +233,9 @@
expected_gle = (
("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
+ ("_Test Depreciations - _TC", 70000.0, 0.0),
("_Test Fixed Asset - _TC", 0.0, 100000.0),
- ("_Test Gain/Loss on Asset Disposal - _TC", 45000.0, 0.0),
+ ("_Test Gain/Loss on Asset Disposal - _TC", 0.0, 25000.0),
("Debtors - _TC", 25000.0, 0.0)
)
diff --git a/erpnext/accounts/doctype/c_form/c_form.json b/erpnext/accounts/doctype/c_form/c_form.json
index 29531ec..fc712f8 100644
--- a/erpnext/accounts/doctype/c_form/c_form.json
+++ b/erpnext/accounts/doctype/c_form/c_form.json
@@ -17,36 +17,6 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "print_width": "50%",
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -438,7 +408,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 3,
- "modified": "2017-06-13 14:28:56.667292",
+ "modified": "2017-11-10 18:44:44.081464",
"modified_by": "Administrator",
"module": "Accounts",
"name": "C-Form",
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py
index 12d5e19..55388a5 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.py
+++ b/erpnext/accounts/doctype/cost_center/cost_center.py
@@ -59,9 +59,8 @@
return new_cost_center
def after_rename(self, olddn, newdn, merge=False):
+ super(CostCenter, self).after_rename(olddn, newdn, merge)
+
if not merge:
frappe.db.set_value("Cost Center", newdn, "cost_center_name",
" - ".join(newdn.split(" - ")[:-1]))
- else:
- super(CostCenter, self).after_rename(olddn, newdn, merge)
-
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index face5ed..cc35652 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -54,7 +54,7 @@
def update_advance_paid(self):
advance_paid = frappe._dict()
for d in self.get("accounts"):
- if d.is_advance:
+ if d.is_advance == "Yes":
if d.reference_type in ("Sales Order", "Purchase Order"):
advance_paid.setdefault(d.reference_type, []).append(d.reference_name)
@@ -76,7 +76,7 @@
def unlink_advance_entry_reference(self):
for d in self.get("accounts"):
- if d.is_advance and d.reference_type in ("Sales Invoice", "Purchase Invoice"):
+ if d.is_advance == "Yes" and d.reference_type in ("Sales Invoice", "Purchase Invoice"):
doc = frappe.get_doc(d.reference_type, d.reference_name)
doc.delink_advance_entries(self.name)
d.reference_type = ''
@@ -566,17 +566,26 @@
account = get_bank_cash_account(mode_of_payment, company).get("account")
if not account:
+ '''
+ Set the default account first. If the user hasn't set any default account then, he doesn't
+ want us to set any random account. In this case set the account only if there is single
+ account (of that type), otherwise return empty dict.
+ '''
if account_type=="Bank":
account = frappe.db.get_value("Company", company, "default_bank_account")
if not account:
- account = frappe.db.get_value("Account",
- {"company": company, "account_type": "Bank", "is_group": 0})
+ account_list = frappe.get_all("Account", filters = {"company": company,
+ "account_type": "Bank", "is_group": 0})
+ if len(account_list) == 1:
+ account = account_list[0].name
elif account_type=="Cash":
account = frappe.db.get_value("Company", company, "default_cash_account")
if not account:
- account = frappe.db.get_value("Account",
- {"company": company, "account_type": "Cash", "is_group": 0})
+ account_list = frappe.get_all("Account", filters = {"company": company,
+ "account_type": "Cash", "is_group": 0})
+ if len(account_list) == 1:
+ account = account_list[0].name
if account:
account_details = frappe.db.get_value("Account", account,
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index 04db9e2..c5e0306 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -252,7 +252,6 @@
date: frm.doc.posting_date
},
callback: function(r, rt) {
- console.log(r, rt);
if(r.message) {
if(frm.doc.payment_type == "Receive") {
frm.set_value("paid_from", r.message.party_account);
@@ -405,11 +404,7 @@
}
// Make read only if Accounts Settings doesn't allow stale rates
- frappe.model.get_value("Accounts Settings", null, "allow_stale",
- function(d){
- frm.set_df_property("source_exchange_rate", "read_only", cint(d.allow_stale) ? 0 : 1);
- }
- );
+ frm.set_df_property("source_exchange_rate", "read_only", erpnext.stale_rate_allowed());
},
target_exchange_rate: function(frm) {
@@ -430,11 +425,7 @@
frm.set_paid_amount_based_on_received_amount = false;
// Make read only if Accounts Settings doesn't allow stale rates
- frappe.model.get_value("Accounts Settings", null, "allow_stale",
- function(d){
- frm.set_df_property("target_exchange_rate", "read_only", cint(d.allow_stale) ? 0 : 1);
- }
- );
+ frm.set_df_property("target_exchange_rate", "read_only", erpnext.stale_rate_allowed());
},
paid_amount: function(frm) {
@@ -656,12 +647,19 @@
set_difference_amount: function(frm) {
var unallocated_amount = 0;
+ var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
+ function(d) { return flt(d.amount) }));
+
if(frm.doc.party) {
var party_amount = frm.doc.payment_type=="Receive" ?
frm.doc.paid_amount : frm.doc.received_amount;
if(frm.doc.total_allocated_amount < party_amount) {
- unallocated_amount = party_amount - frm.doc.total_allocated_amount;
+ if(frm.doc.payment_type == "Receive") {
+ unallocated_amount = party_amount - (frm.doc.total_allocated_amount - total_deductions);
+ } else {
+ unallocated_amount = party_amount - (frm.doc.total_allocated_amount + total_deductions);
+ }
}
}
frm.set_value("unallocated_amount", unallocated_amount);
@@ -680,9 +678,6 @@
difference_amount = flt(frm.doc.base_paid_amount) - flt(frm.doc.base_received_amount);
}
- var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
- function(d) { return flt(d.amount) }));
-
frm.set_value("difference_amount", difference_amount - total_deductions);
frm.events.hide_unhide_fields(frm);
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 9d24261..56bdfba 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -285,8 +285,13 @@
if self.party:
party_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount
+ total_deductions = sum([flt(d.amount) for d in self.get("deductions")])
+
if self.total_allocated_amount < party_amount:
- self.unallocated_amount = party_amount - self.total_allocated_amount
+ if self.payment_type == "Receive":
+ self.unallocated_amount = party_amount - (self.total_allocated_amount - total_deductions)
+ else:
+ self.unallocated_amount = party_amount - (self.total_allocated_amount + total_deductions)
def set_difference_amount(self):
base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate)
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py
index 807ad28..21ddb10 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.py
+++ b/erpnext/accounts/doctype/payment_request/payment_request.py
@@ -294,7 +294,7 @@
if args.get("payment_gateway"):
return get_payment_gateway_account(args.get("payment_gateway"))
- if args.cart:
+ if args.order_type == "Shopping Cart":
payment_gateway_account = frappe.get_doc("Shopping Cart Settings").payment_gateway_account
return get_payment_gateway_account(payment_gateway_account)
diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.json b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.json
index fb4ca2f..b4802f4 100644
--- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.json
+++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "PCE/.###",
@@ -12,34 +13,7 @@
"engine": "InnoDB",
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -50,6 +24,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Transaction Date",
@@ -69,6 +44,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -79,6 +55,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Posting Date",
@@ -98,6 +75,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -108,6 +86,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Closing Fiscal Year",
@@ -128,6 +107,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -138,6 +118,7 @@
"ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Amended From",
@@ -158,6 +139,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -168,6 +150,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Company",
@@ -188,6 +171,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -198,6 +182,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -215,6 +200,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -226,6 +212,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Closing Account Head",
@@ -246,6 +233,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -256,6 +244,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Remarks",
@@ -275,18 +264,18 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-file-text",
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-11-07 05:32:15.691681",
+ "modified": "2017-11-10 18:41:10.881530",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Period Closing Voucher",
@@ -302,7 +291,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -323,7 +311,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -339,8 +326,10 @@
"read_only": 0,
"read_only_onload": 0,
"search_fields": "posting_date, fiscal_year",
+ "show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "closing_account_head",
+ "track_changes": 0,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json
index 187454e..e2246bc 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.json
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json
@@ -3,7 +3,7 @@
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
- "autoname": "hash",
+ "autoname": "field:pos_profile_name",
"beta": 0,
"creation": "2013-05-24 12:15:51",
"custom": 0,
@@ -17,6 +17,96 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "default": "0",
+ "fieldname": "disabled",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Disabled",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_2",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "pos_profile_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "POS Profile Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "user",
"fieldtype": "Link",
"hidden": 0,
@@ -112,9 +202,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "update_stock",
- "fieldname": "warehouse",
- "fieldtype": "Link",
+ "fieldname": "ignore_pricing_rule",
+ "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -122,13 +211,11 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Warehouse",
+ "label": "Ignore Pricing Rule",
"length": 0,
"no_copy": 0,
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -145,8 +232,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "campaign",
- "fieldtype": "Link",
+ "fieldname": "allow_delete",
+ "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -154,10 +241,39 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Campaign",
+ "label": "Allow Delete",
"length": 0,
"no_copy": 0,
- "options": "Campaign",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "allow_user_to_edit_rate",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Allow user to edit Rate",
+ "length": 0,
+ "no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -300,7 +416,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "currency",
+ "depends_on": "update_stock",
+ "fieldname": "warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -309,19 +426,19 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Currency",
+ "label": "Warehouse",
"length": 0,
"no_copy": 0,
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -332,8 +449,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "ignore_pricing_rule",
- "fieldtype": "Check",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -341,7 +458,38 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Ignore Pricing Rule",
+ "label": "Campaign",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Campaign",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_15",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Applicable for Users",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -362,8 +510,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "allow_delete",
- "fieldtype": "Check",
+ "fieldname": "applicable_for_users",
+ "fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -371,39 +519,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Allow Delete",
+ "label": "Applicable for Users",
"length": 0,
"no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "allow_user_to_edit_rate",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Allow user to edit Rate",
- "length": 0,
- "no_copy": 0,
+ "options": "POS Profile User",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -482,6 +601,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break_14",
"fieldtype": "Section Break",
"hidden": 0,
@@ -602,6 +722,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break_16",
"fieldtype": "Section Break",
"hidden": 0,
@@ -882,6 +1003,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "offline_pos_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1037,6 +1159,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break_19",
"fieldtype": "Section Break",
"hidden": 0,
@@ -1046,6 +1169,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
+ "label": "Accounting",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -1066,6 +1190,38 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Currency",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"depends_on": "",
"fieldname": "write_off_account",
"fieldtype": "Link",
@@ -1160,38 +1316,6 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Taxes and Charges",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Template",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "column_break_23",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1309,6 +1433,38 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Taxes and Charges",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Template",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
}
],
"has_web_view": 0,
@@ -1322,7 +1478,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-01 15:55:14.890452",
+ "modified": "2017-10-27 06:45:32.957674",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
@@ -1375,7 +1531,7 @@
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "user",
+ "title_field": "pos_profile_name",
"track_changes": 0,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.py b/erpnext/accounts/doctype/pos_profile/pos_profile.py
index 8d6a2db..6b7d99f 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.py
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.py
@@ -11,7 +11,7 @@
class POSProfile(Document):
def validate(self):
- self.check_for_duplicate()
+ # self.check_for_duplicate()
self.validate_all_link_fields()
self.validate_duplicate_groups()
self.check_default_payment()
@@ -94,3 +94,45 @@
@frappe.whitelist()
def get_series():
return frappe.get_meta("Sales Invoice").get_field("naming_series").options or ""
+
+@frappe.whitelist()
+def get_pos_profiles_for_user(user=None):
+ out = []
+ if not user:
+ user = frappe.session.user
+
+ res = frappe.db.sql('''
+ select
+ parent
+ from
+ `tabPOS Profile User`
+ where
+ user = %s
+ ''', (user), as_dict=1)
+
+ if not res:
+ company = frappe.defaults.get_user_default('company')
+ res = frappe.db.sql('''
+ select
+ pos_profile_name
+ from
+ `tabPOS Profile`
+ where
+ company = %s
+ ''', (company), as_dict=1)
+
+ out = [r.pos_profile_name for r in res]
+
+ return out
+
+ for r in res:
+ name = frappe.db.get_value('POS Profile', r.parent, 'pos_profile_name')
+ out.append(name)
+
+ return out
+
+@frappe.whitelist()
+def get_pos_profile(pos_profile_name=None):
+ if not pos_profile_name: return
+ name = frappe.db.get_value('POS Profile', { 'pos_profile_name': pos_profile_name })
+ return frappe.get_doc('POS Profile', name)
diff --git a/erpnext/accounts/doctype/pos_profile/test_pos_profile.py b/erpnext/accounts/doctype/pos_profile/test_pos_profile.py
index 803ee8e..1e43173 100644
--- a/erpnext/accounts/doctype/pos_profile/test_pos_profile.py
+++ b/erpnext/accounts/doctype/pos_profile/test_pos_profile.py
@@ -41,6 +41,7 @@
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"income_account": "Sales - _TC",
"name": "_Test POS Profile",
+ "pos_profile_name": "_Test POS Profile",
"naming_series": "_T-POS Profile-",
"selling_price_list": "_Test Price List",
"territory": "_Test Territory",
diff --git a/erpnext/accounts/doctype/pos_profile_user/__init__.py b/erpnext/accounts/doctype/pos_profile_user/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/pos_profile_user/__init__.py
diff --git a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.js b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.js
new file mode 100644
index 0000000..f0884eb
--- /dev/null
+++ b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.js
@@ -0,0 +1,6 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('POS Profile User', {
+
+});
diff --git a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json
new file mode 100644
index 0000000..22c7f72
--- /dev/null
+++ b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json
@@ -0,0 +1,93 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-10-27 16:46:06.060930",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "user",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "User",
+ "length": 0,
+ "no_copy": 0,
+ "options": "User",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-10-27 16:46:12.784244",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "POS Profile User",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.py b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.py
new file mode 100644
index 0000000..d77cdde
--- /dev/null
+++ b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class POSProfileUser(Document):
+ pass
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index e3c5fb4..3d70b3b 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -3442,137 +3442,11 @@
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "subscription",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Subscription",
- "length": 0,
- "no_copy": 1,
- "options": "Subscription",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "is_recurring",
- "columns": 0,
- "depends_on": "eval:doc.docstatus<2 && !doc.__islocal",
- "fieldname": "recurring_invoice",
- "fieldtype": "Section Break",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Invoice",
- "length": 0,
- "no_copy": 0,
- "options": "fa fa-time",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:doc.docstatus<2",
- "description": "",
- "fieldname": "is_recurring",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Recurring",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Select the period when the invoice will be generated automatically",
- "fieldname": "recurring_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Type",
- "length": 0,
- "no_copy": 1,
- "options": "Monthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
+ "depends_on": "",
"description": "Start date of current invoice's period",
"fieldname": "from_date",
"fieldtype": "Date",
@@ -3603,7 +3477,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
+ "depends_on": "",
"description": "End date of current invoice's period",
"fieldname": "to_date",
"fieldtype": "Date",
@@ -3630,136 +3504,11 @@
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "fieldname": "submit_on_creation",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Submit on creation",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "notify_by_email",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Notify by email",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc",
- "fieldname": "repeat_on_day_of_month",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Repeat on Day of Month",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which recurring invoice will be stop",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "End Date",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "column_break_82",
+ "fieldname": "column_break_114",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3771,101 +3520,8 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which next invoice will be generated. It is generated on submit.",
- "fieldname": "next_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Next Date",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The unique id for tracking all recurring invoices. It is generated on submit.",
- "fieldname": "recurring_id",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Id",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Enter Email Address separated by commas, invoice will be mailed automatically on particular date",
- "fieldname": "notification_email_address",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Notification Email Address",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "precision": "",
+ "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -3881,8 +3537,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "fieldname": "recurring_print_format",
+ "fieldname": "subscription",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3891,15 +3546,15 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Recurring Print Format",
+ "label": "Subscription",
"length": 0,
- "no_copy": 0,
- "options": "Print Format",
+ "no_copy": 1,
+ "options": "Subscription",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -3920,7 +3575,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-09-19 11:22:47.074420",
+ "modified": "2017-10-24 12:51:51.199594",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
index 639620f..474329f 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
@@ -473,6 +473,7 @@
import test_records as jv_test_records
jv = frappe.copy_doc(jv_test_records[1])
+ jv.accounts[0].is_advance = 'Yes'
jv.insert()
jv.submit()
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 04f7e1b..63db16c 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -16,6 +16,8 @@
doc = frappe.new_doc('Sales Invoice')
doc.is_pos = 1;
pos_profile = get_pos_profile(doc.company) or {}
+ if not pos_profile:
+ frappe.throw(_("POS Profile is required to use Point-of-Sale"))
if not doc.company: doc.company = pos_profile.get('company')
doc.update_stock = pos_profile.get('update_stock')
@@ -88,10 +90,11 @@
doc.naming_series = pos_profile.get('naming_series') or 'SINV-'
doc.letter_head = pos_profile.get('letter_head') or company_data.default_letter_head
doc.ignore_pricing_rule = pos_profile.get('ignore_pricing_rule') or 0
- doc.apply_discount_on = pos_profile.get('apply_discount_on') or ''
+ doc.apply_discount_on = pos_profile.get('apply_discount_on') or 'Grand Total'
doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group')
doc.territory = pos_profile.get('territory') or get_root('Territory')
doc.terms = frappe.db.get_value('Terms and Conditions', pos_profile.get('tc_name'), 'terms') or doc.terms or ''
+ doc.offline_pos_name = ''
def get_root(table):
root = frappe.db.sql(""" select name from `tab%(table)s` having
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 28a5d01..ccaae49 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -95,8 +95,9 @@
// Show buttons only when pos view is active
if (cint(doc.docstatus==0) && cur_frm.page.current_view_name!=="pos" && !doc.is_return) {
- cur_frm.cscript.sales_order_btn();
- cur_frm.cscript.delivery_note_btn();
+ this.frm.cscript.sales_order_btn();
+ this.frm.cscript.delivery_note_btn();
+ this.frm.cscript.quotation_btn();
}
this.set_default_print_format();
@@ -157,6 +158,26 @@
})
}, __("Get items from"));
},
+
+ quotation_btn: function() {
+ var me = this;
+ this.$quotation_btn = this.frm.add_custom_button(__('Quotation'),
+ function() {
+ erpnext.utils.map_current_doc({
+ method: "erpnext.selling.doctype.quotation.quotation.make_sales_invoice",
+ source_doctype: "Quotation",
+ target: me.frm,
+ setters: {
+ customer: me.frm.doc.customer || undefined,
+ },
+ get_query_filters: {
+ docstatus: 1,
+ status: ["!=", "Lost"],
+ company: me.frm.doc.company
+ }
+ })
+ }, __("Get items from"));
+ },
delivery_note_btn: function() {
var me = this;
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 9aa0e6b..f2625cc 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -4273,414 +4273,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Subscription",
- "length": 0,
- "no_copy": 1,
- "options": "Subscription",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "is_recurring",
- "columns": 0,
- "depends_on": "eval:doc.docstatus<2 && !doc.__islocal",
- "fieldname": "recurring_invoice",
- "fieldtype": "Section Break",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Invoice",
- "length": 0,
- "no_copy": 0,
- "options": "fa fa-time",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break11",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Settings",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.docstatus<2",
- "description": "",
- "fieldname": "is_recurring",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Recurring",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_recurring",
- "description": "",
- "fieldname": "recurring_id",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Reference Document",
- "length": 0,
- "no_copy": 1,
- "options": "Sales Invoice",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "recurring_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Frequency",
- "length": 0,
- "no_copy": 1,
- "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "repeat_on_day_of_month",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Repeat on Day of Month",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "End Date",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "fieldname": "submit_on_creation",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Submit on creation",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "notify_by_email",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Notify by email",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "notification_email_address",
- "fieldtype": "Code",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Notification Email Address",
- "length": 0,
- "no_copy": 1,
- "options": "Email",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name",
- "fieldname": "recurring_print_format",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Print Format",
- "length": 0,
- "no_copy": 0,
- "options": "Print Format",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break12",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "This Document",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_recurring",
+ "depends_on": "",
"description": "",
"fieldname": "from_date",
"fieldtype": "Date",
@@ -4711,7 +4304,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "is_recurring",
+ "depends_on": "",
"description": "",
"fieldname": "to_date",
"fieldtype": "Date",
@@ -4742,10 +4335,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "is_recurring",
- "description": "",
- "fieldname": "next_date",
- "fieldtype": "Date",
+ "fieldname": "column_break_140",
+ "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -4753,11 +4344,11 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Next Date",
"length": 0,
- "no_copy": 1,
+ "no_copy": 0,
"permlevel": 0,
- "print_hide": 1,
+ "precision": "",
+ "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -4769,6 +4360,37 @@
},
{
"allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "subscription",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Subscription",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Subscription",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -4811,7 +4433,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-09-19 11:23:08.675028",
+ "modified": "2017-11-03 05:31:56.636424",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@@ -4909,5 +4531,5 @@
"timeline_field": "customer",
"title_field": "title",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 6ab6148..db9969d 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -304,6 +304,7 @@
self.account_for_change_amount = frappe.db.get_value('Company', self.company, 'default_cash_account')
if pos:
+ self.pos_profile = pos.name
if not for_validate and not self.customer:
self.customer = pos.customer
self.mode_of_payment = pos.mode_of_payment
@@ -669,28 +670,28 @@
# income account gl entries
for item in self.get("items"):
if flt(item.base_net_amount):
+ account_currency = get_account_currency(item.income_account)
+ gl_entries.append(
+ self.get_gl_dict({
+ "account": item.income_account,
+ "against": self.customer,
+ "credit": item.base_net_amount,
+ "credit_in_account_currency": item.base_net_amount \
+ if account_currency==self.company_currency else item.net_amount,
+ "cost_center": item.cost_center
+ }, account_currency)
+ )
+
if item.is_fixed_asset:
asset = frappe.get_doc("Asset", item.asset)
- fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(asset, item.base_net_amount)
+ fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(asset, is_sale=True)
for gle in fixed_asset_gl_entries:
gle["against"] = self.customer
gl_entries.append(self.get_gl_dict(gle))
asset.db_set("disposal_date", self.posting_date)
asset.set_status("Sold" if self.docstatus==1 else None)
- else:
- account_currency = get_account_currency(item.income_account)
- gl_entries.append(
- self.get_gl_dict({
- "account": item.income_account,
- "against": self.customer,
- "credit": item.base_net_amount,
- "credit_in_account_currency": item.base_net_amount \
- if account_currency==self.company_currency else item.net_amount,
- "cost_center": item.cost_center
- }, account_currency)
- )
# expense account gl entries
if cint(self.update_stock) and \
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index 264f027..50d2ce8 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -1133,6 +1133,7 @@
import test_records as jv_test_records
jv = frappe.copy_doc(jv_test_records[0])
+ jv.accounts[0].is_advance = 'Yes'
jv.insert()
jv.submit()
diff --git a/erpnext/accounts/doctype/subscription/subscription.js b/erpnext/accounts/doctype/subscription/subscription.js
index 15927d5..8db5be8 100644
--- a/erpnext/accounts/doctype/subscription/subscription.js
+++ b/erpnext/accounts/doctype/subscription/subscription.js
@@ -12,7 +12,8 @@
frm.fields_dict['reference_document'].get_query = function() {
return {
filters: {
- "docstatus": 1
+ "docstatus": 1,
+ "subscription": ''
}
};
};
diff --git a/erpnext/accounts/doctype/subscription/subscription.json b/erpnext/accounts/doctype/subscription/subscription.json
index 167a92f..7ff2e4b 100644
--- a/erpnext/accounts/doctype/subscription/subscription.json
+++ b/erpnext/accounts/doctype/subscription/subscription.json
@@ -315,22 +315,23 @@
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 1,
+ "allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "from_date",
- "fieldtype": "Date",
+ "fieldname": "frequency",
+ "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 0,
+ "in_list_view": 1,
"in_standard_filter": 0,
- "label": "From Date",
+ "label": "Frequency",
"length": 0,
"no_copy": 0,
+ "options": "\nDaily\nWeekly\nMonthly\nQuarterly\nHalf-yearly\nYearly",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -338,37 +339,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "to_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "To Date",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -404,37 +375,6 @@
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "frequency",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Frequency",
- "length": 0,
- "no_copy": 0,
- "options": "\nDaily\nWeekly\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -844,7 +784,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-10 17:28:10.105561",
+ "modified": "2017-10-23 18:28:08.966403",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription",
diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py
index 20cf031..1103b70 100644
--- a/erpnext/accounts/doctype/subscription/subscription.py
+++ b/erpnext/accounts/doctype/subscription/subscription.py
@@ -17,6 +17,7 @@
class Subscription(Document):
def validate(self):
self.update_status()
+ self.validate_reference_doctype()
self.validate_dates()
self.validate_next_schedule_date()
self.validate_email_id()
@@ -25,25 +26,28 @@
validate_template(self.message or "")
def before_submit(self):
- self.set_next_schedule_date()
+ if not self.next_schedule_date:
+ self.next_schedule_date = get_next_schedule_date(self.start_date,
+ self.frequency, self.repeat_on_day)
def on_submit(self):
- # self.update_subscription_id()
- self.update_subscription_data()
+ self.update_subscription_id()
def on_update_after_submit(self):
- self.update_subscription_data()
self.validate_dates()
self.set_next_schedule_date()
def before_cancel(self):
self.unlink_subscription_id()
+ self.next_schedule_date = None
def unlink_subscription_id(self):
- doc = frappe.get_doc(self.reference_doctype, self.reference_document)
- if doc.meta.get_field('subscription'):
- doc.subscription = None
- doc.db_update()
+ frappe.db.sql("update `tab{0}` set subscription = null where subscription=%s"
+ .format(self.reference_doctype), self.name)
+
+ def validate_reference_doctype(self):
+ if not frappe.get_meta(self.reference_doctype).has_field('subscription'):
+ frappe.throw(_("Add custom field Subscription in the doctype {0}").format(self.reference_doctype))
def validate_dates(self):
if self.end_date and getdate(self.start_date) > getdate(self.end_date):
@@ -76,30 +80,11 @@
frappe.throw(_("'Recipients' not specified"))
def set_next_schedule_date(self):
- self.next_schedule_date = get_next_schedule_date(self.start_date,
- self.frequency, self.repeat_on_day)
-
- def update_subscription_data(self):
- update_doc = False
- doc = frappe.get_doc(self.reference_doctype, self.reference_document)
- if frappe.get_meta(self.reference_doctype).get_field("from_date"):
- doc.from_date = self.from_date
- doc.to_date = self.to_date
- update_doc = True
-
- if not doc.subscription:
- doc.subscription = self.name
- update_doc = True
-
- if update_doc:
- doc.db_update()
+ if self.repeat_on_day:
+ self.next_schedule_date = get_next_date(self.next_schedule_date, 0, self.repeat_on_day)
def update_subscription_id(self):
- doc = frappe.get_doc(self.reference_doctype, self.reference_document)
- if not doc.meta.get_field('subscription'):
- frappe.throw(_("Add custom field Subscription Id in the doctype {0}").format(self.reference_doctype))
-
- doc.db_set('subscription', self.name)
+ frappe.db.set_value(self.reference_doctype, self.reference_document, "subscription", self.name)
def update_status(self, status=None):
self.status = {
@@ -142,9 +127,6 @@
def create_documents(data, schedule_date):
try:
doc = make_new_document(data, schedule_date)
- if getattr(doc, "from_date", None):
- update_subscription_period(data, doc)
-
if data.notify_by_email and data.recipients:
print_format = data.print_format or "Standard"
send_notification(doc, data, print_format=print_format)
@@ -159,13 +141,6 @@
if data.reference_document and not frappe.flags.in_test:
notify_error_to_user(data)
-def update_subscription_period(data, doc):
- from_date = doc.from_date
- to_date = doc.to_date
-
- frappe.db.set_value('Subscription', data.name, 'from_date', from_date)
- frappe.db.set_value('Subscription', data.name, 'to_date', to_date)
-
def disable_subscription(data):
subscription = frappe.get_doc('Subscription', data.name)
subscription.db_set('disabled', 1)
@@ -216,24 +191,38 @@
for fieldname in ("page_break",):
item.set(fieldname, reference_doc.items[i].get(fieldname))
- if args.from_date and args.to_date:
- from_date = get_next_date(args.from_date, mcount)
-
- if (cstr(get_first_day(args.from_date)) == cstr(args.from_date)) and \
- (cstr(get_last_day(args.to_date)) == cstr(args.to_date)):
- to_date = get_last_day(get_next_date(args.to_date, mcount))
- else:
- to_date = get_next_date(args.to_date, mcount)
-
- if new_document.meta.get_field('from_date'):
- new_document.set('from_date', from_date)
- new_document.set('to_date', to_date)
-
- new_document.run_method("on_recurring", reference_doc=reference_doc, subscription_doc=args)
for data in new_document.meta.fields:
if data.fieldtype == 'Date' and data.reqd:
new_document.set(data.fieldname, schedule_date)
+ set_subscription_period(args, mcount, new_document)
+
+ new_document.run_method("on_recurring", reference_doc=reference_doc, subscription_doc=args)
+
+def set_subscription_period(args, mcount, new_document):
+ if mcount and new_document.meta.get_field('from_date') and new_document.meta.get_field('to_date'):
+ last_ref_doc = frappe.db.sql("""
+ select name, from_date, to_date
+ from `tab{0}`
+ where subscription=%s and docstatus < 2
+ order by creation desc
+ limit 1
+ """.format(args.reference_doctype), args.name, as_dict=1)
+
+ if not last_ref_doc:
+ return
+
+ from_date = get_next_date(last_ref_doc[0].from_date, mcount)
+
+ if (cstr(get_first_day(last_ref_doc[0].from_date)) == cstr(last_ref_doc[0].from_date)) and \
+ (cstr(get_last_day(last_ref_doc[0].to_date)) == cstr(last_ref_doc[0].to_date)):
+ to_date = get_last_day(get_next_date(last_ref_doc[0].to_date, mcount))
+ else:
+ to_date = get_next_date(last_ref_doc[0].to_date, mcount)
+
+ new_document.set('from_date', from_date)
+ new_document.set('to_date', to_date)
+
def get_next_date(dt, mcount, day=None):
dt = getdate(dt)
dt += relativedelta(months=mcount, day=day)
@@ -287,8 +276,11 @@
@frappe.whitelist()
def make_subscription(doctype, docname):
doc = frappe.new_doc('Subscription')
+
+ reference_doc = frappe.get_doc(doctype, docname)
doc.reference_doctype = doctype
doc.reference_document = docname
+ doc.start_date = reference_doc.get('posting_date') or reference_doc.get('transaction_date')
return doc
@frappe.whitelist()
diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py
index b74163c..4ccf483 100644
--- a/erpnext/accounts/doctype/subscription/test_subscription.py
+++ b/erpnext/accounts/doctype/subscription/test_subscription.py
@@ -30,7 +30,7 @@
new_quotation = frappe.get_doc('Quotation', new_quotation)
- for fieldname in ['customer', 'company', 'order_type', 'total', 'grand_total']:
+ for fieldname in ['customer', 'company', 'order_type', 'total', 'net_total']:
self.assertEquals(quotation.get(fieldname), new_quotation.get(fieldname))
for fieldname in ['item_code', 'qty', 'rate', 'amount']:
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
index 5ad7970..ee5b3c9 100644
--- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -11,7 +11,10 @@
class TestTaxRule(unittest.TestCase):
def setUp(self):
- frappe.db.sql("delete from `tabTax Rule` where use_for_shopping_cart <> 1")
+ frappe.db.sql("delete from `tabTax Rule`")
+
+ def tearDown(self):
+ frappe.db.sql("delete from `tabTax Rule`")
def test_conflict(self):
tax_rule1 = make_tax_rule(customer= "_Test Customer",
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index 57a8a18..6b58033 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -84,6 +84,7 @@
this.get_data_from_server(function () {
me.make_control();
me.create_new();
+ me.make();
});
},
@@ -178,41 +179,12 @@
}
},
- dialog_actions: function () {
- var me = this;
-
- $(this.list_body).find('.list-select-all').click(function () {
- me.removed_items = [];
- $(me.list_body).find('.list-delete').prop("checked", $(this).is(":checked"))
- if ($(this).is(":checked")) {
- $.each(me.si_docs, function (index, data) {
- for (key in data) {
- me.removed_items.push(key)
- }
- })
- }
-
- me.toggle_delete_button();
- })
-
- $(this.list_body).find('.list-delete').click(function () {
- me.name = $(this).parent().parent().attr('invoice-name');
- if ($(this).is(":checked")) {
- me.removed_items.push(me.name);
- } else {
- me.removed_items.pop(me.name)
- }
-
- me.toggle_delete_button();
- })
- },
-
edit_record: function () {
var me = this;
doc_data = this.get_invoice_doc(this.si_docs);
if (doc_data) {
- this.frm.doc = doc_data[0][this.name];
+ this.frm.doc = doc_data[0][this.frm.doc.offline_pos_name];
this.set_missing_values();
this.refresh(false);
this.toggle_input_field();
@@ -225,16 +197,15 @@
this.validate_list()
this.remove_doc_from_localstorage()
this.update_localstorage();
- // this.dialog_actions();
this.toggle_delete_button();
},
validate_list: function() {
var me = this;
this.si_docs = this.get_submitted_invoice()
- $.each(this.removed_items, function(index, name){
+ $.each(this.removed_items, function(index, pos_name){
$.each(me.si_docs, function(key, data){
- if(me.si_docs[key][name] && me.si_docs[key][name].offline_pos_name == name ){
+ if(me.si_docs[key][pos_name] && me.si_docs[key][pos_name].offline_pos_name == pos_name ){
frappe.throw(__("Submitted orders can not be deleted"))
}
})
@@ -293,7 +264,7 @@
return $.grep(this.si_docs, function (data) {
for (key in data) {
- return key == me.name
+ return key == me.frm.doc.offline_pos_name;
}
})
},
@@ -347,7 +318,6 @@
create_new: function () {
var me = this;
this.frm = {}
- this.name = null;
this.load_data(true);
this.setup();
this.set_default_customer()
@@ -361,6 +331,7 @@
if (load_doc) {
this.frm.doc = JSON.parse(localStorage.getItem('doc'));
+ this.frm.doc.offline_pos_name = null;
}
$.each(this.meta, function (i, data) {
@@ -382,7 +353,6 @@
},
setup: function () {
- this.make();
this.set_primary_action();
this.party_field.$input.attr('disabled', false);
if(this.selected_row) {
@@ -629,6 +599,7 @@
// this.list_customers.empty();
this.si_docs = this.get_doc_from_localstorage();
if (!this.si_docs.length) {
+ this.list_customers.find('.list-customers-table').html("");
return;
}
@@ -655,7 +626,7 @@
me.list_customers_btn.toggleClass("view_customer");
me.pos_bill.show();
me.list_customers_btn.show();
- me.name = $(this).parents().attr('invoice-name')
+ me.frm.doc.offline_pos_name = $(this).parents().attr('invoice-name')
me.edit_record();
})
@@ -675,11 +646,11 @@
});
$(this.wrapper).find('.list-delete').click(function () {
- me.name = $(this).parent().parent().attr('invoice-name');
+ me.frm.doc.offline_pos_name = $(this).parent().parent().attr('invoice-name');
if ($(this).is(":checked")) {
- me.removed_items.push(me.name);
+ me.removed_items.push(me.frm.doc.offline_pos_name);
} else {
- me.removed_items.pop(me.name)
+ me.removed_items.pop(me.frm.doc.offline_pos_name)
}
me.toggle_delete_button();
@@ -1341,6 +1312,12 @@
this.wrapper.find('input.discount-percentage').on("change", function () {
me.frm.doc.additional_discount_percentage = flt($(this).val(), precision("additional_discount_percentage"));
+
+ if(me.frm.doc.additional_discount_percentage && me.frm.doc.discount_amount) {
+ // Reset discount amount
+ me.frm.doc.discount_amount = 0;
+ }
+
var total = me.frm.doc.grand_total
if (me.frm.doc.apply_discount_on == 'Net Total') {
@@ -1348,15 +1325,15 @@
}
me.frm.doc.discount_amount = flt(total * flt(me.frm.doc.additional_discount_percentage) / 100, precision("discount_amount"));
- me.wrapper.find('input.discount-amount').val(me.frm.doc.discount_amount)
me.refresh();
+ me.wrapper.find('input.discount-amount').val(me.frm.doc.discount_amount)
});
this.wrapper.find('input.discount-amount').on("change", function () {
me.frm.doc.discount_amount = flt($(this).val(), precision("discount_amount"));
me.frm.doc.additional_discount_percentage = 0.0;
- me.wrapper.find('input.discount-percentage').val(0);
me.refresh();
+ me.wrapper.find('input.discount-percentage').val(0);
});
},
@@ -1429,7 +1406,7 @@
},
update_paid_amount_status: function (update_paid_amount) {
- if (this.name) {
+ if (this.frm.doc.offline_pos_name) {
update_paid_amount = update_paid_amount ? false : true;
}
@@ -1517,6 +1494,8 @@
var me = this;
this.wrapper.find(".net-total").text(format_currency(me.frm.doc.total, me.frm.doc.currency));
this.wrapper.find(".grand-total").text(format_currency(me.frm.doc.grand_total, me.frm.doc.currency));
+ this.wrapper.find('input.discount-percentage').val(this.frm.doc.additional_discount_percentage);
+ this.wrapper.find('input.discount-amount').val(this.frm.doc.discount_amount);
},
set_primary_action: function () {
@@ -1635,18 +1614,17 @@
create_invoice: function () {
var me = this;
- var invoice_data = {}
+ var invoice_data = {};
this.si_docs = this.get_doc_from_localstorage();
- if (this.name) {
- this.update_invoice()
+ if (this.frm.doc.offline_pos_name) {
+ this.update_invoice();
} else {
- this.name = $.now();
- this.frm.doc.offline_pos_name = this.name;
+ this.frm.doc.offline_pos_name = $.now();
this.frm.doc.posting_date = frappe.datetime.get_today();
this.frm.doc.posting_time = frappe.datetime.now_time();
this.frm.doc.pos_profile = this.pos_profile_data['name'];
- invoice_data[this.name] = this.frm.doc
- this.si_docs.push(invoice_data)
+ invoice_data[this.frm.doc.offline_pos_name] = this.frm.doc;
+ this.si_docs.push(invoice_data);
this.update_localstorage();
this.set_primary_action();
}
@@ -1658,12 +1636,12 @@
this.si_docs = this.get_doc_from_localstorage();
$.each(this.si_docs, function (index, data) {
for (var key in data) {
- if (key == me.name) {
+ if (key == me.frm.doc.offline_pos_name) {
me.si_docs[index][key] = me.frm.doc;
me.update_localstorage();
}
}
- })
+ });
},
update_localstorage: function () {
@@ -1702,6 +1680,8 @@
freeze_screen = this.freeze_screen || false;
if ((this.si_docs.length || this.email_queue_list || this.customers_list) && !this.freeze) {
+ this.freeze = true;
+
frappe.call({
method: "erpnext.accounts.doctype.sales_invoice.pos.make_invoice",
freeze: freeze_screen,
@@ -1712,17 +1692,19 @@
},
callback: function (r) {
if (r.message) {
+ me.freeze = false;
me.customers = r.message.synced_customers_list;
me.address = r.message.synced_address;
me.contacts = r.message.synced_contacts;
me.removed_items = r.message.invoice;
- me.removed_email = r.message.email_queue
- me.removed_customers = r.message.customers
+ me.removed_email = r.message.email_queue;
+ me.removed_customers = r.message.customers;
me.remove_doc_from_localstorage();
me.remove_email_queue_from_localstorage();
me.remove_customer_from_localstorage();
- me.prepare_customer_mapper()
- me.autocomplete_customers()
+ me.prepare_customer_mapper();
+ me.autocomplete_customers();
+ me.render_list_customers();
}
}
})
diff --git a/erpnext/accounts/page/pos/test_pos.js b/erpnext/accounts/page/pos/test_pos.js
index 8913a9e..e5524a2 100644
--- a/erpnext/accounts/page/pos/test_pos.js
+++ b/erpnext/accounts/page/pos/test_pos.js
@@ -6,6 +6,7 @@
() => {
return frappe.tests.make("POS Profile", [
{naming_series: "SINV"},
+ {pos_profile_name: "_Test POS Profile"},
{country: "India"},
{currency: "INR"},
{write_off_account: "Write Off - FT"},
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index bcec0a2..f655830 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -76,7 +76,7 @@
# shipping address
if party_type in ["Customer", "Lead"]:
- out.shipping_address_name = get_default_address(party_type, party.name, 'is_shipping_address')
+ out.shipping_address_name = get_party_shipping_address(party_type, party.name)
out.shipping_address = get_address_display(out["shipping_address_name"])
if doctype:
out.update(get_fetch_values(doctype, 'shipping_address_name', out.shipping_address_name))
@@ -176,29 +176,34 @@
if not company:
frappe.throw(_("Please select a Company"))
- if party:
+ if not party:
+ return
+
+ account = frappe.db.get_value("Party Account",
+ {"parenttype": party_type, "parent": party, "company": company}, "account")
+
+ if not account and party_type in ['Customer', 'Supplier']:
+ party_group_doctype = "Customer Group" if party_type=="Customer" else "Supplier Type"
+ group = frappe.db.get_value(party_type, party, scrub(party_group_doctype))
account = frappe.db.get_value("Party Account",
- {"parenttype": party_type, "parent": party, "company": company}, "account")
+ {"parenttype": party_group_doctype, "parent": group, "company": company}, "account")
- if not account and party_type in ['Customer', 'Supplier']:
- party_group_doctype = "Customer Group" if party_type=="Customer" else "Supplier Type"
- group = frappe.db.get_value(party_type, party, scrub(party_group_doctype))
- account = frappe.db.get_value("Party Account",
- {"parenttype": party_group_doctype, "parent": group, "company": company}, "account")
+ if not account and party_type in ['Customer', 'Supplier']:
+ default_account_name = "default_receivable_account" \
+ if party_type=="Customer" else "default_payable_account"
+ account = frappe.db.get_value("Company", company, default_account_name)
- if not account and party_type in ['Customer', 'Supplier']:
- default_account_name = "default_receivable_account" \
- if party_type=="Customer" else "default_payable_account"
- account = frappe.db.get_value("Company", company, default_account_name)
+ existing_gle_currency = get_party_gle_currency(party_type, party, company)
+ if existing_gle_currency:
+ if account:
+ account_currency = frappe.db.get_value("Account", account, "account_currency")
+ if (account and account_currency != existing_gle_currency) or not account:
+ account = get_party_gle_account(party_type, party, company)
- existing_gle_currency = get_party_gle_currency(party_type, party, company)
- if existing_gle_currency:
- if account:
- account_currency = frappe.db.get_value("Account", account, "account_currency")
- if (account and account_currency != existing_gle_currency) or not account:
- account = get_party_gle_account(party_type, party, company)
+ if not account:
+ frappe.throw(_("Party account not specified, please setup default party account in company"))
- return account
+ return account
def get_party_account_currency(party_type, party, company):
def generator():
@@ -418,3 +423,32 @@
info["total_unpaid"] = -1 * info["total_unpaid"]
return info
+
+
+def get_party_shipping_address(doctype, name):
+ """
+ Returns an Address name (best guess) for the given doctype and name for which `address_type == 'Shipping'` is true.
+ and/or `is_shipping_address = 1`.
+
+ It returns an empty string if there is no matching record.
+
+ :param doctype: Party Doctype
+ :param name: Party name
+ :return: String
+ """
+ out = frappe.db.sql(
+ 'SELECT dl.parent '
+ 'from `tabDynamic Link` dl join `tabAddress` ta on dl.parent=ta.name '
+ 'where '
+ 'dl.link_doctype=%s '
+ 'and dl.link_name=%s '
+ 'and dl.parenttype="Address" '
+ 'and '
+ '(ta.address_type="Shipping" or ta.is_shipping_address=1) '
+ 'order by ta.is_shipping_address desc, ta.address_type desc limit 1',
+ (doctype, name)
+ )
+ if out:
+ return out[0][0]
+ else:
+ return ''
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 56db392..ba5b7f2 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -309,14 +309,16 @@
rows = []
for d in data:
- rows.append(d[self.ageing_col_idx_start : self.ageing_col_idx_start+4])
-
- if rows:
- rows.insert(0, [[d.get("label")] for d in ageing_columns])
+ rows.append(
+ {
+ 'values': d[self.ageing_col_idx_start : self.ageing_col_idx_start+4]
+ }
+ )
return {
"data": {
- 'labels': rows
+ 'labels': [d.get("label") for d in ageing_columns],
+ 'datasets': rows
},
"type": 'percentage'
}
diff --git a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json
index f0399b0..08bbf8d 100644
--- a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json
+++ b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json
@@ -1,5 +1,5 @@
{
- "add_total_row": 0,
+ "add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-07-30 17:28:49",
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 3,
"is_standard": "Yes",
- "modified": "2017-02-24 20:20:20.613388",
+ "modified": "2017-11-06 13:04:36.338268",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Delivered Items To Be Billed",
diff --git a/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json
index db3c9d2..c983dc9 100644
--- a/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json
+++ b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json
@@ -1,5 +1,5 @@
{
- "add_total_row": 0,
+ "add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-02-21 14:26:44",
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 3,
"is_standard": "Yes",
- "modified": "2017-02-24 20:20:13.972178",
+ "modified": "2017-11-06 13:04:51.559061",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Ordered Items To Be Billed",
diff --git a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json
index 906481f..64eb984 100644
--- a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json
+++ b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json
@@ -1,5 +1,5 @@
{
- "add_total_row": 0,
+ "add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-07-30 18:35:10",
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 3,
"is_standard": "Yes",
- "modified": "2017-02-24 19:59:52.887744",
+ "modified": "2017-11-06 13:04:26.094432",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Received Items To Be Billed",
diff --git a/erpnext/accounts/report/sales_payment_summary/__init__.py b/erpnext/accounts/report/sales_payment_summary/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/report/sales_payment_summary/__init__.py
diff --git a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.js b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.js
new file mode 100644
index 0000000..6b46214
--- /dev/null
+++ b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.js
@@ -0,0 +1,57 @@
+// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+frappe.query_reports["Sales Payment Summary"] = {
+ "filters": [
+ {
+ "fieldname":"from_date",
+ "label": __("From Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today(),
+ "width": "80"
+ },
+ {
+ "fieldname":"to_date",
+ "label": __("To Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today()
+ },
+ {
+ "fieldname":"company",
+ "label": __("Company"),
+ "fieldtype": "Link",
+ "options": "Company",
+ "default": frappe.defaults.get_user_default("Company")
+ },
+ {
+ "fieldname":"mode_of_payment",
+ "label": __("Mode of Payment"),
+ "fieldtype": "Link",
+ "options": "Mode of Payment"
+ },
+ {
+ "fieldname":"owner",
+ "label": __("Owner"),
+ "fieldtype": "Link",
+ "options": "User",
+ "defaults": user
+ },
+ {
+ "fieldname":"cost_center",
+ "label": __("Cost Center"),
+ "fieldtype": "Link",
+ "options": "Cost Center"
+ },
+ {
+ "fieldname":"warehouse",
+ "label": __("Warehouse"),
+ "fieldtype": "Link",
+ "options": "Warehouse"
+ },
+ {
+ "fieldname":"is_pos",
+ "label": __("POS?"),
+ "fieldtype": "Check"
+ }
+ ]
+};
diff --git a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.json b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.json
new file mode 100644
index 0000000..8c6242f
--- /dev/null
+++ b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.json
@@ -0,0 +1,26 @@
+{
+ "add_total_row": 1,
+ "apply_user_permissions": 1,
+ "creation": "2017-11-03 16:31:45.757516",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2017-11-04 05:15:35.892659",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Payment Summary",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Sales Payment Summary",
+ "report_type": "Script Report",
+ "roles": [
+ {
+ "role": "Accounts Manager"
+ },
+ {
+ "role": "Accounts User"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py
new file mode 100644
index 0000000..bb80955
--- /dev/null
+++ b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py
@@ -0,0 +1,66 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+
+def execute(filters=None):
+ columns, data = [], []
+ columns=get_columns()
+ data=get_sales_payment_data(filters, columns)
+ return columns, data
+
+def get_columns():
+ return [
+ _("Date") + ":Date:80",
+ _("Owner") + "::150",
+ _("Payment Mode") + "::120",
+ _("Warehouse") + ":Link/Cost Center:100",
+ _("Cost Center") + ":Link/Warehouse:100",
+ _("Sales and Returns") + ":Currency/currency:120",
+ _("Taxes") + ":Currency/currency:120",
+ _("Payments") + ":Currency/currency:120",
+ _("Reconciliation") + ":Currency/currency:120"
+ ]
+
+def get_sales_payment_data(filters, columns):
+ sales_invoice_data = get_sales_invoice_data(filters)
+ data = []
+ for inv in sales_invoice_data:
+ row = [inv.posting_date, inv.owner, inv.mode_of_payment,inv.warehouse,
+ inv.cost_center,inv.net_total, inv.total_taxes, inv.paid_amount,
+ (inv.net_total + inv.total_taxes - inv.paid_amount)]
+ data.append(row)
+ return data
+
+def get_conditions(filters):
+ conditions = ""
+ if filters.get("company"): conditions += " a.company=%(company)s"
+ if filters.get("customer"): conditions += " and a.customer = %(customer)s"
+ if filters.get("owner"): conditions += " and a.owner = %(owner)s"
+ if filters.get("from_date"): conditions += " and a.posting_date >= %(from_date)s"
+ if filters.get("to_date"): conditions += " and a.posting_date <= %(to_date)s"
+ if filters.get("mode_of_payment"): conditions += " and c.mode_of_payment >= %(mode_of_payment)s"
+ if filters.get("warehouse"): conditions += " and b.warehouse <= %(warehouse)s"
+ if filters.get("cost_center"): conditions += " and b.cost_center <= %(cost_center)s"
+ if filters.get("is_pos"): conditions += " and a.is_pos = %(is_pos)s"
+
+ return conditions
+
+def get_sales_invoice_data(filters):
+ conditions = get_conditions(filters)
+ return frappe.db.sql("""
+ select
+ a.owner, a.posting_date, c.mode_of_payment, b.warehouse, b.cost_center,
+ sum(a.net_total) as "net_total",
+ sum(a.total_taxes_and_charges) as "total_taxes",
+ sum(a.base_paid_amount) as "paid_amount"
+ from `tabSales Invoice` a, `tabSales Invoice Item` b, `tabSales Invoice Payment` c
+ where
+ a.name = b.parent
+ and a.name = c.parent
+ and {conditions}
+ group by
+ a.owner, a.posting_date, c.mode_of_payment, b.warehouse, b.cost_center
+ """.format(conditions=conditions), filters, as_dict=1)
\ No newline at end of file
diff --git a/erpnext/accounts/test/__init__.py b/erpnext/accounts/test/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/test/__init__.py
diff --git a/erpnext/accounts/test/test_utils.py b/erpnext/accounts/test/test_utils.py
new file mode 100644
index 0000000..0fca470
--- /dev/null
+++ b/erpnext/accounts/test/test_utils.py
@@ -0,0 +1,84 @@
+import unittest
+from erpnext.accounts.party import get_party_shipping_address
+from frappe.test_runner import make_test_objects
+
+
+class TestUtils(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ super(TestUtils, cls).setUpClass()
+ make_test_objects('Address', ADDRESS_RECORDS)
+
+ def test_get_party_shipping_address(self):
+ address = get_party_shipping_address('Customer', '_Test Customer 1')
+ self.assertEqual(address, '_Test Billing Address 2 Title-Billing')
+
+ def test_get_party_shipping_address2(self):
+ address = get_party_shipping_address('Customer', '_Test Customer 2')
+ self.assertEqual(address, '_Test Shipping Address 2 Title-Shipping')
+
+
+ADDRESS_RECORDS = [
+ {
+ "doctype": "Address",
+ "address_type": "Billing",
+ "address_line1": "Address line 1",
+ "address_title": "_Test Billing Address Title",
+ "city": "Lagos",
+ "country": "Nigeria",
+ "links": [
+ {
+ "link_doctype": "Customer",
+ "link_name": "_Test Customer 2",
+ "doctype": "Dynamic Link"
+ }
+ ]
+ },
+ {
+ "doctype": "Address",
+ "address_type": "Shipping",
+ "address_line1": "Address line 2",
+ "address_title": "_Test Shipping Address 1 Title",
+ "city": "Lagos",
+ "country": "Nigeria",
+ "links": [
+ {
+ "link_doctype": "Customer",
+ "link_name": "_Test Customer 2",
+ "doctype": "Dynamic Link"
+ }
+ ]
+ },
+ {
+ "doctype": "Address",
+ "address_type": "Shipping",
+ "address_line1": "Address line 3",
+ "address_title": "_Test Shipping Address 2 Title",
+ "city": "Lagos",
+ "country": "Nigeria",
+ "is_shipping_address": "1",
+ "links": [
+ {
+ "link_doctype": "Customer",
+ "link_name": "_Test Customer 2",
+ "doctype": "Dynamic Link"
+ }
+ ]
+ },
+ {
+ "doctype": "Address",
+ "address_type": "Billing",
+ "address_line1": "Address line 4",
+ "address_title": "_Test Billing Address 2 Title",
+ "city": "Lagos",
+ "country": "Nigeria",
+ "is_shipping_address": "1",
+ "links": [
+ {
+ "link_doctype": "Customer",
+ "link_name": "_Test Customer 1",
+ "doctype": "Dynamic Link"
+ }
+ ]
+ }
+]
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 50530f5..a8fd5e9 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -593,7 +593,7 @@
select ifnull(sum({payment_dr_or_cr}), 0)
from `tabGL Entry` payment_gl_entry
where payment_gl_entry.against_voucher_type = invoice_gl_entry.voucher_type
- and payment_gl_entry.against_voucher = invoice_gl_entry.voucher_no
+ and payment_gl_entry.against_voucher = invoice_gl_entry.against_voucher
and payment_gl_entry.party_type = invoice_gl_entry.party_type
and payment_gl_entry.party = invoice_gl_entry.party
and payment_gl_entry.account = invoice_gl_entry.account
@@ -630,7 +630,7 @@
'invoice_amount': flt(d.invoice_amount),
'payment_amount': flt(d.payment_amount),
'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision),
- 'due_date': frappe.db.get_value(d.voucher_type, d.voucher_no,
+ 'due_date': frappe.db.get_value(d.voucher_type, d.voucher_no,
"posting_date" if party_type=="Employee" else "due_date"),
}))
@@ -656,16 +656,14 @@
order_by="name")]
@frappe.whitelist()
-def get_children():
+def get_children(doctype, parent, company, is_root=False):
from erpnext.accounts.report.financial_statements import sort_root_accounts
- args = frappe.local.form_dict
- doctype, company = args['doctype'], args['company']
fieldname = frappe.db.escape(doctype.lower().replace(' ','_'))
doctype = frappe.db.escape(doctype)
# root
- if args['parent'] in ("Accounts", "Cost Centers"):
+ if is_root:
fields = ", root_type, report_type, account_currency" if doctype=="Account" else ""
acc = frappe.db.sql(""" select
name as value, is_group as expandable {fields}
@@ -675,7 +673,7 @@
order by name""".format(fields=fields, fieldname = fieldname, doctype=doctype),
company, as_dict=1)
- if args["parent"]=="Accounts":
+ if parent=="Accounts":
sort_root_accounts(acc)
else:
# other
@@ -686,7 +684,7 @@
where ifnull(`parent_{fieldname}`,'') = %s
and docstatus<2
order by name""".format(fields=fields, fieldname=fieldname, doctype=doctype),
- args['parent'], as_dict=1)
+ parent, as_dict=1)
if doctype == 'Account':
company_currency = frappe.db.get_value("Company", company, "default_currency")
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 28b8b47..534af8b 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -2950,416 +2950,11 @@
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "subscription",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Subscription",
- "length": 0,
- "no_copy": 1,
- "options": "Subscription",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "is_recurring",
- "columns": 0,
- "depends_on": "eval:doc.docstatus<2 && !doc.__islocal",
- "fieldname": "recurring_order",
- "fieldtype": "Section Break",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Order",
- "length": 0,
- "no_copy": 0,
- "options": "fa fa-time",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Settings",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:doc.docstatus<2",
- "description": "",
- "fieldname": "is_recurring",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Recurring",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_recurring",
- "description": "",
- "fieldname": "recurring_id",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Reference Document",
- "length": 0,
- "no_copy": 1,
- "options": "Purchase Order",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "recurring_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Frequency",
- "length": 0,
- "no_copy": 1,
- "options": "Monthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "repeat_on_day_of_month",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Repeat on Day of Month",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "End Date",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "fieldname": "submit_on_creation",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Submit on creation",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "notify_by_email",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Notify by email",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "notification_email_address",
- "fieldtype": "Code",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Notification Email Address",
- "length": 0,
- "no_copy": 1,
- "options": "Email",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name",
- "fieldname": "recurring_print_format",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Print Format",
- "length": 0,
- "no_copy": 0,
- "options": "Print Format",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break83",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "This Document",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_recurring",
+ "depends_on": "",
"description": "",
"fieldname": "from_date",
"fieldtype": "Date",
@@ -3390,7 +2985,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "is_recurring",
+ "depends_on": "",
"description": "",
"fieldname": "to_date",
"fieldtype": "Date",
@@ -3421,10 +3016,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "is_recurring",
- "description": "",
- "fieldname": "next_date",
- "fieldtype": "Date",
+ "fieldname": "column_break_97",
+ "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -3432,11 +3025,11 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Next Date",
"length": 0,
- "no_copy": 1,
+ "no_copy": 0,
"permlevel": 0,
- "print_hide": 1,
+ "precision": "",
+ "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -3445,6 +3038,37 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "subscription",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Subscription",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Subscription",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
}
],
"has_web_view": 0,
@@ -3458,7 +3082,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-05 14:19:04.102534",
+ "modified": "2017-10-24 12:52:11.272306",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
diff --git a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
index 6605a65..5d19687 100644
--- a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
@@ -1,7 +1,7 @@
QUnit.module('Buying');
QUnit.test("test: purchase order", function(assert) {
- assert.expect(11);
+ assert.expect(16);
let done = assert.async();
frappe.run_serially([
@@ -40,7 +40,6 @@
// Get supplier details
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
assert.ok(cur_frm.doc.schedule_date == frappe.datetime.add_days(frappe.datetime.now_date(), 1), "Schedule Date correct");
- assert.ok($('div.control-value.like-disabled-input.for-description').text().includes('Contact 3'), "Contact display correct");
assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Contact email correct");
// Get item details
assert.ok(cur_frm.doc.items[0].item_name == 'Test Product 4', "Item name correct");
@@ -53,7 +52,7 @@
assert.ok(cur_frm.doc.items[1].qty == 2, "Quantity correct");
assert.ok(cur_frm.doc.items[1].schedule_date == cur_frm.doc.schedule_date, "Schedule Date correct");
// Calculate total
- assert.ok(cur_frm.doc.total == 500, "Total correct");
+ assert.ok(cur_frm.doc.total == 700, "Total correct");
// Get terms
assert.ok(cur_frm.doc.terms == 'This is a term.', "Terms correct");
},
@@ -70,7 +69,7 @@
() => frappe.tests.click_button('Submit'),
() => frappe.tests.click_button('Yes'),
- () => frappe.timeout(0.3),
+ () => frappe.timeout(1),
() => {
assert.ok(cur_frm.doc.status == 'To Receive and Bill', "Submitted successfully");
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
index 5becb82..97c4438 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
@@ -138,7 +138,7 @@
'user_fullname': full_name
}
- subject = _("Request for Quotation: {0}".format(self.name))
+ subject = _("Request for Quotation")
template = "templates/emails/request_for_quotation.html"
sender = frappe.session.user not in STANDARD_USERS and frappe.session.user or None
message = frappe.get_template(template).render(args)
diff --git a/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js
index a4d68aa..1fcfe75 100644
--- a/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js
@@ -27,6 +27,7 @@
{tc_name: 'Test Term 1'}
]);
},
+ () => frappe.timeout(3),
() => {
assert.ok(cur_frm.doc.transaction_date == date, "Date correct");
assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct");
@@ -38,7 +39,7 @@
assert.ok(cur_frm.doc.message_for_supplier == 'Please supply the specified items at the best possible rates', "Reply correct");
assert.ok(cur_frm.doc.tc_name == 'Test Term 1', "Term name correct");
},
- () => frappe.timeout(0.3),
+ () => frappe.timeout(3),
() => cur_frm.print_doc(),
() => frappe.timeout(1),
() => {
@@ -65,7 +66,7 @@
assert.ok(cur_frm.doc.docstatus == 1, "Quotation request submitted");
},
() => frappe.click_button('Send Supplier Emails'),
- () => frappe.timeout(4),
+ () => frappe.timeout(6),
() => {
assert.ok($('div.modal.fade.in > div.modal-dialog > div > div.modal-body.ui-front > div.msgprint').text().includes("Email sent to supplier Test Supplier"), "Send emails working");
},
diff --git a/erpnext/buying/doctype/supplier/test_supplier.js b/erpnext/buying/doctype/supplier/test_supplier.js
index 99a5bc6..05ea044 100644
--- a/erpnext/buying/doctype/supplier/test_supplier.js
+++ b/erpnext/buying/doctype/supplier/test_supplier.js
@@ -56,7 +56,8 @@
() => frappe.click_button('New Contact'),
() => {
return frappe.tests.set_form_values(cur_frm, [
- {first_name: "Contact 3"}
+ {first_name: "Contact 3"},
+ {email_id: "test@supplier.com"}
]);
},
() => cur_frm.save(),
diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js
deleted file mode 100644
index 7097a6d..0000000
--- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Supplier Quotation", function (assert) {
- let done = assert.async();
-
- // number of asserts
- assert.expect(1);
-
- frappe.run_serially('Supplier Quotation', [
- // insert a new Supplier Quotation
- () => frappe.tests.make([
- // values to be set
- {key: 'value'}
- ]),
- () => {
- assert.equal(cur_frm.doc.key, 'value');
- },
- () => done()
- ]);
-
-});
diff --git a/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
index 76be06c..2d2b29c 100644
--- a/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
+++ b/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
@@ -27,12 +27,13 @@
{terms: 'This is a term'}
]);
},
+ () => frappe.timeout(3),
() => {
// Get Supplier details
assert.ok(cur_frm.doc.supplier == 'Test Supplier', "Supplier correct");
assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct");
// Get Contact details
- assert.ok(cur_frm.doc.contact_display == 'Contact 3', "Conatct correct");
+ assert.ok(cur_frm.doc.contact_person == 'Contact 3-Test Supplier', "Conatct correct");
assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Email correct");
// Get uom
assert.ok(cur_frm.doc.items[0].uom == 'Unit', "Multi uom correct");
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index cdce13b..58fb2f0 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -468,6 +468,12 @@
"name": "Customer Credit Balance",
"doctype": "Customer"
},
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Sales Payment Summary",
+ "doctype": "Sales Invoice"
+ }
]
},
{
diff --git a/erpnext/config/hr.py b/erpnext/config/hr.py
index 43f625a..ec281bb 100644
--- a/erpnext/config/hr.py
+++ b/erpnext/config/hr.py
@@ -178,6 +178,10 @@
"items": [
{
"type": "doctype",
+ "name": "Training Program"
+ },
+ {
+ "type": "doctype",
"name": "Training Event"
},
{
diff --git a/erpnext/config/projects.py b/erpnext/config/projects.py
index a8514b2..b97e097 100644
--- a/erpnext/config/projects.py
+++ b/erpnext/config/projects.py
@@ -15,6 +15,7 @@
{
"type": "doctype",
"name": "Task",
+ "route": "Tree/Task",
"description": _("Project activity / task."),
},
{
diff --git a/erpnext/config/schools.py b/erpnext/config/schools.py
index dbdcd35..1e7d1b0 100644
--- a/erpnext/config/schools.py
+++ b/erpnext/config/schools.py
@@ -124,10 +124,6 @@
},
{
"type": "doctype",
- "name": "Grading Scale"
- },
- {
- "type": "doctype",
"name": "Assessment Criteria"
},
{
@@ -144,6 +140,12 @@
"name": "Course wise Assessment Report",
"doctype": "Assessment Result"
},
+ {
+ "type": "report",
+ "is_query_report": True,
+ "name": "Assessment Plan Status",
+ "doctype": "Assessment Plan"
+ },
]
},
@@ -203,6 +205,10 @@
},
{
"type": "doctype",
+ "name": "Grading Scale"
+ },
+ {
+ "type": "doctype",
"name": "Academic Term"
},
{
diff --git a/erpnext/config/stock.py b/erpnext/config/stock.py
index d6b18fd..cb17deb 100644
--- a/erpnext/config/stock.py
+++ b/erpnext/config/stock.py
@@ -9,22 +9,18 @@
{
"type": "doctype",
"name": "Stock Entry",
- "description": _("Record item movement."),
},
{
"type": "doctype",
"name": "Delivery Note",
- "description": _("Shipments to customers."),
},
{
"type": "doctype",
"name": "Purchase Receipt",
- "description": _("Goods received from Suppliers."),
},
{
"type": "doctype",
"name": "Material Request",
- "description": _("Requests for items."),
},
]
},
@@ -69,17 +65,14 @@
{
"type": "doctype",
"name": "Item",
- "description": _("All Products or Services."),
},
{
"type": "doctype",
"name": "Product Bundle",
- "description": _("Bundle items at time of sale."),
},
{
"type": "doctype",
"name": "Price List",
- "description": _("Price List master.")
},
{
"type": "doctype",
@@ -87,30 +80,24 @@
"icon": "fa fa-sitemap",
"label": _("Item Group"),
"link": "Tree/Item Group",
- "description": _("Tree of Item Groups."),
},
{
"type": "doctype",
"name": "Item Price",
- "description": _("Multiple Item prices."),
"route": "Report/Item Price"
},
{
"type": "doctype",
"name": "Shipping Rule",
- "description": _("Rules for adding shipping costs.")
},
{
"type": "doctype",
"name": "Pricing Rule",
- "description": _("Rules for applying pricing and discount.")
},
{
"type": "doctype",
"name": "Item Variant Settings",
- "description": _("Item Variant Settings."),
},
-
]
},
{
@@ -119,17 +106,14 @@
{
"type": "doctype",
"name": "Serial No",
- "description": _("Single unit of an Item."),
},
{
"type": "doctype",
"name": "Batch",
- "description": _("Batch (lot) of an Item."),
},
{
"type": "doctype",
"name": "Installation Note",
- "description": _("Installation record for a Serial No.")
},
{
"type": "report",
@@ -155,22 +139,18 @@
{
"type": "doctype",
"name": "Stock Reconciliation",
- "description": _("Upload stock balance via csv.")
},
{
"type": "doctype",
"name": "Packing Slip",
- "description": _("Split Delivery Note into packages.")
},
{
"type": "doctype",
"name": "Quality Inspection",
- "description": _("Incoming quality inspection.")
},
{
"type": "doctype",
"name": "Landed Cost Voucher",
- "description": _("Update additional costs to calculate landed cost of items"),
}
]
},
@@ -181,28 +161,27 @@
{
"type": "doctype",
"name": "Stock Settings",
- "description": _("Default settings for stock transactions.")
},
{
"type": "doctype",
"name": "Warehouse",
- "description": _("Where items are stored."),
},
{
"type": "doctype",
"name": "UOM",
"label": _("Unit of Measure") + " (UOM)",
- "description": _("e.g. Kg, Unit, Nos, m")
},
{
"type": "doctype",
"name": "Item Attribute",
- "description": _("Attributes for Item Variants. e.g Size, Color etc."),
},
{
"type": "doctype",
"name": "Brand",
- "description": _("Brand master.")
+ },
+ {
+ "type": "doctype",
+ "name": "Item Variant Settings",
},
]
},
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index ebd45c4..d3f6d38 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -209,10 +209,10 @@
tax_master_doctype = self.meta.get_field("taxes_and_charges").options
- if not self.get("taxes"):
+ if self.is_new() and not self.get("taxes"):
if not self.get("taxes_and_charges"):
# get the default tax master
- self.set("taxes_and_charges", frappe.db.get_value(tax_master_doctype, {"is_default": 1}))
+ self.taxes_and_charges = frappe.db.get_value(tax_master_doctype, {"is_default": 1})
self.append_taxes_from_master(tax_master_doctype)
@@ -608,7 +608,10 @@
@frappe.whitelist()
def get_default_taxes_and_charges(master_doctype):
default_tax = frappe.db.get_value(master_doctype, {"is_default": 1})
- return get_taxes_and_charges(master_doctype, default_tax)
+ return {
+ 'taxes_and_charges': default_tax,
+ 'taxes': get_taxes_and_charges(master_doctype, default_tax)
+ }
@frappe.whitelist()
def get_taxes_and_charges(master_doctype, master_name):
diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index 8ca4f70..821c81c 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -201,14 +201,16 @@
variant.variant_of = item.name
variant.has_variants = 0
if not variant.description:
- variant.description = ''
+ variant.description = ""
if item.variant_based_on=='Item Attribute':
if variant.attributes:
- if not variant.description:
- variant.description += "\n"
- for d in variant.attributes:
- variant.description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
+ attributes_description = ""
+ for d in variant.attributes:
+ attributes_description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
+
+ if attributes_description not in variant.description:
+ variant.description += attributes_description
def make_variant_item_code(template_item_code, template_item_name, variant):
"""Uses template's item code and abbreviations to make variant's item code"""
@@ -237,3 +239,20 @@
if abbreviations:
variant.item_code = "{0}-{1}".format(template_item_code, "-".join(abbreviations))
variant.item_name = "{0}-{1}".format(template_item_name, "-".join(abbreviations))
+
+@frappe.whitelist()
+def create_variant_doc_for_quick_entry(template, args):
+ variant_based_on = frappe.db.get_value("Item", template, "variant_based_on")
+ args = json.loads(args)
+ if variant_based_on == "Manufacturer":
+ variant = get_variant(template, **args)
+ else:
+ existing_variant = get_variant(template, args)
+ if existing_variant:
+ return existing_variant
+ else:
+ variant = create_variant(template, args=args)
+ variant.name = variant.item_code
+ validate_item_variant_attributes(variant, args)
+ return variant.as_dict()
+
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index b1618d5..353721e 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -204,8 +204,8 @@
{
'txt': "%%%s%%" % frappe.db.escape(txt),
'_txt': txt.replace("%", ""),
- 'start': start,
- 'page_len': page_len
+ 'start': start or 0,
+ 'page_len': page_len or 20
})
def get_project_name(doctype, txt, searchfield, start, page_len, filters):
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index 970fd57..e9a7baa 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -48,16 +48,16 @@
# check if customer is already created agains the self.contact_email
customer = frappe.db.sql("""select
distinct `tabDynamic Link`.link_name as customer
- from
+ from
`tabContact`,
`tabDynamic Link`
where `tabContact`.email_id='{0}'
- and
+ and
`tabContact`.name=`tabDynamic Link`.parent
and
- ifnull(`tabDynamic Link`.link_name, '')<>''
- and
- `tabDynamic Link`.link_doctype='Customer'
+ ifnull(`tabDynamic Link`.link_name, '')<>''
+ and
+ `tabDynamic Link`.link_doctype='Customer'
""".format(self.contact_email), as_dict=True)
if customer and customer[0].customer:
self.customer = customer[0].customer
@@ -118,9 +118,9 @@
def has_ordered_quotation(self):
return frappe.db.sql("""
- select q.name
+ select q.name
from `tabQuotation` q, `tabQuotation Item` qi
- where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s
+ where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s
and q.status = 'Ordered'""", self.name)
def has_lost_quotation(self):
@@ -233,8 +233,8 @@
# get default taxes
taxes = get_default_taxes_and_charges("Sales Taxes and Charges Template")
- if taxes:
- quotation.extend("taxes", taxes)
+ if taxes.get('taxes'):
+ quotation.update(taxes)
quotation.run_method("set_missing_values")
quotation.run_method("calculate_taxes_and_totals")
diff --git a/erpnext/docs/assets/img/human-resources/training_event.png b/erpnext/docs/assets/img/human-resources/training_event.png
index 04162eb..bd1d6dc 100644
--- a/erpnext/docs/assets/img/human-resources/training_event.png
+++ b/erpnext/docs/assets/img/human-resources/training_event.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/training_program.png b/erpnext/docs/assets/img/human-resources/training_program.png
new file mode 100644
index 0000000..97bd2bf
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/training_program.png
Binary files differ
diff --git a/erpnext/docs/user/manual/en/customize-erpnext/articles/field-types.md b/erpnext/docs/user/manual/en/customize-erpnext/articles/field-types.md
index 24cb4ab..c73ebc7 100644
--- a/erpnext/docs/user/manual/en/customize-erpnext/articles/field-types.md
+++ b/erpnext/docs/user/manual/en/customize-erpnext/articles/field-types.md
@@ -56,6 +56,17 @@
Link field is connected to another master from where it fetches data. For example, in the Quotation master, Customer is a Link field.
+- Geolocation
+
+Use Geolocation field to store GeoJSON <a href="https://tools.ietf.org/html/rfc7946#section-3.3">featurecollection</a>. Stores polygons, lines and points. Internally it uses following custom properties for identifying a circle.
+
+```
+{
+ "point_type": "circle",
+ "radius": 10.00
+}
+```
+
- Password
Password field will have decode value in it.
@@ -84,4 +95,4 @@
Text Editor is text field. It has text-formatting options. In ERPNext, this field is generally used for defining Terms and Conditions.
-<!-- markdown -->
\ No newline at end of file
+<!-- markdown -->
diff --git a/erpnext/docs/user/manual/en/human-resources/training.md b/erpnext/docs/user/manual/en/human-resources/training.md
index 2aa0679..4d39bf1 100644
--- a/erpnext/docs/user/manual/en/human-resources/training.md
+++ b/erpnext/docs/user/manual/en/human-resources/training.md
@@ -1,8 +1,13 @@
# Training
+### Training Program
+
+Create Training Program and schedule Training Events under it. It has a dashboard linked to Training Event to view which event is under the Training Program.
+
+<img class="screenshot" alt="Employee" src="/docs/assets/img/human-resources/training_program.png">
### Training Event
-Schedule seminars, workshops, conferences etc using Training Event. You can also invite your employees to attend the event using this feature.
+Schedule seminars, workshops, conferences etc using Training Event linked to a Training Program. You can also invite your employees to attend the event using this feature.
<img class="screenshot" alt="Employee" src="/docs/assets/img/human-resources/training_event.png">
@@ -14,11 +19,11 @@
<img class="screenshot" alt="Employee" src="/docs/assets/img/human-resources/training_event_employee.png">
-When you submit the Training Event, a notifcation will be sent to the employee notifying that the Training has been scheduled. This is sent via Email Alert "Training Scheduled". You can modifiy this Email Alert to customize the message.
+When you submit the Training Event, a notification will be sent to the employee notifying that the Training has been scheduled. This is sent via Email Alert "Training Scheduled". You can modify this Email Alert to customize the message.
### Training Result
-After compleation of the training Employee-wise training results can be stored based on the Feedback received from the Trainer.
+After completion of the training Employee-wise training results can be stored based on the Feedback received from the Trainer.
<img class="screenshot" alt="Employee" src="/docs/assets/img/human-resources/training_result.png">
diff --git a/erpnext/docs/user/manual/en/stock/item/index.txt b/erpnext/docs/user/manual/en/stock/item/index.txt
index 4e66875..db5fa0a 100644
--- a/erpnext/docs/user/manual/en/stock/item/index.txt
+++ b/erpnext/docs/user/manual/en/stock/item/index.txt
@@ -4,3 +4,4 @@
purchase-details
reorder
item-valuation-fifo-and-moving-average
+item-settings
diff --git a/erpnext/docs/user/manual/en/stock/setup/stock-settings.md b/erpnext/docs/user/manual/en/stock/setup/stock-settings.md
index 32562c6..96d1627 100644
--- a/erpnext/docs/user/manual/en/stock/setup/stock-settings.md
+++ b/erpnext/docs/user/manual/en/stock/setup/stock-settings.md
@@ -4,4 +4,12 @@
<img class="screenshot" alt="Stock Settings" src="/docs/assets/img/stock/stock-settings.png">
+### Clean HTML Description
+
+Usually descriptions are copy-pasted from a website or Word / PDF file and they contain a lot of embedded style. This messes up the Print view of your invoices or quotes.
+
+To fix this, you can check "Convert Item Description to Clean HTML" in Stock Settings. This will ensure that when you save your Items, their descriptions will be cleaned up.
+
+If you want control your description views and llow any HTML to be embedded, you can uncheck this property.
+
{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/index.txt b/erpnext/docs/user/manual/es/index.txt
index feb68a2..00cf97b 100644
--- a/erpnext/docs/user/manual/es/index.txt
+++ b/erpnext/docs/user/manual/es/index.txt
@@ -1,3 +1,4 @@
introduction
accounts
+projects
schools
diff --git a/erpnext/docs/user/manual/es/projects/__init__.py b/erpnext/docs/user/manual/es/projects/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/__init__.py
diff --git a/erpnext/docs/user/manual/es/projects/activity-cost.md b/erpnext/docs/user/manual/es/projects/activity-cost.md
new file mode 100644
index 0000000..71eb15e
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/activity-cost.md
@@ -0,0 +1,6 @@
+# Costo de Actividad
+
+El costo de la actividad registra la tasa de facturación por hora y la tasa de costos de un empleado en comparación con un tipo de actividad.
+El sistema hace uso de esta tasa mientras hace registros de tiempo. Se usa para Costeo de proyectos.
+
+<img class="screenshot" alt="Activity Cost" src="/docs/assets/img/project/activity_cost.png">
diff --git a/erpnext/docs/user/manual/es/projects/activity-type.md b/erpnext/docs/user/manual/es/projects/activity-type.md
new file mode 100644
index 0000000..20a03e2
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/activity-type.md
@@ -0,0 +1,15 @@
+# Tipo de Actividad
+
+Los tipos de actividad son la lista de los diferentes tipos de actividades sobre las que se hacen registro de tiempo.
+
+<img class="screenshot" alt="Activity Type" src="/docs/assets/img/project/activity_type.png">
+
+Por defecto, los siguientes tipos de actividades son creados.
+
+* Planning
+* Research
+* Proposal Writing
+* Execution
+* Communication
+
+{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/articles/__init__.py b/erpnext/docs/user/manual/es/projects/articles/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/articles/__init__.py
diff --git a/erpnext/docs/user/manual/es/projects/articles/index.md b/erpnext/docs/user/manual/es/projects/articles/index.md
new file mode 100644
index 0000000..2d959ec
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/articles/index.md
@@ -0,0 +1,3 @@
+# Artículos
+
+{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/articles/index.txt b/erpnext/docs/user/manual/es/projects/articles/index.txt
new file mode 100644
index 0000000..56c193c
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/articles/index.txt
@@ -0,0 +1 @@
+project-costing
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/articles/project-costing.md b/erpnext/docs/user/manual/es/projects/articles/project-costing.md
new file mode 100644
index 0000000..a8820c7
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/articles/project-costing.md
@@ -0,0 +1,40 @@
+# Costeo de proyectos
+
+Cada proyecto tiene multiples tareas asociadas a el. Para hacer el seguimiento del costo actual de un proyecto, primeramente en términos de servicios, el usuario
+tiene que crear un registro de tiempo basado en el tiempo que invirtió en una tarea del proyecto. Siguiendo los pasos de como puedes hacer el seguimiento del costo actual de un servicio usando el proyecto.
+
+#### Tipo de actividad
+
+Tipo de actividad es un maestro de los servicios ofrecidos por su personal. Puedes agregar un nuevo Tipo de Actividad desde:
+
+`Project > Activity Type > New`
+
+#### Costo de actividad
+
+Costo de actividad es un maestro donde puedes hacer el seguimiento de los montos de facturación y costo de cada empleado, y por cada tipo de Tipo de Actividad.
+
+<img alt="Activity Cost" class="screenshot" src="/docs/assets/img/articles/Screen Shot 2015-06-11 at 4.57.01 pm.png">
+
+#### Registro de Tiempo
+
+Basados en el tiempo actual invertido en una Tarea del Proyecto, El empleado va a crear un registro de tiempo.
+
+<img alt="Time Log" class="screenshot" src="/docs/assets/img/articles/Screen Shot 2015-06-11 at 4.59.49 pm.png">
+
+Al momento de seleccionar el Tipo de Actividad en el Registro de tiempo, el monto de Facturación y Costo del empleado va a ser traído de su respectivo registro en el master de Costo de Actividad.
+
+<img alt="Time Log Costing" class="screenshot" src="/docs/assets/img/articles/Screen Shot 2015-06-11 at 5.00.06 pm.png">
+
+Multiplicando esos montos con el total de número de horas en el registro de tiempo, nos da el monto de costos y Facturación para el registro de tiempo específico.
+
+#### Costeo en Proyectos y Tareas
+
+Basados en el total de registros de tiempos creados por una tarea en específico, su costo va a ser actualizado en el registro maestro de la tarea, o sea, en el detalle de la tarea.
+
+<img alt="Costing in Task" class="screenshot" src="/docs/assets/img/articles/Screen Shot 2015-06-11 at 5.02.54 pm.png">
+
+De la misma manera, el detalle del Proyecto va a actualizar su costo basado en el total de registros de tiempo a ese proyecto, y las tareas asociadas a ese proyecto.
+
+<img alt="Costing in Project" class="screenshot" src="/docs/assets/img/articles/Screen Shot 2015-06-11 at 5.02.29 pm.png">
+
+<!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/index.md b/erpnext/docs/user/manual/es/projects/index.md
new file mode 100644
index 0000000..0882752
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/index.md
@@ -0,0 +1,15 @@
+# Proyectos
+
+ERPNext le ayuda en la administración de su proyecto a traves de la creacion de tareas y
+poder asignarlas a diferentes personas.
+
+Las compras y las ventas también se pueden rastrear en relación con los proyectos y
+esto puede ayudar a la empresa a controlar su presupuesto, entrega y rentabilidad para un proyecto.
+
+Los proyectos pueden ser usados para manejar los proyectos internos, trabajos de manufacturación y
+planificación de servicios. Para los trabajos de servicios, los Time Sheets (hojas de tiempo) pueden ser creadas
+para facturar a los clientes, en caso que el proceso de facturación se haga basado en tiempo y dinero de tareas.
+
+### Temas
+
+{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/index.txt b/erpnext/docs/user/manual/es/projects/index.txt
new file mode 100644
index 0000000..716ec1fe
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/index.txt
@@ -0,0 +1,7 @@
+tasks
+project
+time-log-batch
+activity-type
+activity-cost
+articles
+timesheet
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/project.md b/erpnext/docs/user/manual/es/projects/project.md
new file mode 100644
index 0000000..942433b
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/project.md
@@ -0,0 +1,110 @@
+# Proyecto
+
+El manejo de proyectos en ERPNext se hace a traves de tareas. Puedes crear un proyecto y asignar varias tareas al mismo.
+
+<img class="screenshot" alt="Project" src="/docs/assets/img/project/project.png">
+
+También puedes hacer el seguimiento del % completado del proyecto usando diferentes métodos.
+
+ 1. Tareas Completadas
+ 2. Progreso de tareas
+ 3. Peso de tarea
+
+<img class="screenshot" alt="Project" src="/docs/assets/img/project/project-percent-complete.png">
+
+Algunos ejemplos de como el % completado es cálculado basado en tareas.
+
+<img class="screenshot" alt="Project" src="/docs/assets/img/project/percent-complete-calc.png">
+
+<img class="screenshot" alt="Project" src="/docs/assets/img/project/percent-complete-formula.png">
+
+### Manejando tareas
+
+Los proyecto pueden ser divididos en multiples tareas.
+Las tareas pueden ser creadas a traves del documento de Proyecto o pueden ser creadas via [Tarea](/docs/user/manual/en/projects/tasks.html)
+
+<img class="screenshot" alt="Project" src="/docs/assets/img/project/project_task.png">
+
+* Para ver las tareas creadas a un proyecto click en 'Tasks'
+
+<img class="screenshot" alt="Project - View Task" src="/docs/assets/img/project/project_view_task.png">
+
+<img class="screenshot" alt="Project - Task List" src="/docs/assets/img/project/project_task_list.png">
+
+* También puedes ver las tareas desde la misma vista del proyecto.
+
+<img class="screenshot" alt="Project - Task Grid" src="/docs/assets/img/project/project_task_grid.png">
+
+* Para agregar peso a las tareas puedes seguir los pasos siguientes
+
+<img class="screenshot" alt="Project - Task Grid" src="/docs/assets/img/project/tasks.png">
+<img class="screenshot" alt="Project - Task Grid" src="/docs/assets/img/project/task-weights.png">
+
+
+### Manejando tiempo
+
+ERPNext usa [Time Log](/docs/user/manual/en/projects/time-log.html) para hacer el seguimiento del progreso de un Proyecto.
+Puedes crear registros de tiempo sobre cada Tarea.
+El tiempo actual de inicio y finalización junto con el costo deben ser actualizados basados en los Registros de Tiempo.
+
+* Para ver los Registros de Tiempo realizados a un proyecto, dar click en 'Time Logs'
+
+<img class="screenshot" alt="Project - View Time Log" src="/docs/assets/img/project/project_view_time_log.png">
+
+<img class="screenshot" alt="Project - Time Log List" src="/docs/assets/img/project/project_time_log_list.png">
+
+* Puedes agregar un registro de tiempo directamente y luego asociarlo con el proyecto.
+
+<img class="screenshot" alt="Project - Link Time Log" src="/docs/assets/img/project/project_time_log_link.png">
+
+### Gestión de gastos
+
+Puede reservar la [Reclamación de gastos](/docs/user/manual/en/human-resources/expense-claim.html) contra una tarea de proyecto.
+El sistema actualizará el monto total de las reclamaciones de gastos en la sección de costos del proyecto.
+
+* Para ver las reclamaciones de gastos realizadas en un proyecto, haga clic en 'Reclamaciones de gastos'
+
+<img class="screenshot" alt="Project - View Expense Claim" src="/docs/assets/img/project/project_view_expense_claim.png">
+
+* También puede crear un Reclamo de gastos directamente y vincularlo al Proyecto.
+
+<img class="screenshot" alt="Project - Link Expense Claim" src="/docs/assets/img/project/project_expense_claim_link.png">
+
+* El monto total de los Reclamos de gastos reservados contra un proyecto se muestra en 'Reclamo de gastos totales' en la Sección de Costos del proyecto
+
+<img class="screenshot" alt="Project - Total Expense Claim" src="/docs/assets/img/project/project_total_expense_claim.png">
+
+### Centro de Costo
+
+Puedes crear un [Cost Center](/docs/user/manual/en/accounts/setup/cost-center.html) sobre un proyecto o usar un centro de costo existente para hacer el seguimiento de todos los gastos realizados al proyecto.
+
+<img class="screenshot" alt="Project - Cost Center" src="/docs/assets/img/project/project_cost_center.png">
+
+###Costeo del proyecto
+
+La sección Costeo del proyecto le ayuda a rastrear el tiempo y los gastos incurridos en relación con el proyecto.
+
+<img class="screenshot" alt="Project - Costing" src="/docs/assets/img/project/project_costing.png">
+
+* La sección de cálculo de costos se actualiza según los registros de tiempo realizados.
+
+* El margen bruto es la diferencia entre el monto total de costos y el monto total de facturación
+
+###Facturación
+
+Puedes crear/enlazar una [Sales Order](/docs/user/manual/en/selling/sales-order.html) a un proyecto. Una vez asociada puedes usar el módulo de ventas para facturar a un cliente sobre el proyecto.
+
+<img class="screenshot" alt="Project - Sales Order" src="/docs/assets/img/project/project_sales_order.png">
+
+###Gantt Chart
+
+Un Gantt Chart muestra la planificación del proyecto.
+ERPNext te provee con una vista para visualizar las tareas de forma calendarizada usando un Gantt Chart (Hoja de Gantt).
+
+* Para visualizar el gantt chart de un proyecto, ve hasta el proyecto y dar click en 'Gantt Chart'
+
+<img class="screenshot" alt="Project - View Gantt Chart" src="/docs/assets/img/project/project_view_gantt_chart.png">
+
+<img class="screenshot" alt="Project - Gantt Chart" src="/docs/assets/img/project/project_gantt_chart.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/es/projects/tasks.md b/erpnext/docs/user/manual/es/projects/tasks.md
new file mode 100644
index 0000000..b07b305
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/tasks.md
@@ -0,0 +1,61 @@
+# Tareas
+
+Proyecto es dividido en Tareas.
+En ERPNext, puedes crear las tareas de forma independiente.
+
+<img class="screenshot" alt="Task" src="/docs/assets/img/project/task.png">
+
+### Estado de una Tarea
+
+Una tarea puede tener uno de los siguientes estados - Abierto, Trabajando, Pendiente de Revisión, Cerrado, o Cancelado.
+
+<img class="screenshot" alt="Task - Status" src="/docs/assets/img/project/task_status.png">
+
+* Por defecto, cada nueva tarea creada se le establece el estado 'Abierto'.
+
+* Si un registro de tiempo es realizado sobre una tarea, su estado es asignado a 'Working'.
+
+### Tarea Dependiente
+
+Puedes especificar una lista de tareas dependientes en la sección 'Depende de'
+
+<img class="screenshot" alt="Depends On" src="/docs/assets/img/project/task_depends_on.png">
+
+* No puedes cerrar una tarea padre hasta que todas las tareas dependientes esten cerradas.
+
+* Si una tarea dependiente se encuentra en retraso y se sobrepone con la fecha esperada de inicio de la tarea padre, el sistema va a re calandarizar la tarea padre.
+
+### Manejando el tiempo
+
+ERPNext usa [Time Log](/docs/user/manual/en/projects/time-log.html) para seguir el progreso de una tarea.
+Puedes crear varios registros de tiempo para cada tarea.
+El tiempo de inicio y fin actual junto con el costo es actualizado en base al Registro de Tiempo.
+
+* Para ver el Registro de tiempo realizado a una tarea, dar click en 'Time Logs'
+
+<img class="screenshot" alt="Task - View Time Log" src="/docs/assets/img/project/task_view_time_log.png">
+
+<img class="screenshot" alt="Task - Time Log List" src="/docs/assets/img/project/task_time_log_list.png">
+
+* Puedes también crear un Registro de Tiempo directamente y luego asociarlo a una Tarea.
+
+<img class="screenshot" alt="Task - Link Time Log" src="/docs/assets/img/project/task_time_log_link.png">
+
+### Gestión de gastos
+
+Puede reservar la [Reclamación de gastos](/docs/user/manual/en/human-resources/expense-claim.html) contra una tarea de proyecto.
+El sistema actualizará el monto total de las reclamaciones de gastos en la sección de costos del proyecto.
+
+* Para ver las reclamaciones de gastos realizadas en un proyecto, haga clic en 'Reclamaciones de gastos'
+
+<img class="screenshot" alt="Task - View Expense Claim" src="/docs/assets/img/project/task_view_expense_claim.png">
+
+* También puede crear un Reclamo de gastos directamente y vincularlo al Proyecto.
+
+<img class="screenshot" alt="Task - Link Expense Claim" src="/docs/assets/img/project/task_expense_claim_link.png">
+
+* El monto total de los Reclamos de gastos reservados contra un proyecto se muestra en 'Reclamo de gastos totales' en la Sección de Costos del proyecto
+
+<img class="screenshot" alt="Task - Total Expense Claim" src="/docs/assets/img/project/task_total_expense_claim.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/es/projects/time-log-batch.md b/erpnext/docs/user/manual/es/projects/time-log-batch.md
new file mode 100644
index 0000000..72c77b4
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/time-log-batch.md
@@ -0,0 +1,25 @@
+# Lote de registro de tiempo
+
+Puede facturar Registros de tiempo viéndolos juntos. Esto le da la flexibilidad de administrar la facturación de su cliente de la manera que desee. Para crear una nueva hoja de tiempo, ve a
+
+> Projects > Time Sheet > New Time Sheet
+
+O
+
+Simplemente abra su lista de registro de tiempo y marque los elementos que desea agregar al registro de tiempo. A continuación, haga clic en el botón "Crear hoja de tiempo" y se seleccionarán estos registros de tiempo.
+
+<img class="screenshot" alt="Time Log - Drag Calender" src="/docs/assets/img/project/time_sheet.gif">
+
+###Creando Factura de Venta
+
+* Despues de crear la Hoja de Tiempo/Horario, el botón "Crear Factura" debe aparecer.
+
+<img class="screenshot" alt="Time Log - Drag Calender" src="/docs/assets/img/project/time_sheet_make_invoice.png">
+
+* Haga clic en ese botón para hacer una factura de venta usando la hoja de tiempo.
+
+<img class="screenshot" alt="Time Log - Drag Calender" src="/docs/assets/img/project/time_sheet_sales_invoice.png">
+
+* Cuando "Presente" la Factura de Ventas, el número de Factura de Ventas se actualizará en los Registros de Tiempo y la Hoja de Horario y su estado cambiará a "Facturado".
+
+{next}
\ No newline at end of file
diff --git a/erpnext/domains/manufacturing.py b/erpnext/domains/manufacturing.py
index b8bb7e0..8c911a3 100644
--- a/erpnext/domains/manufacturing.py
+++ b/erpnext/domains/manufacturing.py
@@ -18,8 +18,5 @@
'set_value': [
['Stock Settings', None, 'show_barcode_field', 1]
],
- 'restricted_roles': [
- 'Manufacturing User'
- ],
'default_portal_role': 'Customer'
}
\ No newline at end of file
diff --git a/erpnext/erpnext_integrations/__init__.py b/erpnext/erpnext_integrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/erpnext_integrations/__init__.py
diff --git a/erpnext/erpnext_integrations/connectors/__init__.py b/erpnext/erpnext_integrations/connectors/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/erpnext_integrations/connectors/__init__.py
diff --git a/erpnext/erpnext_integrations/connectors/github_connection.py b/erpnext/erpnext_integrations/connectors/github_connection.py
new file mode 100644
index 0000000..ab7708d
--- /dev/null
+++ b/erpnext/erpnext_integrations/connectors/github_connection.py
@@ -0,0 +1,45 @@
+from __future__ import unicode_literals
+import frappe
+from frappe.data_migration.doctype.data_migration_connector.connectors.base import BaseConnection
+from github import Github
+
+class GithubConnection(BaseConnection):
+ def __init__(self, connector):
+ self.connector = connector
+
+ try:
+ password = self.get_password()
+ except frappe.AuthenticationError:
+ password = None
+
+ if self.connector.username and password:
+ self.connection = Github(self.connector.username, self.get_password())
+ else:
+ self.connection = Github()
+
+ self.name_field = 'id'
+
+ def insert(self, doctype, doc):
+ pass
+
+ def update(self, doctype, doc, migration_id):
+ pass
+
+ def delete(self, doctype, migration_id):
+ pass
+
+ def get(self, remote_objectname, fields=None, filters=None, start=0, page_length=10):
+ repo = filters.get('repo')
+
+ if remote_objectname == 'Milestone':
+ return self.get_milestones(repo, start, page_length)
+ if remote_objectname == 'Issue':
+ return self.get_issues(repo, start, page_length)
+
+ def get_milestones(self, repo, start=0, page_length=10):
+ _repo = self.connection.get_repo(repo)
+ return list(_repo.get_milestones()[start:start+page_length])
+
+ def get_issues(self, repo, start=0, page_length=10):
+ _repo = self.connection.get_repo(repo)
+ return list(_repo.get_issues()[start:start+page_length])
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/erpnext_integrations/data_migration_mapping/__init__.py
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
new file mode 100644
index 0000000..5f0f691
--- /dev/null
+++ b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
@@ -0,0 +1,11 @@
+import frappe
+
+def pre_process(issue):
+
+ project = frappe.db.get_value('Project', filters={'project_name': issue.milestone})
+ return {
+ 'title': issue.title,
+ 'body': frappe.utils.to_html(issue.body or ''),
+ 'state': issue.state.title(),
+ 'project': project or ''
+ }
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/issue_to_task.json b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/issue_to_task.json
new file mode 100644
index 0000000..e945ba2
--- /dev/null
+++ b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/issue_to_task.json
@@ -0,0 +1,36 @@
+{
+ "condition": "{\"repo\":\"frappe/erpnext\"}",
+ "creation": "2017-10-16 16:03:32.772191",
+ "docstatus": 0,
+ "doctype": "Data Migration Mapping",
+ "fields": [
+ {
+ "is_child_table": 0,
+ "local_fieldname": "subject",
+ "remote_fieldname": "title"
+ },
+ {
+ "is_child_table": 0,
+ "local_fieldname": "description",
+ "remote_fieldname": "body"
+ },
+ {
+ "is_child_table": 0,
+ "local_fieldname": "status",
+ "remote_fieldname": "state"
+ }
+ ],
+ "idx": 0,
+ "local_doctype": "Task",
+ "local_primary_key": "name",
+ "mapping_name": "Issue to Task",
+ "mapping_type": "Pull",
+ "migration_id_field": "github_sync_id",
+ "modified": "2017-10-20 11:48:54.575993",
+ "modified_by": "Administrator",
+ "name": "Issue to Task",
+ "owner": "Administrator",
+ "page_length": 10,
+ "remote_objectname": "Issue",
+ "remote_primary_key": "id"
+}
\ No newline at end of file
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py
new file mode 100644
index 0000000..212f81b
--- /dev/null
+++ b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py
@@ -0,0 +1,6 @@
+def pre_process(milestone):
+ return {
+ 'title': milestone.title,
+ 'description': milestone.description,
+ 'state': milestone.state.title()
+ }
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/milestone_to_project.json b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/milestone_to_project.json
new file mode 100644
index 0000000..5a3e07e
--- /dev/null
+++ b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/milestone_to_project.json
@@ -0,0 +1,36 @@
+{
+ "condition": "{\"repo\": \"frappe/erpnext\"}",
+ "creation": "2017-10-13 11:16:49.664925",
+ "docstatus": 0,
+ "doctype": "Data Migration Mapping",
+ "fields": [
+ {
+ "is_child_table": 0,
+ "local_fieldname": "project_name",
+ "remote_fieldname": "title"
+ },
+ {
+ "is_child_table": 0,
+ "local_fieldname": "notes",
+ "remote_fieldname": "description"
+ },
+ {
+ "is_child_table": 0,
+ "local_fieldname": "status",
+ "remote_fieldname": "state"
+ }
+ ],
+ "idx": 0,
+ "local_doctype": "Project",
+ "local_primary_key": "project_name",
+ "mapping_name": "Milestone to Project",
+ "mapping_type": "Pull",
+ "migration_id_field": "github_sync_id",
+ "modified": "2017-10-20 11:48:54.552305",
+ "modified_by": "Administrator",
+ "name": "Milestone to Project",
+ "owner": "Administrator",
+ "page_length": 10,
+ "remote_objectname": "Milestone",
+ "remote_primary_key": "id"
+}
\ No newline at end of file
diff --git a/erpnext/erpnext_integrations/data_migration_plan/github_sync/github_sync.json b/erpnext/erpnext_integrations/data_migration_plan/github_sync/github_sync.json
new file mode 100644
index 0000000..20eb387
--- /dev/null
+++ b/erpnext/erpnext_integrations/data_migration_plan/github_sync/github_sync.json
@@ -0,0 +1,22 @@
+{
+ "creation": "2017-10-13 11:16:53.600026",
+ "docstatus": 0,
+ "doctype": "Data Migration Plan",
+ "idx": 0,
+ "mappings": [
+ {
+ "enabled": 1,
+ "mapping": "Milestone to Project"
+ },
+ {
+ "enabled": 1,
+ "mapping": "Issue to Task"
+ }
+ ],
+ "modified": "2017-10-20 11:48:54.496123",
+ "modified_by": "Administrator",
+ "module": "ERPNext Integrations",
+ "name": "GitHub Sync",
+ "owner": "Administrator",
+ "plan_name": "GitHub Sync"
+}
\ No newline at end of file
diff --git a/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py b/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
index 2345872..53f82e0 100644
--- a/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
+++ b/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
@@ -19,13 +19,13 @@
patient = frappe.new_doc("Patient")
patient.patient_name = "Test Patient"
patient.sex = "Male"
- patient.save(ignore_permissions = True)
+ patient.save(ignore_permissions=True)
patient = patient.name
if not physician:
physician = frappe.new_doc("Physician")
- physician.first_name= "Amit Jain"
- physician.save(ignore_permissions = True)
+ physician.first_name = "Amit Jain"
+ physician.save(ignore_permissions=True)
physician = physician.name
frappe.db.set_value("Healthcare Settings", None, "max_visit", 2)
@@ -50,5 +50,5 @@
appointment.patient = patient
appointment.physician = physician
appointment.appointment_date = appointment_date
- appointment.save(ignore_permissions = True)
+ appointment.save(ignore_permissions=True)
return appointment
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
index 2532ed1..1942b66 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
@@ -30,6 +30,14 @@
frm.add_custom_button(__('Cancel'), function() {
btn_update_status(frm, "Cancelled");
});
+
+ frm.add_custom_button(__("Consultation"),function(){
+ btn_create_consultation(frm);
+ },"Create");
+
+ frm.add_custom_button(__('Vital Signs'), function() {
+ btn_create_vital_signs(frm);
+ },"Create");
}
if(frm.doc.status == "Pending"){
frm.add_custom_button(__('Set Open'), function() {
@@ -40,14 +48,6 @@
});
}
- frm.add_custom_button(__("Consultation"),function(){
- btn_create_consultation(frm);
- },"Create");
-
- frm.add_custom_button(__('Vital Signs'), function() {
- btn_create_vital_signs(frm);
- },"Create");
-
if(!frm.doc.__islocal){
if(frm.doc.sales_invoice && frappe.user.has_role("Accounts User")){
frm.add_custom_button(__('Invoice'), function() {
@@ -188,7 +188,7 @@
frappe.call({
method:
"erpnext.healthcare.doctype.patient_appointment.patient_appointment.update_status",
- args: {appointmentId: doc.name, status:status},
+ args: {appointment_id: doc.name, status:status},
callback: function(data){
if(!data.exc){
frm.reload_doc();
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
index 57e568b..1663c5b 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
@@ -234,6 +234,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "eval:!doc.__islocal",
"fieldname": "section_break_1",
"fieldtype": "Section Break",
"hidden": 0,
@@ -755,7 +756,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-05 12:13:03.204936",
+ "modified": "2017-10-25 23:33:36.060803",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient Appointment",
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
index 2647034..4379986 100755
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
@@ -6,66 +6,100 @@
import frappe
from frappe.model.document import Document
import json
-from frappe.utils import getdate
+from frappe.utils import getdate, cint
from frappe import _
import datetime
from frappe.core.doctype.sms_settings.sms_settings import send_sms
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account,get_income_account
+
class PatientAppointment(Document):
def on_update(self):
today = datetime.date.today()
appointment_date = getdate(self.appointment_date)
- #If appointment created for today set as open
- if(today == appointment_date):
- frappe.db.set_value("Patient Appointment",self.name,"status","Open")
+
+ # If appointment created for today set as open
+ if today == appointment_date:
+ frappe.db.set_value("Patient Appointment", self.name, "status", "Open")
self.reload()
def after_insert(self):
- #Check fee validity exists
+ # Check fee validity exists
appointment = self
validity_exist = validity_exists(appointment.physician, appointment.patient)
- if validity_exist :
- fee_validity = frappe.get_doc("Fee Validity",validity_exist[0][0])
- #Check if the validity is valid
+ if validity_exist:
+ fee_validity = frappe.get_doc("Fee Validity", validity_exist[0][0])
+
+ # Check if the validity is valid
appointment_date = getdate(appointment.appointment_date)
- if((fee_validity.valid_till >= appointment_date) and (fee_validity.visited < fee_validity.max_visit)):
+ if (fee_validity.valid_till >= appointment_date) and (fee_validity.visited < fee_validity.max_visit):
visited = fee_validity.visited + 1
- frappe.db.set_value("Fee Validity",fee_validity.name,"visited",visited)
- if(fee_validity.ref_invoice):
- frappe.db.set_value("Patient Appointment",appointment.name,"sales_invoice",fee_validity.ref_invoice)
+ frappe.db.set_value("Fee Validity", fee_validity.name, "visited", visited)
+ if fee_validity.ref_invoice:
+ frappe.db.set_value("Patient Appointment", appointment.name, "sales_invoice", fee_validity.ref_invoice)
frappe.msgprint(_("{0} has fee validity till {1}").format(appointment.patient, fee_validity.valid_till))
confirm_sms(self)
-def appointment_cancel(appointmentId):
- appointment = frappe.get_doc("Patient Appointment",appointmentId)
- #If invoice --> fee_validity update with -1 visit
- if (appointment.sales_invoice):
- validity = frappe.db.exists({"doctype": "Fee Validity","ref_invoice": appointment.sales_invoice})
- if(validity):
- fee_validity = frappe.get_doc("Fee Validity",validity[0][0])
- visited = fee_validity.visited - 1
- frappe.db.set_value("Fee Validity",fee_validity.name,"visited",visited)
- if visited <= 0:
- frappe.msgprint(_("Appointment cancelled, Please review and cancel the invoice {0}".format(appointment.sales_invoice)))
- else:
- frappe.msgprint(_("Appointment cancelled"))
+ def save(self, *args, **kwargs):
+ # duration is the only changeable field in the document
+ if not self.is_new():
+ self.db_set('duration', cint(self.duration))
+ else:
+ super(PatientAppointment, self).save(*args, **kwargs)
+
+
+def appointment_cancel(appointment_id):
+ appointment = frappe.get_doc("Patient Appointment", appointment_id)
+
+ # If invoice --> fee_validity update with -1 visit
+ if appointment.sales_invoice:
+ validity = frappe.db.exists({"doctype": "Fee Validity", "ref_invoice": appointment.sales_invoice})
+ if validity:
+ fee_validity = frappe.get_doc("Fee Validity", validity[0][0])
+ visited = fee_validity.visited - 1
+ frappe.db.set_value("Fee Validity", fee_validity.name, "visited", visited)
+ if visited <= 0:
+ frappe.msgprint(
+ _("Appointment cancelled, Please review and cancel the invoice {0}".format(appointment.sales_invoice))
+ )
+ else:
+ frappe.msgprint(_("Appointment cancelled"))
+
@frappe.whitelist()
def get_availability_data(date, physician):
- # get availability data of 'physician' on 'date'
+ """
+ Get availability data of 'physician' on 'date'
+ :param date: Date to check in schedule
+ :param physician: Name of the physician
+ :return: dict containing a list of available slots, list of appointments and time of appointments
+ """
+
date = getdate(date)
weekday = date.strftime("%A")
available_slots = []
+ physician_schedule_name = None
+ physician_schedule = None
+ time_per_appointment = None
+
# get physicians schedule
physician_schedule_name = frappe.db.get_value("Physician", physician, "physician_schedule")
- physician_schedule = frappe.get_doc("Physician Schedule", physician_schedule_name)
- time_per_appointment = frappe.db.get_value("Physician", physician, "time_per_appointment")
+ if physician_schedule_name:
+ physician_schedule = frappe.get_doc("Physician Schedule", physician_schedule_name)
+ time_per_appointment = frappe.db.get_value("Physician", physician, "time_per_appointment")
+ else:
+ frappe.throw(_("Dr {0} does not have a Physician Schedule. Add it in Physician master".format(physician)))
- for t in physician_schedule.time_slots:
- if weekday == t.day:
- available_slots.append(t)
+ if physician_schedule:
+ for t in physician_schedule.time_slots:
+ if weekday == t.day:
+ available_slots.append(t)
+
+ # `time_per_appointment` should never be None since validation in `Patient` is supposed to prevent
+ # that. However, it isn't impossible so we'll prepare for that.
+ if not time_per_appointment:
+ frappe.throw(_('"Time Per Appointment" hasn"t been set for Dr {0}. Add it in Physician master.').format(physician))
# if physician not available return
if not available_slots:
@@ -89,27 +123,36 @@
"time_per_appointment": time_per_appointment
}
+
@frappe.whitelist()
-def update_status(appointmentId, status):
- frappe.db.set_value("Patient Appointment",appointmentId,"status",status)
- if(status=="Cancelled"):
- appointment_cancel(appointmentId)
+def update_status(appointment_id, status):
+ frappe.db.set_value("Patient Appointment", appointment_id, "status", status)
+ if status == "Cancelled":
+ appointment_cancel(appointment_id)
+
@frappe.whitelist()
def set_open_appointments():
today = getdate()
- frappe.db.sql("""update `tabPatient Appointment` set status='Open' where status = 'Scheduled' and appointment_date = %s""",(today))
+ frappe.db.sql(
+ "update `tabPatient Appointment` set status='Open' where status = 'Scheduled'"
+ " and appointment_date = %s", today)
+
@frappe.whitelist()
def set_pending_appointments():
today = getdate()
- frappe.db.sql("""update `tabPatient Appointment` set status='Pending' where status in ('Scheduled','Open') and appointment_date < %s""",(today))
+ frappe.db.sql(
+ "update `tabPatient Appointment` set status='Pending' where status in "
+ "('Scheduled','Open') and appointment_date < %s", today)
+
def confirm_sms(doc):
- if (frappe.db.get_value("Healthcare Settings", None, "app_con")=='1'):
+ if frappe.db.get_value("Healthcare Settings", None, "app_con") == '1':
message = frappe.db.get_value("Healthcare Settings", None, "app_con_msg")
send_message(doc, message)
+
@frappe.whitelist()
def create_invoice(company, physician, patient, appointment_id, appointment_date):
if not appointment_id:
@@ -134,21 +177,24 @@
frappe.db.set_value("Consultation", consultation[0][0], "invoice", sales_invoice.name)
return sales_invoice.name
+
def get_fee_validity(physician, patient, date):
validity_exist = validity_exists(physician, patient)
- if validity_exist :
- fee_validity = frappe.get_doc("Fee Validity",validity_exist[0][0])
+ if validity_exist:
+ fee_validity = frappe.get_doc("Fee Validity", validity_exist[0][0])
fee_validity = update_fee_validity(fee_validity, date)
else:
fee_validity = create_fee_validity(physician, patient, date)
return fee_validity
+
def validity_exists(physician, patient):
return frappe.db.exists({
"doctype": "Fee Validity",
"physician": physician,
"patient": patient})
+
def update_fee_validity(fee_validity, date):
max_visit = frappe.db.get_value("Healthcare Settings", None, "max_visit")
valid_days = frappe.db.get_value("Healthcare Settings", None, "valid_days")
@@ -164,6 +210,7 @@
fee_validity.save(ignore_permissions=True)
return fee_validity
+
def create_fee_validity(physician, patient, date):
fee_validity = frappe.new_doc("Fee Validity")
fee_validity.physician = physician
@@ -171,6 +218,7 @@
fee_validity = update_fee_validity(fee_validity, date)
return fee_validity
+
def create_invoice_items(appointment_id, physician, company, invoice):
item_line = invoice.append("items")
item_line.item_name = "Consulting Charges"
@@ -178,16 +226,17 @@
item_line.qty = 1
item_line.uom = "Nos"
item_line.conversion_factor = 1
- item_line.income_account = get_income_account(physician,company)
+ item_line.income_account = get_income_account(physician, company)
op_consulting_charge = frappe.db.get_value("Physician", physician, "op_consulting_charge")
if op_consulting_charge:
item_line.rate = op_consulting_charge
item_line.amount = op_consulting_charge
return invoice
+
@frappe.whitelist()
def create_consultation(appointment):
- appointment = frappe.get_doc("Patient Appointment",appointment)
+ appointment = frappe.get_doc("Patient Appointment", appointment)
consultation = frappe.new_doc("Consultation")
consultation.appointment = appointment.name
consultation.patient = appointment.patient
@@ -199,29 +248,37 @@
consultation.invoice = appointment.sales_invoice
return consultation.as_dict()
+
def remind_appointment():
- if (frappe.db.get_value("Healthcare Settings", None, "app_rem")=='1'):
+ if frappe.db.get_value("Healthcare Settings", None, "app_rem") == '1':
rem_before = datetime.datetime.strptime(frappe.get_value("Healthcare Settings", None, "rem_before"), "%H:%M:%S")
- rem_dt = datetime.datetime.now() + datetime.timedelta(hours = rem_before.hour, minutes=rem_before.minute, seconds= rem_before.second)
+ rem_dt = datetime.datetime.now() + datetime.timedelta(
+ hours=rem_before.hour, minutes=rem_before.minute, seconds=rem_before.second)
- appointment_list = frappe.db.sql("select name from `tabPatient Appointment` where start_dt between %s and %s and reminded = 0 ", (datetime.datetime.now(), rem_dt))
+ appointment_list = frappe.db.sql(
+ "select name from `tabPatient Appointment` where start_dt between %s and %s and reminded = 0 ",
+ (datetime.datetime.now(), rem_dt)
+ )
- for i in range (0,len(appointment_list)):
+ for i in range(0, len(appointment_list)):
doc = frappe.get_doc("Patient Appointment", appointment_list[i][0])
message = frappe.db.get_value("Healthcare Settings", None, "app_rem_msg")
send_message(doc, message)
- frappe.db.set_value("Patient Appointment",doc.name,"reminded",1)
+ frappe.db.set_value("Patient Appointment", doc.name, "reminded",1)
+
def send_message(doc, message):
- patient = frappe.get_doc("Patient",doc.patient)
- if(patient.mobile):
+ patient = frappe.get_doc("Patient", doc.patient)
+ if patient.mobile:
context = {"doc": doc, "alert": doc, "comments": None}
if doc.get("_comments"):
context["comments"] = json.loads(doc.get("_comments"))
- #jinja to string convertion happens here
+
+ # jinja to string convertion happens here
message = frappe.render_template(message, context)
number = [patient.mobile]
- send_sms(number,message)
+ send_sms(number, message)
+
@frappe.whitelist()
def get_events(start, end, filters=None):
diff --git a/erpnext/healthcare/doctype/physician/physician.json b/erpnext/healthcare/doctype/physician/physician.json
index 4348e90..3edad0b 100644
--- a/erpnext/healthcare/doctype/physician/physician.json
+++ b/erpnext/healthcare/doctype/physician/physician.json
@@ -501,6 +501,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "description": "In minutes",
"fieldname": "time_per_appointment",
"fieldtype": "Data",
"hidden": 0,
@@ -809,7 +810,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-04 17:35:44.363742",
+ "modified": "2017-10-05 16:08:24.624644",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Physician",
diff --git a/erpnext/healthcare/doctype/physician/physician.py b/erpnext/healthcare/doctype/physician/physician.py
index 8680d5d..4d035d3 100644
--- a/erpnext/healthcare/doctype/physician/physician.py
+++ b/erpnext/healthcare/doctype/physician/physician.py
@@ -20,22 +20,32 @@
[cstr(self.get(f)).strip() for f in ["first_name","middle_name","last_name"]]))
def validate(self):
+ self.validate_schedule_and_time()
validate_party_accounts(self)
+
if self.user_id:
self.validate_for_enabled_user_id()
self.validate_duplicate_user_id()
existing_user_id = frappe.db.get_value("Physician", self.name, "user_id")
- if(self.user_id != existing_user_id):
+ if self.user_id != existing_user_id:
frappe.permissions.remove_user_permission(
"Physician", self.name, existing_user_id)
-
else:
existing_user_id = frappe.db.get_value("Physician", self.name, "user_id")
if existing_user_id:
frappe.permissions.remove_user_permission(
"Physician", self.name, existing_user_id)
+ def validate_schedule_and_time(self):
+ if (self.physician_schedule or self.time_per_appointment) and \
+ not (self.physician_schedule and self.time_per_appointment):
+ frappe.msgprint(
+ _('Both "Physician Schedule" and Time Per Appointment" must be set for Dr {0}').format(
+ self.first_name),
+ title='Error', raise_exception=1, indicator='red'
+ )
+
def on_update(self):
if self.user_id:
frappe.permissions.add_user_permission("Physician", self.name, self.user_id)
diff --git a/erpnext/healthcare/doctype/physician/test_physician.py b/erpnext/healthcare/doctype/physician/test_physician.py
index b6ea92c..4bd497a 100644
--- a/erpnext/healthcare/doctype/physician/test_physician.py
+++ b/erpnext/healthcare/doctype/physician/test_physician.py
@@ -3,8 +3,35 @@
# See license.txt
from __future__ import unicode_literals
import unittest
+import frappe
-# test_records = frappe.get_test_records('Physician')
+test_dependencies = ['Physician Schedule']
+
class TestPhysician(unittest.TestCase):
- pass
+ def tearDown(self):
+ frappe.delete_doc_if_exists('Physician', '_Testdoctor2', force=1)
+
+ def test_schedule_and_time(self):
+ physician = frappe.new_doc('Physician')
+ physician.first_name = '_Testdoctor2'
+ physician.physician_schedule = '_Testdoctor2 Schedule'
+
+ self.assertRaises(frappe.ValidationError, physician.insert)
+
+ physician.physician_schedule = ''
+ physician.time_per_appointment = 15
+
+ self.assertRaises(frappe.ValidationError, physician.insert)
+
+ physician.physician_schedule = '_Testdoctor2 Schedule'
+ physician.time_per_appointment = 15
+
+ physician.insert()
+
+ def test_new_physician_without_schedule(self):
+ physician = frappe.new_doc('Physician')
+ physician.first_name = '_Testdoctor2'
+
+ physician.insert()
+ self.assertEqual(frappe.get_value('Physician', '_Testdoctor2', 'first_name'), '_Testdoctor2')
diff --git a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.py b/erpnext/healthcare/doctype/physician_schedule/physician_schedule.py
index 5cbdd12..167e9cd 100644
--- a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.py
+++ b/erpnext/healthcare/doctype/physician_schedule/physician_schedule.py
@@ -5,5 +5,7 @@
from __future__ import unicode_literals
from frappe.model.document import Document
+
class PhysicianSchedule(Document):
- pass
+ def autoname(self):
+ self.name = self.schedule_name
diff --git a/erpnext/healthcare/doctype/physician_schedule/test_records.json b/erpnext/healthcare/doctype/physician_schedule/test_records.json
new file mode 100644
index 0000000..1e6230d
--- /dev/null
+++ b/erpnext/healthcare/doctype/physician_schedule/test_records.json
@@ -0,0 +1,8 @@
+[
+ {
+ "schedule_name": "_Testdoctor1 Schedule"
+ },
+ {
+ "schedule_name": "_Testdoctor2 Schedule"
+ }
+]
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_loan/employee_loan.js b/erpnext/hr/doctype/employee_loan/employee_loan.js
index 33d3a85..1f38105 100644
--- a/erpnext/hr/doctype/employee_loan/employee_loan.js
+++ b/erpnext/hr/doctype/employee_loan/employee_loan.js
@@ -87,22 +87,24 @@
},
employee_loan_application: function (frm) {
- return frappe.call({
- method: "erpnext.hr.doctype.employee_loan.employee_loan.get_employee_loan_application",
- args: {
- "employee_loan_application": frm.doc.employee_loan_application
- },
- callback: function (r) {
- if (!r.exc && r.message) {
- frm.set_value("loan_type", r.message.loan_type);
- frm.set_value("loan_amount", r.message.loan_amount);
- frm.set_value("repayment_method", r.message.repayment_method);
- frm.set_value("monthly_repayment_amount", r.message.repayment_amount);
- frm.set_value("repayment_periods", r.message.repayment_periods);
- frm.set_value("rate_of_interest", r.message.rate_of_interest);
- }
- }
- })
+ if(frm.doc.employee_loan_application){
+ return frappe.call({
+ method: "erpnext.hr.doctype.employee_loan.employee_loan.get_employee_loan_application",
+ args: {
+ "employee_loan_application": frm.doc.employee_loan_application
+ },
+ callback: function (r) {
+ if (!r.exc && r.message) {
+ frm.set_value("loan_type", r.message.loan_type);
+ frm.set_value("loan_amount", r.message.loan_amount);
+ frm.set_value("repayment_method", r.message.repayment_method);
+ frm.set_value("monthly_repayment_amount", r.message.repayment_amount);
+ frm.set_value("repayment_periods", r.message.repayment_periods);
+ frm.set_value("rate_of_interest", r.message.rate_of_interest);
+ }
+ }
+ });
+ }
},
repayment_method: function (frm) {
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.json b/erpnext/hr/doctype/leave_allocation/leave_allocation.json
index d6285f7..9b4a26e 100644
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation.json
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.json
@@ -19,35 +19,6 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@@ -507,7 +478,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-06-13 14:29:01.066538",
+ "modified": "2017-11-10 18:41:38.845159",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Allocation",
diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.json b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.json
index 4f31f9b..d3c3097 100644
--- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.json
+++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.json
@@ -11,34 +11,7 @@
"editable_grid": 0,
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -69,6 +42,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -99,6 +73,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -129,6 +104,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -159,6 +135,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -189,6 +166,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -217,6 +195,7 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -246,6 +225,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -275,6 +255,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -304,6 +285,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -333,6 +315,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -361,6 +344,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -401,7 +385,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-03-29 11:24:17.013862",
+ "modified": "2017-11-10 18:42:17.060492",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Control Panel",
diff --git a/erpnext/hr/doctype/offer_letter/test_offer_letter.js b/erpnext/hr/doctype/offer_letter/test_offer_letter.js
index 2069532..c9b08a6 100644
--- a/erpnext/hr/doctype/offer_letter/test_offer_letter.js
+++ b/erpnext/hr/doctype/offer_letter/test_offer_letter.js
@@ -27,13 +27,13 @@
]},
]);
},
- () => frappe.timeout(8),
+ () => frappe.timeout(10),
() => frappe.click_button('Submit'),
() => frappe.timeout(2),
() => frappe.click_button('Yes'),
- () => frappe.timeout(8),
+ () => frappe.timeout(5),
+ // To check if the fields are correctly set
() => {
- // To check if the fields are correctly set
assert.ok(cur_frm.get_field('status').value=='Accepted',
'Status of job offer is correct');
assert.ok(cur_frm.get_field('designation').value=='Software Developer',
@@ -45,7 +45,7 @@
() => {
assert.ok(cur_list.data[0].docstatus==1,'Offer Letter Submitted successfully');
},
- () => frappe.timeout(4),
+ () => frappe.timeout(2),
() => done()
]);
});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index 24f2016..4679cbd 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -161,18 +161,15 @@
tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days) /
cint(doc.total_working_days)*100)/100;
- refresh_field('amount', tbl[i].name, 'earnings');
-
} else if(reset_amount) {
tbl[i].amount = tbl[i].default_amount;
- refresh_field('amount', tbl[i].name, 'earnings');
}
if(!tbl[i].do_not_include_in_total) {
total_earn += flt(tbl[i].amount);
}
}
doc.gross_pay = total_earn;
- refresh_many(['amount','gross_pay']);
+ refresh_many(['earnings', 'amount','gross_pay']);
}
// Calculate deduction total
@@ -183,17 +180,15 @@
for(var i = 0; i < tbl.length; i++){
if(cint(tbl[i].depends_on_lwp) == 1) {
tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days)/cint(doc.total_working_days)*100)/100;
- refresh_field('amount', tbl[i].name, 'deductions');
} else if(reset_amount) {
tbl[i].amount = tbl[i].default_amount;
- refresh_field('amount', tbl[i].name, 'deductions');
}
if(!tbl[i].do_not_include_in_total) {
total_ded += flt(tbl[i].amount);
}
}
doc.total_deduction = total_ded;
- refresh_field('total_deduction');
+ refresh_many(['deductions', 'total_deduction']);
}
// Calculate net payable amount
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json
index 8f1e6b3..6a52f2d 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.json
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
@@ -12,35 +13,7 @@
"editable_grid": 0,
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -53,7 +26,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 0,
+ "in_list_view": 1,
"in_standard_filter": 0,
"label": "Posting Date",
"length": 0,
@@ -71,6 +44,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -82,7 +56,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
- "in_list_view": 0,
+ "in_list_view": 1,
"in_standard_filter": 1,
"label": "Employee",
"length": 0,
@@ -102,6 +76,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -113,7 +88,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
- "in_list_view": 0,
+ "in_list_view": 1,
"in_standard_filter": 0,
"label": "Employee Name",
"length": 0,
@@ -133,6 +108,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -164,6 +140,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -196,6 +173,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -227,6 +205,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -256,6 +235,7 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -286,6 +266,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -316,6 +297,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -327,7 +309,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 0,
+ "in_list_view": 1,
"in_standard_filter": 1,
"label": "Company",
"length": 0,
@@ -345,6 +327,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -374,6 +357,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -402,6 +386,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -433,6 +418,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -463,6 +449,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -494,6 +481,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -522,6 +510,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -553,6 +542,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -585,6 +575,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -616,6 +607,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -647,6 +639,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -678,6 +671,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -708,6 +702,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -739,6 +734,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -767,6 +763,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -796,6 +793,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -826,6 +824,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -856,6 +855,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -886,6 +886,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -916,6 +917,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -944,6 +946,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -975,6 +978,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1004,6 +1008,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1034,6 +1039,7 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1066,6 +1072,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1096,6 +1103,7 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1127,6 +1135,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1156,6 +1165,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1187,6 +1197,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1214,6 +1225,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1245,6 +1257,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1275,6 +1288,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1305,6 +1319,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1335,6 +1350,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1363,6 +1379,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1393,6 +1410,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1422,6 +1440,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1454,6 +1473,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1482,6 +1502,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
@@ -1511,6 +1532,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1539,6 +1561,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1570,18 +1593,18 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-file-text",
"idx": 9,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-03-02 02:25:53.844701",
+ "modified": "2017-11-10 18:40:33.817074",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Slip",
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index 7581624..1f9c192 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -348,7 +348,8 @@
/ cint(self.total_working_days)), self.precision("amount", component_type)
)
- elif not self.payment_days and not self.salary_slip_based_on_timesheet:
+ elif not self.payment_days and not self.salary_slip_based_on_timesheet and \
+ cint(d.depends_on_lwp):
d.amount = 0
elif not d.amount:
d.amount = d.default_amount
diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.js b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
index a49c973..619e530 100644
--- a/erpnext/hr/doctype/salary_slip/test_salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
@@ -15,7 +15,7 @@
{ employee: employee_name}
]);
},
- () => frappe.timeout(1),
+ () => frappe.timeout(3),
() => {
// To check if all the calculations are correctly done
if(ename === 'Test Employee 1')
@@ -43,7 +43,7 @@
() => salary_slip('Test Employee 1'),
() => frappe.timeout(6),
() => salary_slip('Test Employee 3'),
- () => frappe.timeout(3),
+ () => frappe.timeout(5),
() => done()
]);
});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.json b/erpnext/hr/doctype/salary_structure/salary_structure.json
index 4145fcb..945ebd0 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.json
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "Prompt",
@@ -12,34 +13,7 @@
"editable_grid": 0,
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -69,6 +43,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -99,6 +74,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -127,6 +103,7 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -159,6 +136,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -191,6 +169,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -222,6 +201,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -250,6 +230,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -281,6 +262,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -310,6 +292,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -340,6 +323,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -368,6 +352,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -400,6 +385,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -431,6 +417,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -464,6 +451,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -495,6 +483,7 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -527,6 +516,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -558,6 +548,7 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -589,6 +580,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -618,6 +610,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -646,6 +639,7 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -677,6 +671,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -708,6 +703,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -737,6 +733,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -766,6 +763,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -796,6 +794,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -824,6 +823,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -854,18 +854,18 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-file-text",
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-02-22 06:09:55.491748",
+ "modified": "2017-11-10 18:45:07.120254",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Structure",
diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.js b/erpnext/hr/doctype/salary_structure/test_salary_structure.js
index 5e028cf..542fa50 100644
--- a/erpnext/hr/doctype/salary_structure/test_salary_structure.js
+++ b/erpnext/hr/doctype/salary_structure/test_salary_structure.js
@@ -1,5 +1,5 @@
QUnit.test("test Salary Structure", function(assert) {
- assert.expect(6);
+ assert.expect(7);
let done = assert.async();
let employee_name1;
@@ -9,6 +9,7 @@
employee_name1 = r.name;
}
),
+ () => frappe.timeout(5),
() => frappe.db.get_value('Employee', {'employee_name': "Test Employee 3"}, 'name',
(r) => {
// Creating Salary Structure for employees);
@@ -48,12 +49,14 @@
]);
}
),
- () => frappe.timeout(3),
+ () => frappe.timeout(15),
() => {
- // To check if all the fields are correctly set
- assert.ok(cur_frm.doc.employees[0].employee_name.includes('Test Employee 1') &&
- cur_frm.doc.employees[1].employee_name.includes('Test Employee 3'),
- 'Employee names are correctly set');
+ // To check if all the fields are correctly set
+ assert.ok(cur_frm.doc.employees[0].employee_name=='Test Employee 1',
+ 'Employee 1 name correctly set');
+
+ assert.ok(cur_frm.doc.employees[1].employee_name=='Test Employee 3',
+ 'Employee 2 name correctly set');
assert.ok(cur_frm.doc.employees[0].base==25000,
'Base value for first employee is correctly set');
diff --git a/erpnext/hr/doctype/training_event/test_training_event.py b/erpnext/hr/doctype/training_event/test_training_event.py
index 03416ee..57123e3 100644
--- a/erpnext/hr/doctype/training_event/test_training_event.py
+++ b/erpnext/hr/doctype/training_event/test_training_event.py
@@ -5,8 +5,38 @@
import frappe
import unittest
-
-# test_records = frappe.get_test_records('Training Event')
+from frappe.utils import today, add_days
+from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
class TestTrainingEvent(unittest.TestCase):
- pass
+ def setUp(self):
+ create_training_program("Basic Training")
+ self.employee = make_employee("robert_loan@trainig.com")
+ self.employee2 = make_employee("suzie.tan@trainig.com")
+
+ def test_create_training_event(self):
+ if not frappe.db.get_value("Training Event", "Basic Training Event"):
+ frappe.get_doc({
+ "doctype": "Training Event",
+ "event_name": "Basic Training Event",
+ "training_program": "Basic Training",
+ "location": "Union Square",
+ "start_time": add_days(today(), 5),
+ "end_time": add_days(today(), 6),
+ "introduction": "Welcome to the Basic Training Event",
+ "employees": get_attendees(self.employee, self.employee2)
+ }).insert()
+
+def create_training_program(training_program):
+ if not frappe.db.get_value("Training Program", training_program):
+ frappe.get_doc({
+ "doctype": "Training Program",
+ "training_program": training_program,
+ "description": training_program
+ }).insert()
+
+def get_attendees(employee, employee2):
+ return [
+ {"employee": employee},
+ {"employee": employee2}
+ ]
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_event/tests/test_training_event.js b/erpnext/hr/doctype/training_event/tests/test_training_event.js
index a359af3..8ff4fec 100644
--- a/erpnext/hr/doctype/training_event/tests/test_training_event.js
+++ b/erpnext/hr/doctype/training_event/tests/test_training_event.js
@@ -1,7 +1,7 @@
QUnit.module('hr');
QUnit.test("Test: Training Event [HR]", function (assert) {
- assert.expect(4);
+ assert.expect(5);
let done = assert.async();
let employee_name;
@@ -21,7 +21,8 @@
{ employees: [
[
{employee: employee_name},
- {employee_name: 'Test Employee 1'}
+ {employee_name: 'Test Employee 1'},
+ {attendance: 'Optional'}
]
]},
]);
@@ -41,6 +42,9 @@
assert.ok(cur_frm.doc.employees[0].employee_name=='Test Employee 1',
'Attendee Employee is correctly set');
+
+ assert.ok(cur_frm.doc.employees[0].attendance=='Optional',
+ 'Attendance is correctly set');
},
() => frappe.set_route('List','Training Event','List'),
diff --git a/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js b/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js
deleted file mode 100644
index 6364308..0000000
--- a/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js
+++ /dev/null
@@ -1,40 +0,0 @@
-QUnit.module('hr');
-
-QUnit.test("test: Training Event", function (assert) {
- // number of asserts
- assert.expect(1);
- let done = assert.async();
-
- frappe.run_serially([
- // insert a new Training Event
- () => frappe.set_route("List", "Training Event", "List"),
- () => frappe.new_doc("Training Event"),
- () => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
- () => cur_frm.set_value("event_name", "Test Event " + frappe.utils.get_random(10)),
- () => cur_frm.set_value("start_time", "2017-07-26, 2:00 pm PDT"),
- () => cur_frm.set_value("end_time", "2017-07-26, 2:30 pm PDT"),
- () => cur_frm.set_value("introduction", "This is a test report"),
- () => cur_frm.set_value("location", "Fake office"),
- () => frappe.click_button('Add Row'),
- () => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'),
- (r) => {
- console.log(r);
- return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.employee = r.message.name;
- },
- () => {
- return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.attendance = "Optional";
- },
- () => frappe.click_button('Save'),
- () => frappe.timeout(2),
- () => frappe.click_button('Submit'),
- () => frappe.timeout(2),
- () => frappe.click_button('Yes'),
- () => frappe.timeout(1),
- () => {
- assert.equal(cur_frm.doc.docstatus, 1);
- },
- () => done()
- ]);
-
-});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_event/training_event.json b/erpnext/hr/doctype/training_event/training_event.json
index cb8518b..4b812a9 100644
--- a/erpnext/hr/doctype/training_event/training_event.json
+++ b/erpnext/hr/doctype/training_event/training_event.json
@@ -44,6 +44,37 @@
},
{
"allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "training_program",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Training Program",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Training Program",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -778,7 +809,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-06 10:59:09.217283",
+ "modified": "2017-10-23 06:13:29.065781",
"modified_by": "Administrator",
"module": "HR",
"name": "Training Event",
@@ -806,7 +837,7 @@
"write": 1
}
],
- "quick_entry": 1,
+ "quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "event_name",
diff --git a/erpnext/hr/doctype/training_program/__init__.py b/erpnext/hr/doctype/training_program/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/__init__.py
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.js b/erpnext/hr/doctype/training_program/test_training_program.js
similarity index 65%
copy from erpnext/buying/doctype/purchase_order/test_purchase_order.js
copy to erpnext/hr/doctype/training_program/test_training_program.js
index e9db270..3a62b2f 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.js
+++ b/erpnext/hr/doctype/training_program/test_training_program.js
@@ -2,15 +2,15 @@
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
-QUnit.test("test: Purchase Order", function (assert) {
+QUnit.test("test: Training Program", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
- frappe.run_serially('Purchase Order', [
- // insert a new Purchase Order
- () => frappe.tests.make([
+ frappe.run_serially([
+ // insert a new Training Program
+ () => frappe.tests.make('Training Program', [
// values to be set
{key: 'value'}
]),
diff --git a/erpnext/hr/doctype/training_program/test_training_program.py b/erpnext/hr/doctype/training_program/test_training_program.py
new file mode 100644
index 0000000..9d5b286
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/test_training_program.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestTrainingProgram(unittest.TestCase):
+ pass
diff --git a/erpnext/hr/doctype/training_program/training_program.js b/erpnext/hr/doctype/training_program/training_program.js
new file mode 100644
index 0000000..7d85cab
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/training_program.js
@@ -0,0 +1,5 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Training Program', {
+});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_program/training_program.json b/erpnext/hr/doctype/training_program/training_program.json
new file mode 100644
index 0000000..d9b33d5
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/training_program.json
@@ -0,0 +1,454 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:training_program",
+ "beta": 0,
+ "creation": "2017-10-11 04:43:17.230065",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "training_program",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Training Program",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Scheduled",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Scheduled\nCompleted\nCancelled",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_5",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "trainer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Trainer Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "trainer_email",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Trainer Email",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_8",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contact_number",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Contact Number",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_11",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Amended From",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Training Program",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-10-16 05:34:23.055153",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Training Program",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "title_field": "training_program",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_program/training_program.py b/erpnext/hr/doctype/training_program/training_program.py
new file mode 100644
index 0000000..7a3720b
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/training_program.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class TrainingProgram(Document):
+ pass
diff --git a/erpnext/hr/doctype/training_program/training_program_dashboard.py b/erpnext/hr/doctype/training_program/training_program_dashboard.py
new file mode 100644
index 0000000..a314081
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/training_program_dashboard.py
@@ -0,0 +1,12 @@
+from frappe import _
+
+def get_data():
+ return {
+ 'fieldname': 'training_program',
+ 'transactions': [
+ {
+ 'label': _('Training Events'),
+ 'items': ['Training Event']
+ },
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.json b/erpnext/hr/doctype/upload_attendance/upload_attendance.json
index 5a3f72a..16b7a83 100644
--- a/erpnext/hr/doctype/upload_attendance/upload_attendance.json
+++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.json
@@ -1,28 +1,39 @@
{
"allow_copy": 1,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
+ "beta": 0,
"creation": "2013-01-25 11:34:53",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "editable_grid": 0,
"fields": [
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "Download the Template, fill appropriate data and attach the modified file.\nAll dates and employee combination in the selected period will come in the template, with existing attendance records",
+ "columns": 0,
+ "description": "",
"fieldname": "download_template",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Download Template",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -30,22 +41,30 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "att_fr_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
- "in_list_view": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Attendance From Date",
+ "length": 0,
"no_copy": 0,
"oldfieldname": "attenadnce_date",
"oldfieldtype": "Date",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -53,20 +72,28 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "att_to_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
- "in_list_view": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Attendance To Date",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -74,21 +101,29 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "get_template",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Get Template",
+ "length": 0,
"no_copy": 0,
"oldfieldtype": "Button",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -96,20 +131,28 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "upload_attendance_data",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Import Attendance",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -117,20 +160,28 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "upload_html",
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Upload HTML",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -138,20 +189,28 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "import_log",
"fieldtype": "HTML",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Import Log",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -159,17 +218,18 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 1,
"icon": "fa fa-upload-alt",
"idx": 1,
+ "image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"max_attachments": 1,
- "modified": "2015-06-05 11:37:04.348120",
+ "modified": "2017-11-14 12:51:34.980103",
"modified_by": "Administrator",
"module": "HR",
"name": "Upload Attendance",
@@ -216,6 +276,10 @@
"write": 1
}
],
+ "quick_entry": 0,
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "track_changes": 0,
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/email_alert/training_scheduled/training_scheduled.json b/erpnext/hr/email_alert/training_scheduled/training_scheduled.json
index e1631f8..0782f0c 100644
--- a/erpnext/hr/email_alert/training_scheduled/training_scheduled.json
+++ b/erpnext/hr/email_alert/training_scheduled/training_scheduled.json
@@ -10,8 +10,8 @@
"idx": 0,
"is_standard": 1,
"message": "<h3>{{_(\"Training Event\")}}</h3>\n\n<p>{{ doc.introduction }}</p>\n\n<h4>{{_(\"Details\")}}</h4>\n{{_(\"Event Name\")}}: {{ frappe.utils.get_link_to_form(doc.doctype, doc.name) }}\n<br>{{_(\"Event Location\")}}: {{ doc.location }}\n<br>{{_(\"Start Time\")}}: {{ doc.start_time }}\n<br>{{_(\"End Time\")}}: {{ doc.end_time }}\n",
- "modified": "2017-08-13 22:49:42.338881",
- "modified_by": "Administrator",
+ "modified": "2017-08-13 22:49:42.338881",
+ "modified_by": "Administrator",
"module": "HR",
"name": "Training Scheduled",
"owner": "Administrator",
diff --git a/erpnext/hub_node/__init__.py b/erpnext/hub_node/__init__.py
index 686fe8d..76a7f6f 100644
--- a/erpnext/hub_node/__init__.py
+++ b/erpnext/hub_node/__init__.py
@@ -15,13 +15,16 @@
return hub_settings
@frappe.whitelist()
-def get_items(start=0, limit=20, category=None, order_by=None, text=None):
+def get_items(start=0, limit=20, category=None, order_by=None, company=None, text=None):
connection = get_connection()
filters = {
'hub_category': category,
}
if text:
filters.update({'item_name': ('like', '%' + text + '%')})
+ if company:
+ filters.update({'company_name': company})
+
response = connection.get_list('Hub Item',
limit_start=start, limit_page_length=limit,
filters=filters)
@@ -34,7 +37,9 @@
return response
@frappe.whitelist()
-def get_item_details(hub_sync_id):
+def get_item_details(hub_sync_id=None):
+ if not hub_sync_id:
+ return
connection = get_connection()
return connection.get_doc('Hub Item', hub_sync_id)
diff --git a/erpnext/hub_node/page/hub/hub.js b/erpnext/hub_node/page/hub/hub.js
index 143f554..15bd97d 100644
--- a/erpnext/hub_node/page/hub/hub.js
+++ b/erpnext/hub_node/page/hub/hub.js
@@ -215,7 +215,7 @@
.on('click', '.company-link a', function(e) {
e.preventDefault();
const company_name = $(this).attr('data-company-name');
- me.get_company_details(company_name);
+ frappe.set_route('hub', 'Company', company_name);
})
.on('click', '.breadcrumb li', function(e) {
e.preventDefault();
@@ -382,6 +382,7 @@
},
method: "erpnext.hub_node.get_item_details",
callback: (r) => {
+ if (!r || !r.message) return;
let item = r.message;
this.item_cache[item_code] = item;
this.render_item_page(item);
@@ -475,26 +476,34 @@
}
get_company_details(company_id) {
- // get from cache if exists
- let company_details = this.company_cache[company_id];
- if(this.company_cache[company_id]) {
- this.go_to_company_page(company_details);
- return;
- }
- frappe.call({
- method: 'erpnext.hub_node.get_company_details',
- args: {company_id: company_id}
- }).then((r) => {
- if (r.message) {
- const company_details = r.message.company_details;
- this.company_cache[company_id] = company_details;
- this.go_to_company_page(company_details)
+ this.company_cache = this.company_cache || {};
+
+ return new Promise(resolve => {
+ // get from cache if exists
+ let company_details = this.company_cache[company_id];
+ if(company_details) {
+ resolve(company_details);
+ return;
}
- });
+ frappe.call({
+ method: 'erpnext.hub_node.get_company_details',
+ args: {hub_sync_id: company_id}
+ }).then((r) => {
+ if (r.message) {
+ const company_details = r.message;
+ this.company_cache[company_id] = company_details;
+ resolve(company_details)
+ }
+ });
+ })
}
- go_to_company_page(company_details) {
- frappe.set_route('hub', 'Company', company_details.company_name);
+ go_to_company_page(company_id) {
+ this.get_company_details(company_id)
+ .then(this.show_company_page.bind(this));
+ }
+
+ show_company_page(company_details) {
this.$hub_main_section.empty();
let $company_page =
@@ -573,10 +582,10 @@
<h2>${ company_details.company_name }</h2>
</div>
<div class="company">
- <span class="">${ company_details.seller_city }</span>
+ <span class="">${ company_details.country }</span>
</div>
<div class="description">
- <span class="small">${ company_details.seller_description }</span>
+ <span class="small">${ company_details.site_name }</span>
</div>
</div>
@@ -835,7 +844,7 @@
</div>
</a>
<div class="company-link">
- <a data-company-name="${ item.company_id }" class="">${ item.company_name }</a>
+ <a data-company-name="${ item.company_name }" class="">${ item.company_name }</a>
</div>
<div>${ item.formatted_price ? item.formatted_price : ''}</div>
</div>
diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json
index 2558df3..85a3f7e 100644
--- a/erpnext/manufacturing/doctype/bom/bom.json
+++ b/erpnext/manufacturing/doctype/bom/bom.json
@@ -328,6 +328,36 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "currency_detail",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -359,8 +389,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "currency_detail",
- "fieldtype": "Section Break",
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -368,7 +398,6 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -420,35 +449,6 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "column_break_12",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "conversion_rate",
"fieldtype": "Float",
"hidden": 0,
@@ -1322,7 +1322,7 @@
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
- "collapsible": 1,
+ "collapsible": 0,
"columns": 0,
"depends_on": "eval:!doc.__islocal",
"fieldname": "section_break0",
@@ -1671,7 +1671,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-23 14:09:30.492628",
+ "modified": "2017-10-23 14:56:21.991160",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM",
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index b140bf5..d0cf609 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -587,7 +587,11 @@
frappe.throw(_("BOM {0} does not belong to Item {1}").format(bom_no, item))
@frappe.whitelist()
-def get_children():
+def get_children(doctype, parent=None, is_tree=False):
+ if not parent:
+ frappe.msgprint(_('Please select a BOM'))
+ return
+
if frappe.form_dict.parent:
return frappe.db.sql("""select
bom_item.item_code,
diff --git a/erpnext/manufacturing/doctype/bom/bom_tree.js b/erpnext/manufacturing/doctype/bom/bom_tree.js
index 09fe037..854f633 100644
--- a/erpnext/manufacturing/doctype/bom/bom_tree.js
+++ b/erpnext/manufacturing/doctype/bom/bom_tree.js
@@ -11,7 +11,7 @@
title: "BOM",
breadcrumb: "Manufacturing",
disable_add_node: true,
- root_label: "bom", //fieldname from filters
+ root_label: "All Bill of Materials", //fieldname from filters
get_label: function(node) {
if(node.data.qty) {
return node.data.qty + " x " + node.data.item_code;
diff --git a/erpnext/manufacturing/doctype/operation/test_operation.js b/erpnext/manufacturing/doctype/operation/test_operation.js
index 5aafe42..42553ce 100644
--- a/erpnext/manufacturing/doctype/operation/test_operation.js
+++ b/erpnext/manufacturing/doctype/operation/test_operation.js
@@ -14,7 +14,7 @@
]
);
},
- () => frappe.timeout(1),
+ () => frappe.timeout(3),
() => {
assert.ok(cur_frm.docname.includes('Assemble Keyboard'),
'Assemble Keyboard created successfully');
@@ -31,7 +31,7 @@
]
);
},
- () => frappe.timeout(1),
+ () => frappe.timeout(3),
// Create a CPU operation
() => {
@@ -42,7 +42,7 @@
]
);
},
- () => frappe.timeout(1),
+ () => frappe.timeout(3),
() => done()
]);
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index c3e6f20..226ebfc 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -17,6 +17,14 @@
}
});
+ frm.set_query("source_warehouse", function() {
+ return {
+ filters: {
+ 'company': frm.doc.company,
+ }
+ }
+ });
+
frm.set_query("source_warehouse", "required_items", function() {
return {
filters: {
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json
index 71357f6..a5428aa 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.json
+++ b/erpnext/manufacturing/doctype/production_order/production_order.json
@@ -1388,7 +1388,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-15 11:34:10.018611",
+ "modified": "2017-11-03 05:31:56.636724",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order",
@@ -1442,5 +1442,5 @@
"sort_order": "ASC",
"title_field": "production_item",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index a634bf2..fce9d65 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -576,7 +576,7 @@
where ((ifnull(planned_start_date, '0000-00-00')!= '0000-00-00') \
and (planned_start_date <= %(end)s) \
and ((ifnull(planned_start_date, '0000-00-00')!= '0000-00-00') \
- and planned_end_date >= %(start)s)) {conditions}
+ and ifnull(planned_end_date, '2199-12-31 00:00:00') >= %(start)s)) {conditions}
""".format(conditions=conditions), {
"start": start,
"end": end
diff --git a/erpnext/manufacturing/page/production_analytics/production_analytics.js b/erpnext/manufacturing/page/production_analytics/production_analytics.js
index 39168b7..efbd0a5 100644
--- a/erpnext/manufacturing/page/production_analytics/production_analytics.js
+++ b/erpnext/manufacturing/page/production_analytics/production_analytics.js
@@ -64,7 +64,7 @@
var chart_data = this.get_chart_data ? this.get_chart_data() : null;
- this.chart = new frappe.chart.FrappeChart({
+ this.chart = new Chart({
parent: ".chart",
data: chart_data,
type: 'line'
diff --git a/erpnext/modules.txt b/erpnext/modules.txt
index 5e9f6c7..79ded14 100644
--- a/erpnext/modules.txt
+++ b/erpnext/modules.txt
@@ -17,3 +17,4 @@
Regional
Healthcare
Restaurant
+ERPNext Integrations
\ No newline at end of file
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index ef34189..fb4e0ba 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -448,8 +448,15 @@
erpnext.patches.v8_9.delete_gst_doctypes_for_outside_india_accounts
erpnext.patches.v8_9.set_default_fields_in_variant_settings
erpnext.patches.v8_9.update_billing_gstin_for_indian_account
-erpnext.patches.v9_0.fix_subscription_next_date
+erpnext.patches.v9_0.add_user_to_child_table_in_pos_profile
erpnext.patches.v9_0.set_schedule_date_for_material_request_and_purchase_order
erpnext.patches.v9_0.student_admission_childtable_migrate
+erpnext.patches.v9_0.fix_subscription_next_date #2017-10-23
erpnext.patches.v9_0.add_healthcare_domain
erpnext.patches.v9_0.set_variant_item_description
+erpnext.patches.v9_0.set_uoms_in_variant_field
+erpnext.patches.v9_0.copy_old_fees_field_data
+execute:frappe.delete_doc_if_exists("DocType", "Program Fee")
+erpnext.patches.v9_0.set_pos_profile_name
+erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings
+execute:frappe.delete_doc_if_exists("DocType", "Program Fee")
diff --git a/erpnext/patches/v5_4/cleanup_journal_entry.py b/erpnext/patches/v5_4/cleanup_journal_entry.py
index a0c3323..9100b8f 100644
--- a/erpnext/patches/v5_4/cleanup_journal_entry.py
+++ b/erpnext/patches/v5_4/cleanup_journal_entry.py
@@ -1,5 +1,5 @@
import frappe
-from MySQLdb import OperationalError
+from pymysql import InternalError
def execute():
frappe.reload_doctype("Journal Entry Account")
@@ -15,6 +15,6 @@
frappe.db.sql("""update `tabJournal Entry Account`
set reference_type=%s, reference_name={0} where ifnull({0}, '') != ''
""".format(fieldname), doctype)
- except OperationalError:
+ except InternalError:
# column not found
pass
diff --git a/erpnext/patches/v5_7/item_template_attributes.py b/erpnext/patches/v5_7/item_template_attributes.py
index 22b15d3..6aa81f7 100644
--- a/erpnext/patches/v5_7/item_template_attributes.py
+++ b/erpnext/patches/v5_7/item_template_attributes.py
@@ -3,7 +3,7 @@
from __future__ import print_function, unicode_literals
import frappe
-import MySQLdb
+from frappe.exceptions import SQLError
def execute():
"""
@@ -31,7 +31,7 @@
try:
migrate_item_variants()
- except MySQLdb.ProgrammingError:
+ except SQLError:
print("`tabItem Variant` not found")
def rename_and_reload_doctypes():
diff --git a/erpnext/patches/v8_0/disable_instructor_role.py b/erpnext/patches/v8_0/disable_instructor_role.py
index 94ebd9c..4ba78d1 100644
--- a/erpnext/patches/v8_0/disable_instructor_role.py
+++ b/erpnext/patches/v8_0/disable_instructor_role.py
@@ -12,6 +12,7 @@
domains = frappe.db.sql_list("select domain from tabCompany")
if "Education" not in domains:
- role = frappe.get_doc("Role", "Instructor")
- role.disabled = 1
- role.save(ignore_permissions=True)
\ No newline at end of file
+ if frappe.db.exists("Role", "Instructor"):
+ role = frappe.get_doc("Role", "Instructor")
+ role.disabled = 1
+ role.save(ignore_permissions=True)
\ No newline at end of file
diff --git a/erpnext/patches/v8_7/make_subscription_from_recurring_data.py b/erpnext/patches/v8_7/make_subscription_from_recurring_data.py
index c5d7d72..2932749 100644
--- a/erpnext/patches/v8_7/make_subscription_from_recurring_data.py
+++ b/erpnext/patches/v8_7/make_subscription_from_recurring_data.py
@@ -18,24 +18,33 @@
frappe.reload_doc('accounts', 'doctype', 'journal_entry')
frappe.reload_doc('accounts', 'doctype', 'payment_entry')
- for doctype in ['Sales Order', 'Sales Invoice',
- 'Purchase Invoice', 'Purchase Invoice']:
- for data in get_data(doctype):
- make_subscription(doctype, data)
+ for doctype in ['Sales Order', 'Sales Invoice', 'Purchase Order', 'Purchase Invoice']:
+ date_field = "transaction_date"
+ if doctype in ("Sales Invoice", "Purchase Invoice"):
+ date_field = "posting_date"
-def get_data(doctype):
- return frappe.db.sql(""" select name, from_date, end_date, recurring_type,recurring_id,
+ for data in get_data(doctype, date_field):
+ make_subscription(doctype, data, date_field)
+
+def get_data(doctype, date_field):
+ return frappe.db.sql(""" select name, from_date, end_date, recurring_type, recurring_id,
next_date, notify_by_email, notification_email_address, recurring_print_format,
- repeat_on_day_of_month, submit_on_creation, docstatus
- from `tab{0}` where is_recurring = 1 and next_date >= %s and docstatus < 2
- """.format(doctype), today(), as_dict=1)
+ repeat_on_day_of_month, submit_on_creation, docstatus, {0}
+ from `tab{1}` where is_recurring = 1 and next_date >= %s and docstatus < 2
+ order by next_date desc
+ """.format(date_field, doctype), today(), as_dict=1)
-def make_subscription(doctype, data):
+def make_subscription(doctype, data, date_field):
+ if data.name == data.recurring_id:
+ start_date = data.get(date_field)
+ else:
+ start_date = frappe.db.get_value(doctype, data.recurring_id, date_field)
+
doc = frappe.get_doc({
'doctype': 'Subscription',
'reference_doctype': doctype,
- 'reference_document': data.name,
- 'start_date': data.from_date,
+ 'reference_document': data.recurring_id,
+ 'start_date': start_date,
'end_date': data.end_date,
'frequency': data.recurring_type,
'repeat_on_day': data.repeat_on_day_of_month,
diff --git a/erpnext/patches/v9_0/add_user_to_child_table_in_pos_profile.py b/erpnext/patches/v9_0/add_user_to_child_table_in_pos_profile.py
new file mode 100644
index 0000000..e7833c0
--- /dev/null
+++ b/erpnext/patches/v9_0/add_user_to_child_table_in_pos_profile.py
@@ -0,0 +1,22 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ doctype = 'POS Profile'
+ frappe.reload_doc('accounts', 'doctype', doctype)
+ frappe.reload_doc('accounts', 'doctype', 'POS Profile User')
+
+ for doc in frappe.get_all(doctype):
+ _doc = frappe.get_doc(doctype, doc.name)
+ user = frappe.db.get_value(doctype, doc.name, 'user')
+
+ if not user: continue
+
+ _doc.append('applicable_for_users', {
+ 'user': user
+ })
+ _doc.pos_profile_name = user + ' - ' + _doc.company
+ _doc.save()
diff --git a/erpnext/patches/v9_0/copy_old_fees_field_data.py b/erpnext/patches/v9_0/copy_old_fees_field_data.py
new file mode 100644
index 0000000..4243c5b
--- /dev/null
+++ b/erpnext/patches/v9_0/copy_old_fees_field_data.py
@@ -0,0 +1,13 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ frappe.reload_doc("schools", "doctype", "fees")
+
+ if "total_amount" not in frappe.db.get_table_columns("Fees"):
+ return
+
+ frappe.db.sql("""update tabFees set grand_total=total_amount where grand_total = 0.0""")
\ No newline at end of file
diff --git a/erpnext/patches/v9_0/fix_subscription_next_date.py b/erpnext/patches/v9_0/fix_subscription_next_date.py
index a36e60c..07af712 100644
--- a/erpnext/patches/v9_0/fix_subscription_next_date.py
+++ b/erpnext/patches/v9_0/fix_subscription_next_date.py
@@ -3,25 +3,41 @@
from __future__ import unicode_literals
import frappe
+from frappe.utils import getdate
+from erpnext.accounts.doctype.subscription.subscription import get_next_schedule_date
def execute():
frappe.reload_doctype('Subscription')
doctypes = ('Purchase Order', 'Sales Order', 'Purchase Invoice', 'Sales Invoice')
- for data in frappe.get_all('Subscription', fields = ["name", "reference_doctype", "reference_document"],
- filters = {'reference_doctype': ('in', doctypes)}):
- doc = frappe.get_doc('Subscription', data.name)
- fields = ['transaction_date']
- if doc.reference_doctype in ['Sales Invoice', 'Purchase Invoice']:
- fields = ['posting_date']
+ for data in frappe.get_all('Subscription',
+ fields = ["name", "reference_doctype", "reference_document",
+ "start_date", "frequency", "repeat_on_day"],
+ filters = {'reference_doctype': ('in', doctypes), 'docstatus': 1}):
- fields.extend(['from_date', 'to_date'])
- reference_data = frappe.db.get_value(data.reference_doctype,
- data.reference_document, fields, as_dict=1)
+ recurring_id = frappe.db.get_value(data.reference_doctype, data.reference_document, "recurring_id")
+ if recurring_id:
+ frappe.db.sql("update `tab{0}` set subscription=%s where recurring_id=%s"
+ .format(data.reference_doctype), (data.name, recurring_id))
- if reference_data:
- doc.start_date = reference_data.get('posting_date') or reference_data.get('transaction_date')
- doc.from_date = reference_data.get('from_date')
- doc.to_date = reference_data.get('to_date')
- doc.set_next_schedule_date()
- doc.db_update()
\ No newline at end of file
+ date_field = 'transaction_date'
+ if data.reference_doctype in ['Sales Invoice', 'Purchase Invoice']:
+ date_field = 'posting_date'
+
+ start_date = frappe.db.get_value(data.reference_doctype, data.reference_document, date_field)
+
+ if start_date and getdate(start_date) != getdate(data.start_date):
+ last_ref_date = frappe.db.sql("""
+ select {0}
+ from `tab{1}`
+ where subscription=%s and docstatus < 2
+ order by creation desc
+ limit 1
+ """.format(date_field, data.reference_doctype), data.name)[0][0]
+
+ next_schedule_date = get_next_schedule_date(last_ref_date, data.frequency, data.repeat_on_day)
+
+ frappe.db.set_value("Subscription", data.name, {
+ "start_date": start_date,
+ "next_schedule_date": next_schedule_date
+ }, None)
\ No newline at end of file
diff --git a/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py b/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py
new file mode 100644
index 0000000..33dc519
--- /dev/null
+++ b/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py
@@ -0,0 +1,7 @@
+import frappe
+
+def execute():
+ default_warehouse = frappe.db.get_value("Stock Settings", None, "default_warehouse")
+ if default_warehouse:
+ if not frappe.db.get_value("Warehouse", {"name": default_warehouse}):
+ frappe.db.set_value("Stock Settings", None, "default_warehouse", "")
\ No newline at end of file
diff --git a/erpnext/patches/v9_0/revert_manufacturing_user_role.py b/erpnext/patches/v9_0/revert_manufacturing_user_role.py
new file mode 100644
index 0000000..5bfa8c3
--- /dev/null
+++ b/erpnext/patches/v9_0/revert_manufacturing_user_role.py
@@ -0,0 +1,21 @@
+import frappe
+
+def execute():
+ if 'Manufacturing' in frappe.get_active_domains(): return
+
+ role = 'Manufacturing User'
+ frappe.db.set_value('Role', role, 'restrict_to_domain', '')
+ frappe.db.set_value('Role', role, 'disabled', 0)
+
+ users = frappe.get_all('Has Role', filters = {
+ 'parenttype': 'User',
+ 'role': ('in', ['System Manager', 'Manufacturing Manager'])
+ }, fields=['parent'], as_list=1)
+
+ for user in users:
+ _user = frappe.get_doc('User', user[0])
+ _user.append('roles', {
+ 'role': role
+ })
+ _user.flags.ignore_validate = True
+ _user.save()
diff --git a/erpnext/patches/v9_0/set_pos_profile_name.py b/erpnext/patches/v9_0/set_pos_profile_name.py
new file mode 100644
index 0000000..1958e2c
--- /dev/null
+++ b/erpnext/patches/v9_0/set_pos_profile_name.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ doctype = 'POS Profile'
+ frappe.reload_doctype(doctype)
+
+ for pos in frappe.get_all(doctype, filters={'disabled': 0}):
+ doc = frappe.get_doc(doctype, pos.name)
+
+ if not doc.user or doc.pos_profile_name: continue
+
+ try:
+ doc.pos_profile_name = doc.user + ' - ' + doc.company
+ doc.flags.ignore_validate = True
+ doc.flags.ignore_mandatory = True
+ doc.save()
+
+ frappe.rename_doc(doctype, doc.name, doc.pos_profile_name, force=True)
+ except frappe.LinkValidationError:
+ frappe.db.set_value("POS Profile", doc.name, 'disabled', 1)
diff --git a/erpnext/patches/v9_0/set_schedule_date_for_material_request_and_purchase_order.py b/erpnext/patches/v9_0/set_schedule_date_for_material_request_and_purchase_order.py
index 7ab0e2c..3d01297 100644
--- a/erpnext/patches/v9_0/set_schedule_date_for_material_request_and_purchase_order.py
+++ b/erpnext/patches/v9_0/set_schedule_date_for_material_request_and_purchase_order.py
@@ -17,6 +17,8 @@
doc = frappe.get_doc(doctype, record)
if doc.items:
if not doc.schedule_date:
- min_schedule_date = min([d.schedule_date for d in doc.items])
- frappe.db.set_value(doctype, record,
- "schedule_date", min_schedule_date, update_modified=False)
\ No newline at end of file
+ schedule_dates = [d.schedule_date for d in doc.items if d.schedule_date]
+ if len(schedule_dates) > 0:
+ min_schedule_date = min(schedule_dates)
+ frappe.db.set_value(doctype, record,
+ "schedule_date", min_schedule_date, update_modified=False)
\ No newline at end of file
diff --git a/erpnext/patches/v9_0/set_uoms_in_variant_field.py b/erpnext/patches/v9_0/set_uoms_in_variant_field.py
new file mode 100644
index 0000000..9e783d9
--- /dev/null
+++ b/erpnext/patches/v9_0/set_uoms_in_variant_field.py
@@ -0,0 +1,14 @@
+from __future__ import unicode_literals
+import frappe
+
+
+def execute():
+ doc = frappe.get_doc('Item Variant Settings')
+ variant_field_names = [vf.field_name for vf in doc.fields]
+ if 'uoms' not in variant_field_names:
+ doc.append(
+ 'fields', {
+ 'field_name': 'uoms'
+ }
+ )
+ doc.save()
diff --git a/erpnext/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js
index df38cfe..b8f324a 100644
--- a/erpnext/projects/doctype/task/task.js
+++ b/erpnext/projects/doctype/task/task.js
@@ -19,38 +19,47 @@
},
refresh: function(frm) {
- var doc = frm.doc;
- if(doc.__islocal) {
- if(!frm.doc.exp_end_date) {
- frm.set_value("exp_end_date", frappe.datetime.add_days(new Date(), 7));
+ frm.fields_dict['parent_task'].get_query = function() {
+ return {
+ filters: {
+ "is_group": 1,
+ }
}
}
-
- if(!doc.__islocal) {
- if(frappe.model.can_read("Timesheet")) {
- frm.add_custom_button(__("Timesheet"), function() {
- frappe.route_options = {"project": doc.project, "task": doc.name}
- frappe.set_route("List", "Timesheet");
- }, __("View"), true);
- }
- if(frappe.model.can_read("Expense Claim")) {
- frm.add_custom_button(__("Expense Claims"), function() {
- frappe.route_options = {"project": doc.project, "task": doc.name}
- frappe.set_route("List", "Expense Claim");
- }, __("View"), true);
+ if(!frm.is_group){
+ var doc = frm.doc;
+ if(doc.__islocal) {
+ if(!frm.doc.exp_end_date) {
+ frm.set_value("exp_end_date", frappe.datetime.add_days(new Date(), 7));
+ }
}
- if(frm.perm[0].write) {
- if(frm.doc.status!=="Closed" && frm.doc.status!=="Cancelled") {
- frm.add_custom_button(__("Close"), function() {
- frm.set_value("status", "Closed");
- frm.save();
- });
- } else {
- frm.add_custom_button(__("Reopen"), function() {
- frm.set_value("status", "Open");
- frm.save();
- });
+ if(!doc.__islocal) {
+ if(frappe.model.can_read("Timesheet")) {
+ frm.add_custom_button(__("Timesheet"), function() {
+ frappe.route_options = {"project": doc.project, "task": doc.name}
+ frappe.set_route("List", "Timesheet");
+ }, __("View"), true);
+ }
+ if(frappe.model.can_read("Expense Claim")) {
+ frm.add_custom_button(__("Expense Claims"), function() {
+ frappe.route_options = {"project": doc.project, "task": doc.name}
+ frappe.set_route("List", "Expense Claim");
+ }, __("View"), true);
+ }
+
+ if(frm.perm[0].write) {
+ if(frm.doc.status!=="Closed" && frm.doc.status!=="Cancelled") {
+ frm.add_custom_button(__("Close"), function() {
+ frm.set_value("status", "Closed");
+ frm.save();
+ });
+ } else {
+ frm.add_custom_button(__("Reopen"), function() {
+ frm.set_value("status", "Open");
+ frm.save();
+ });
+ }
}
}
}
@@ -71,6 +80,21 @@
}
},
+ is_group: function(frm) {
+ frappe.call({
+ method:"erpnext.projects.doctype.task.task.check_if_child_exists",
+ args: {
+ name: frm.doc.name
+ },
+ callback: function(r){
+ if(r.message){
+ frappe.msgprint(__('Cannot convert it to non-group. Child Tasks exist.'));
+ frm.reload_doc();
+ }
+ }
+ })
+ },
+
validate: function(frm) {
frm.doc.project && frappe.model.remove_from_locals("Project",
frm.doc.project);
diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json
index e4ab5a7..8e72d03 100644
--- a/erpnext/projects/doctype/task/task.json
+++ b/erpnext/projects/doctype/task/task.json
@@ -2,7 +2,7 @@
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
- "allow_rename": 1,
+ "allow_rename": 0,
"autoname": "TASK.#####",
"beta": 0,
"creation": "2013-01-29 19:25:50",
@@ -30,9 +30,8 @@
"label": "Subject",
"length": 0,
"no_copy": 0,
- "oldfieldname": "subject",
- "oldfieldtype": "Data",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -78,6 +77,37 @@
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "fieldname": "is_group",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Is Group",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -173,9 +203,42 @@
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"columns": 0,
+ "fieldname": "parent_task",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Parent Task",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Task",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "collapsible_depends_on": "",
+ "columns": 0,
+ "depends_on": "",
"fieldname": "section_break_10",
"fieldtype": "Section Break",
"hidden": 0,
@@ -205,6 +268,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "exp_start_date",
"fieldtype": "Date",
"hidden": 0,
@@ -237,6 +301,7 @@
"collapsible": 0,
"columns": 0,
"default": "0",
+ "depends_on": "",
"description": "",
"fieldname": "expected_time",
"fieldtype": "Float",
@@ -269,6 +334,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "task_weight",
"fieldtype": "Float",
"hidden": 0,
@@ -328,6 +394,7 @@
"bold": 1,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "exp_end_date",
"fieldtype": "Date",
"hidden": 0,
@@ -359,6 +426,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "progress",
"fieldtype": "Percent",
"hidden": 0,
@@ -389,6 +457,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "is_milestone",
"fieldtype": "Check",
"hidden": 0,
@@ -418,7 +487,9 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "collapsible_depends_on": "",
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break0",
"fieldtype": "Section Break",
"hidden": 0,
@@ -449,6 +520,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -481,7 +553,9 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "collapsible_depends_on": "",
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break",
"fieldtype": "Section Break",
"hidden": 0,
@@ -512,6 +586,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "depends_on",
"fieldtype": "Table",
"hidden": 0,
@@ -543,6 +618,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "depends_on_tasks",
"fieldtype": "Data",
"hidden": 1,
@@ -572,7 +648,9 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "collapsible_depends_on": "",
"columns": 0,
+ "depends_on": "",
"description": "",
"fieldname": "actual",
"fieldtype": "Section Break",
@@ -606,6 +684,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "act_start_date",
"fieldtype": "Date",
"hidden": 0,
@@ -638,6 +717,7 @@
"collapsible": 0,
"columns": 0,
"default": "",
+ "depends_on": "",
"description": "",
"fieldname": "actual_time",
"fieldtype": "Float",
@@ -699,6 +779,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "act_end_date",
"fieldtype": "Date",
"hidden": 0,
@@ -730,6 +811,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "section_break_17",
"fieldtype": "Section Break",
"hidden": 0,
@@ -759,6 +841,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "total_costing_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -791,6 +874,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "total_expense_claim",
"fieldtype": "Currency",
"hidden": 0,
@@ -851,6 +935,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "",
"fieldname": "total_billing_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1025,6 +1110,96 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "lft",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "rgt",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "old_parent",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Old Parent",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
}
],
"has_web_view": 0,
@@ -1039,7 +1214,7 @@
"istable": 0,
"max_attachments": 5,
"menu_index": 0,
- "modified": "2017-05-23 11:28:28.161600",
+ "modified": "2017-11-10 18:37:19.660293",
"modified_by": "Administrator",
"module": "Projects",
"name": "Task",
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index 52ae132..fa56a95 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -5,13 +5,14 @@
import frappe, json
from frappe.utils import getdate, date_diff, add_days, cstr
-from frappe import _
-
-from frappe.model.document import Document
+from frappe import _, throw
+from frappe.utils.nestedset import NestedSet
class CircularReferenceError(frappe.ValidationError): pass
-class Task(Document):
+class Task(NestedSet):
+ nsm_parent_field = 'parent_task'
+
def get_feed(self):
return '{0}: {1}'.format(_(self.status), self.subject)
@@ -59,7 +60,11 @@
depends_on_tasks += d.task + ","
self.depends_on_tasks = depends_on_tasks
+ def update_nsm_model(self):
+ frappe.utils.nestedset.update_nsm(self)
+
def on_update(self):
+ self.update_nsm_model()
self.check_recursion()
self.reschedule_dependent_tasks()
self.update_project()
@@ -105,16 +110,20 @@
frappe.throw(_("Circular Reference Error"), CircularReferenceError)
if b[0]:
task_list.append(b[0])
+
if count == 15:
break
def reschedule_dependent_tasks(self):
end_date = self.exp_end_date or self.act_end_date
if end_date:
- for task_name in frappe.db.sql("""select name from `tabTask` as parent where parent.project = %(project)s and parent.name in \
- (select parent from `tabTask Depends On` as child where child.task = %(task)s and child.project = %(project)s)""",
- {'project': self.project, 'task':self.name }, as_dict=1):
-
+ for task_name in frappe.db.sql("""
+ select name from `tabTask` as parent
+ where parent.project = %(project)s
+ and parent.name in (
+ select parent from `tabTask Depends On` as child
+ where child.task = %(task)s and child.project = %(project)s)
+ """, {'project': self.project, 'task':self.name }, as_dict=1):
task = frappe.get_doc("Task", task_name.name)
if task.exp_start_date and task.exp_end_date and task.exp_start_date < getdate(end_date) and task.status == "Open":
task_duration = date_diff(task.exp_end_date, task.exp_start_date)
@@ -128,6 +137,17 @@
if project_user:
return True
+ def on_trash(self):
+ if check_if_child_exists(self.name):
+ throw(_("Child Task exists for this Task. You can not delete this Task."))
+
+ self.update_nsm_model()
+
+@frappe.whitelist()
+def check_if_child_exists(name):
+ return frappe.db.sql("""select name from `tabTask`
+ where parent_task = %s""", name)
+
@frappe.whitelist()
def get_events(start, end, filters=None):
"""Returns events for Gantt / Calendar view rendering.
@@ -177,4 +197,54 @@
and exp_end_date < CURDATE()
and `status` not in ('Closed', 'Cancelled')""")
+@frappe.whitelist()
+def get_children(doctype, parent, task=None, project=None, is_root=False):
+ conditions = ''
+ if task:
+ # via filters
+ conditions += ' and parent_task = "{0}"'.format(frappe.db.escape(task))
+ elif parent and not is_root:
+ # via expand child
+ conditions += ' and parent_task = "{0}"'.format(frappe.db.escape(parent))
+ else:
+ conditions += ' and ifnull(parent_task, "")=""'
+
+ if project:
+ conditions += ' and project = "{0}"'.format(frappe.db.escape(project))
+
+ tasks = frappe.db.sql("""select name as value,
+ subject as title,
+ is_group as expandable
+ from `tabTask`
+ where docstatus < 2
+ {conditions}
+ order by name""".format(conditions=conditions), as_dict=1)
+
+ # return tasks
+ return tasks
+
+@frappe.whitelist()
+def add_node():
+ from frappe.desk.treeview import make_tree_args
+ args = frappe.form_dict
+ args.update({
+ "name_field": "subject"
+ })
+ args = make_tree_args(**args)
+
+ if args.parent_task == 'task':
+ args.parent_task = None
+
+ frappe.get_doc(args).insert()
+
+@frappe.whitelist()
+def add_multiple_tasks(data, parent):
+ data = json.loads(data)['tasks']
+ tasks = data.split('\n')
+ new_doc = {'doctype': 'Task', 'parent_task': parent}
+
+ for d in tasks:
+ new_doc['subject'] = d
+ new_task = frappe.get_doc(new_doc)
+ new_task.insert()
diff --git a/erpnext/projects/doctype/task/task_list.js b/erpnext/projects/doctype/task/task_list.js
index ee224d9..887bd42 100644
--- a/erpnext/projects/doctype/task/task_list.js
+++ b/erpnext/projects/doctype/task/task_list.js
@@ -25,7 +25,9 @@
return [__(doc.status), colors[doc.status], "status,=," + doc.status];
},
gantt_custom_popup_html: function(ganttobj, task) {
- var html = `<h5>${ganttobj.name}</h5>`;
+ var html = `<h5><a style="text-decoration:underline"\
+ href="#Form/Task/${ganttobj.id}""> ${ganttobj.name} </a></h5>`;
+
if(task.project) html += `<p>Project: ${task.project}</p>`;
html += `<p>Progress: ${ganttobj.progress}</p>`;
diff --git a/erpnext/projects/doctype/task/task_tree.js b/erpnext/projects/doctype/task/task_tree.js
new file mode 100644
index 0000000..935a1e0
--- /dev/null
+++ b/erpnext/projects/doctype/task/task_tree.js
@@ -0,0 +1,60 @@
+frappe.provide("frappe.treeview_settings");
+
+frappe.treeview_settings['Task'] = {
+ get_tree_nodes: "erpnext.projects.doctype.task.task.get_children",
+ add_tree_node: "erpnext.projects.doctype.task.task.add_node",
+ filters: [
+ {
+ fieldname: "project",
+ fieldtype:"Link",
+ options: "Project",
+ label: __("Project"),
+ },
+ {
+ fieldname: "task",
+ fieldtype:"Link",
+ options: "Task",
+ label: __("Task"),
+ get_query: function() {
+ return {
+ filters: [["Task", 'is_group', '=', 1]]
+ };
+ }
+ }
+ ],
+ breadcrumb: "Projects",
+ get_tree_root: false,
+ root_label: "All Tasks",
+ ignore_fields: ["parent_task"],
+ onload: function(me) {
+ me.make_tree();
+ },
+ toolbar: [
+ {
+ label:__("Add Multiple"),
+ condition: function(node) {
+ return node.expandable;
+ },
+ click: function(node) {
+ var d = new frappe.ui.Dialog({
+ 'fields': [
+ {'fieldname': 'tasks', 'label': 'Tasks', 'fieldtype': 'Text'},
+ ],
+ primary_action: function() {
+ d.hide();
+ return frappe.call({
+ method: "erpnext.projects.doctype.task.task.add_multiple_tasks",
+ args: {
+ data: d.get_values(),
+ parent: node.data.value
+ },
+ callback: function() { }
+ });
+ }
+ });
+ d.show();
+ }
+ }
+ ],
+ extend_toolbar: true
+};
\ No newline at end of file
diff --git a/erpnext/projects/doctype/task/test_records.json b/erpnext/projects/doctype/task/test_records.json
deleted file mode 100644
index 42ca0e7..0000000
--- a/erpnext/projects/doctype/task/test_records.json
+++ /dev/null
@@ -1,15 +0,0 @@
-[
- {
- "status": "Open",
- "subject": "_Test Task",
- "name": "task001"
- },
- {
- "status": "Open",
- "subject": "_Test Task 1"
- },
- {
- "status": "Open",
- "subject": "_Test Task 2"
- }
-]
\ No newline at end of file
diff --git a/erpnext/projects/doctype/task/test_task.py b/erpnext/projects/doctype/task/test_task.py
index 2e64b73..1d94618 100644
--- a/erpnext/projects/doctype/task/test_task.py
+++ b/erpnext/projects/doctype/task/test_task.py
@@ -5,137 +5,61 @@
import unittest
from frappe.utils import getdate, nowdate, add_days
-# test_records = frappe.get_test_records('Task')
-
from erpnext.projects.doctype.task.task import CircularReferenceError
class TestTask(unittest.TestCase):
def test_circular_reference(self):
+ task1 = create_task("_Test Task 1", nowdate(), add_days(nowdate(), 10))
+ task2 = create_task("_Test Task 2", add_days(nowdate(), 11), add_days(nowdate(), 15), task1.name)
+ task3 = create_task("_Test Task 3", add_days(nowdate(), 11), add_days(nowdate(), 15), task2.name)
- task1 = frappe.new_doc('Task')
- task1.update({
- "status": "Open",
- "subject": "_Test Task 1",
- "project": "_Test Project",
- "exp_start_date": "2015-1-1",
- "exp_end_date": "2015-1-10"
- })
- task1.save()
-
- task2 = frappe.new_doc('Task')
- task2.update({
- "status": "Open",
- "subject": "_Test Task 2",
- "project": "_Test Project",
- "exp_start_date": "2015-1-11",
- "exp_end_date": "2015-1-15",
- "depends_on":[
- {
- "task": task1.name
- }
- ]
- })
- task2.save()
-
- task3 = frappe.new_doc('Task')
- task3.update({
- "status": "Open",
- "subject": "_Test Task 2",
- "project": "_Test Project",
- "exp_start_date": "2015-1-11",
- "exp_end_date": "2015-1-15",
- "depends_on":[
- {
- "task": task2.name
- }
- ]
- })
- task3.save()
-
+ task1.reload()
task1.append("depends_on", {
"task": task3.name
})
+
self.assertRaises(CircularReferenceError, task1.save)
task1.set("depends_on", [])
task1.save()
- task4 = frappe.new_doc('Task')
- task4.update({
- "status": "Open",
- "subject": "_Test Task 1",
- "exp_start_date": "2015-1-1",
- "exp_end_date": "2015-1-15",
- "depends_on":[
- {
- "task": task1.name
- }
- ]
- })
- task4.save()
+ task4 = create_task("_Test Task 4", nowdate(), add_days(nowdate(), 15), task1.name)
task3.append("depends_on", {
"task": task4.name
})
def test_reschedule_dependent_task(self):
- task1 = frappe.new_doc('Task')
- task1.update({
- "status": "Open",
- "subject": "_Test Task 1",
- "project": "_Test Project",
- "exp_start_date": "2015-1-1",
- "exp_end_date": "2015-1-10"
- })
- task1.save()
+ task1 = create_task("_Test Task 1", nowdate(), add_days(nowdate(), 10))
- task2 = frappe.new_doc('Task')
- task2.update({
- "status": "Open",
- "subject": "_Test Task 2",
- "project": "_Test Project",
- "exp_start_date": "2015-1-11",
- "exp_end_date": "2015-1-15",
- "depends_on":[
- {
- "task": task1.name,
- "project": "_Test Project"
- }
- ]
- })
+ task2 = create_task("_Test Task 2", add_days(nowdate(), 11), add_days(nowdate(), 15), task1.name)
+ task2.get("depends_on")[0].project = "_Test Project"
task2.save()
- task3 = frappe.new_doc('Task')
- task3.update({
- "status": "Open",
- "subject": "_Test Task 3",
- "project": "_Test Project",
- "exp_start_date": "2015-1-16",
- "exp_end_date": "2015-1-18",
- "depends_on":[
- {
- "task": task2.name,
- "project": "_Test Project"
- }
- ]
- })
+ task3 = create_task("_Test Task 3", add_days(nowdate(), 11), add_days(nowdate(), 15), task2.name)
+ task3.get("depends_on")[0].project = "_Test Project"
task3.save()
task1.update({
- "exp_end_date": "2015-1-20"
+ "exp_end_date": add_days(nowdate(), 20)
})
task1.save()
- self.assertEqual(frappe.db.get_value("Task", task2.name, "exp_start_date"), getdate('2015-1-21'))
- self.assertEqual(frappe.db.get_value("Task", task2.name, "exp_end_date"), getdate('2015-1-25'))
+ self.assertEqual(frappe.db.get_value("Task", task2.name, "exp_start_date"),
+ getdate(add_days(nowdate(), 21)))
+ self.assertEqual(frappe.db.get_value("Task", task2.name, "exp_end_date"),
+ getdate(add_days(nowdate(), 25)))
- self.assertEqual(frappe.db.get_value("Task", task3.name, "exp_start_date"), getdate('2015-1-26'))
- self.assertEqual(frappe.db.get_value("Task", task3.name, "exp_end_date"), getdate('2015-1-28'))
+ self.assertEqual(frappe.db.get_value("Task", task3.name, "exp_start_date"),
+ getdate(add_days(nowdate(), 26)))
+ self.assertEqual(frappe.db.get_value("Task", task3.name, "exp_end_date"),
+ getdate(add_days(nowdate(), 30)))
def test_close_assignment(self):
- task = frappe.new_doc("Task")
- task.subject = "Test Close Assignment"
- task.insert()
+ if not frappe.db.exists("Task", "Test Close Assignment"):
+ task = frappe.new_doc("Task")
+ task.subject = "Test Close Assignment"
+ task.insert()
def assign():
from frappe.desk.form import assign_to
@@ -147,8 +71,10 @@
})
def get_owner_and_status():
- return frappe.db.get_value("ToDo", filters={"reference_type": task.doctype, "reference_name": task.name,
- "description": "Close this task"}, fieldname=("owner", "status"), as_dict=True)
+ return frappe.db.get_value("ToDo",
+ filters={"reference_type": task.doctype, "reference_name": task.name,
+ "description": "Close this task"},
+ fieldname=("owner", "status"), as_dict=True)
assign()
todo = get_owner_and_status()
@@ -164,16 +90,29 @@
self.assertEquals(todo.status, "Closed")
def test_overdue(self):
- task = frappe.get_doc({
- "doctype":"Task",
- "subject": "Testing Overdue",
- "status": "Open",
- "exp_end_date": add_days(nowdate(), -1)
- })
-
- task.insert()
+ task = create_task("Testing Overdue", add_days(nowdate(), -10), add_days(nowdate(), -5))
from erpnext.projects.doctype.task.task import set_tasks_as_overdue
set_tasks_as_overdue()
self.assertEquals(frappe.db.get_value("Task", task.name, "status"), "Overdue")
+
+def create_task(subject, start=None, end=None, depends_on=None, project=None):
+ if not frappe.db.exists("Task", subject):
+ task = frappe.new_doc('Task')
+ task.status = "Open"
+ task.subject = subject
+ task.exp_start_date = start or nowdate()
+ task.exp_end_date = end or nowdate()
+ task.project = project or "_Test Project"
+ task.save()
+ else:
+ task = frappe.get_doc("Task", subject)
+
+ if depends_on:
+ task.append("depends_on", {
+ "task": depends_on
+ })
+ task.save()
+
+ return task
\ No newline at end of file
diff --git a/erpnext/projects/doctype/task/test_task.js b/erpnext/projects/doctype/task/tests/test_task.js
similarity index 100%
rename from erpnext/projects/doctype/task/test_task.js
rename to erpnext/projects/doctype/task/tests/test_task.js
diff --git a/erpnext/projects/doctype/task/tests/test_task_tree.js b/erpnext/projects/doctype/task/tests/test_task_tree.js
new file mode 100644
index 0000000..9cbcf85
--- /dev/null
+++ b/erpnext/projects/doctype/task/tests/test_task_tree.js
@@ -0,0 +1,99 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Task Tree", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(5);
+
+ frappe.run_serially([
+ // insert a new Task
+ () => frappe.set_route('Tree', 'Task'),
+ () => frappe.timeout(0.5),
+
+ // Checking adding child without selecting any Node
+ () => frappe.tests.click_button('New'),
+ () => frappe.timeout(0.5),
+ () => {assert.equal($(`.msgprint`).text(), "Select a group node first.", "Error message success");},
+ () => frappe.tests.click_button('Close'),
+ () => frappe.timeout(0.5),
+
+ // Creating child nodes
+ () => frappe.tests.click_link('task'),
+ () => frappe.map_group.make('Test-1'),
+ () => frappe.map_group.make('Test-2'),
+ () => frappe.map_group.make('Test-3', 1),
+ () => frappe.timeout(1),
+ () => frappe.tests.click_link('Test-3'),
+ () => frappe.map_group.make('Test-4', 0),
+
+ // Checking Edit button
+ () => frappe.timeout(0.5),
+ () => frappe.tests.click_link('Test-1'),
+ () => frappe.tests.click_button('Edit'),
+ () => frappe.timeout(0.5),
+ () => {assert.deepEqual(frappe.get_route(), ["Form", "Task", "Test-1"], "Edit route checks");},
+
+ // Deleting child Node
+ () => frappe.set_route('Tree', 'Task'),
+ () => frappe.timeout(0.5),
+ () => frappe.tests.click_link('Test-1'),
+ () => frappe.tests.click_button('Delete'),
+ () => frappe.timeout(0.5),
+ () => frappe.tests.click_button('Yes'),
+
+ // Deleting Group Node that has child nodes in it
+ () => frappe.timeout(0.5),
+ () => frappe.tests.click_link('Test-3'),
+ () => frappe.tests.click_button('Delete'),
+ () => frappe.timeout(0.5),
+ () => frappe.tests.click_button('Yes'),
+ () => frappe.timeout(1),
+ () => {assert.equal(cur_dialog.title, 'Message', 'Error thrown correctly');},
+ () => frappe.tests.click_button('Close'),
+
+ // Renaming Child node
+ () => frappe.timeout(0.5),
+ () => frappe.tests.click_link('Test-2'),
+ () => frappe.tests.click_button('Rename'),
+ () => frappe.timeout(1),
+ () => cur_dialog.set_value('new_name', 'Test-5'),
+ () => frappe.timeout(1.5),
+ () => cur_dialog.get_primary_btn().click(),
+ () => frappe.timeout(1),
+ () => {assert.equal($(`a:contains("Test-5"):visible`).length, 1, 'Rename successfull');},
+
+ // Add multiple child tasks
+ () => frappe.tests.click_link('Test-3'),
+ () => frappe.timeout(0.5),
+ () => frappe.click_button('Add Multiple'),
+ () => frappe.timeout(1),
+ () => cur_dialog.set_value('tasks', 'Test-6\nTest-7'),
+ () => frappe.timeout(0.5),
+ () => frappe.click_button('Submit'),
+ () => frappe.timeout(2),
+ () => frappe.click_button('Expand All'),
+ () => frappe.timeout(1),
+ () => {
+ let count = $(`a:contains("Test-6"):visible`).length + $(`a:contains("Test-7"):visible`).length;
+ assert.equal(count, 2, "Multiple Tasks added successfully");
+ },
+
+ () => done()
+ ]);
+});
+
+frappe.map_group = {
+ make:function(subject, is_group = 0){
+ return frappe.run_serially([
+ () => frappe.click_button('Add Child'),
+ () => frappe.timeout(1),
+ () => cur_dialog.set_value('is_group', is_group),
+ () => cur_dialog.set_value('subject', subject),
+ () => frappe.click_button('Create New'),
+ () => frappe.timeout(1.5)
+ ]);
+ }
+};
diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js
index 1ea5962..43f5705 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.js
+++ b/erpnext/projects/doctype/timesheet/timesheet.js
@@ -191,7 +191,6 @@
var child = locals[cdt][cdn];
if(!child.billable){
frappe.model.set_value(cdt, cdn, 'billing_rate', 0.0);
- frappe.model.set_value(cdt, cdn, 'costing_rate', 0.0);
}
}
@@ -202,9 +201,8 @@
if(child.billing_hours && child.billable){
billing_amount = (child.billing_hours * child.billing_rate);
- costing_amount = flt(child.costing_rate * child.billing_hours);
}
-
+ costing_amount = flt(child.costing_rate * child.hours);
frappe.model.set_value(cdt, cdn, 'billing_amount', billing_amount);
frappe.model.set_value(cdt, cdn, 'costing_amount', costing_amount);
calculate_time_and_amount(frm);
diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py
index ad566d5..01552a5 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.py
+++ b/erpnext/projects/doctype/timesheet/timesheet.py
@@ -49,10 +49,10 @@
self.update_time_rates(d)
self.total_hours += flt(d.hours)
+ self.total_costing_amount += flt(d.costing_amount)
if d.billable:
self.total_billable_hours += flt(d.billing_hours)
self.total_billable_amount += flt(d.billing_amount)
- self.total_costing_amount += flt(d.costing_amount)
self.total_billed_amount += flt(d.billing_amount) if d.sales_invoice else 0.0
self.total_billed_hours += flt(d.billing_hours) if d.sales_invoice else 0.0
@@ -265,19 +265,19 @@
def update_cost(self):
for data in self.time_logs:
- if data.activity_type and data.billable:
+ if data.activity_type or data.billable:
rate = get_activity_cost(self.employee, data.activity_type)
hours = data.billing_hours or 0
+ costing_hours = data.billing_hours or data.hours or 0
if rate:
data.billing_rate = flt(rate.get('billing_rate')) if flt(data.billing_rate) == 0 else data.billing_rate
data.costing_rate = flt(rate.get('costing_rate')) if flt(data.costing_rate) == 0 else data.costing_rate
data.billing_amount = data.billing_rate * hours
- data.costing_amount = data.costing_rate * hours
+ data.costing_amount = data.costing_rate * costing_hours
def update_time_rates(self, ts_detail):
if not ts_detail.billable:
ts_detail.billing_rate = 0.0
- ts_detail.costing_rate = 0.0
@frappe.whitelist()
def get_projectwise_timesheet_data(project, parent=None):
diff --git a/erpnext/public/build.json b/erpnext/public/build.json
index 393e90c..0730df9 100644
--- a/erpnext/public/build.json
+++ b/erpnext/public/build.json
@@ -32,7 +32,9 @@
"public/js/utils/item_selector.js",
"public/js/help_links.js",
"public/js/schools/student_button.html",
- "public/js/schools/assessment_result_tool.html"
+ "public/js/schools/assessment_result_tool.html",
+ "public/js/templates/item_quick_entry.html",
+ "public/js/utils/item_quick_entry.js"
],
"js/item-dashboard.min.js": [
"stock/dashboard/item_dashboard.html",
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 5b647f8..b07d090 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -231,8 +231,16 @@
},
callback: function(r) {
if(!r.exc) {
- me.frm.set_value("taxes", r.message);
- me.calculate_taxes_and_totals();
+ frappe.run_serially([
+ () => {
+ // directly set in doc, so as not to call triggers
+ me.frm.doc.taxes_and_charges = r.message.taxes_and_charges;
+
+ // set taxes table
+ me.frm.set_value("taxes", r.message.taxes);
+ },
+ () => me.calculate_taxes_and_totals()
+ ]);
}
}
});
@@ -542,11 +550,7 @@
}
// Make read only if Accounts Settings doesn't allow stale rates
- frappe.model.get_value("Accounts Settings", null, "allow_stale",
- function(d){
- me.set_df_property("conversion_rate", "read_only", cint(d.allow_stale) ? 0 : 1);
- }
- );
+ this.frm.set_df_property("conversion_rate", "read_only", erpnext.stale_rate_allowed());
},
set_actual_charges_based_on_currency: function() {
@@ -939,19 +943,27 @@
return;
}
+ if (me.in_apply_price_list == true) return;
+
+ me.in_apply_price_list = true;
return this.frm.call({
method: "erpnext.stock.get_item_details.apply_price_list",
args: { args: args },
callback: function(r) {
if (!r.exc) {
- me.in_apply_price_list = true;
- me.frm.set_value("price_list_currency", r.message.parent.price_list_currency);
- me.frm.set_value("plc_conversion_rate", r.message.parent.plc_conversion_rate);
- me.in_apply_price_list = false;
+ frappe.run_serially([
+ () => me.frm.set_value("price_list_currency", r.message.parent.price_list_currency),
+ () => me.frm.set_value("plc_conversion_rate", r.message.parent.plc_conversion_rate),
+ () => {
+ if(args.items.length) {
+ me._set_values_for_item_list(r.message.children);
+ }
+ },
+ () => { me.in_apply_price_list = false; }
+ ]);
- if(args.items.length) {
- me._set_values_for_item_list(r.message.children);
- }
+ } else {
+ me.in_apply_price_list = false;
}
}
});
@@ -1116,11 +1128,11 @@
filters: {'item': item.item_code}
}
} else {
- filters = {
+ let filters = {
'item_code': item.item_code,
'posting_date': me.frm.doc.posting_date || frappe.datetime.nowdate(),
}
- if(item.warehouse) filters["warehouse"] = item.warehouse
+ if (item.warehouse) filters["warehouse"] = item.warehouse
return {
query : "erpnext.controllers.queries.get_batch_no",
diff --git a/erpnext/public/js/pos/pos_selected_item.html b/erpnext/public/js/pos/pos_selected_item.html
index 6f2772b..085e048 100644
--- a/erpnext/public/js/pos/pos_selected_item.html
+++ b/erpnext/public/js/pos/pos_selected_item.html
@@ -8,7 +8,7 @@
<input type="tel" class="form-control cell" disabled value="{%= price_list_rate %}"/>
</div>
<div class="pos-list-row">
- <div class="cell">{{ __("Discount") }}:</div>
+ <div class="cell">{{ __("Discount") }}: %</div>
<input type="tel" class="form-control cell pos-item-disc" value="{%= discount_percentage %}">
</div>
<div class="pos-list-row">
diff --git a/erpnext/public/js/templates/item_quick_entry.html b/erpnext/public/js/templates/item_quick_entry.html
new file mode 100644
index 0000000..6a5f36d
--- /dev/null
+++ b/erpnext/public/js/templates/item_quick_entry.html
@@ -0,0 +1,3 @@
+<div class="h6 uppercase" style="margin-top: 30px;">{{ __("Variant Attributes") }}</div>
+<div class="attributes hide-control">
+</div>
\ No newline at end of file
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 721f216..47cda19 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -37,6 +37,10 @@
}
},
+ stale_rate_allowed: () => {
+ return cint(frappe.boot.sysdefaults.allow_stale);
+ },
+
setup_serial_no: function() {
var grid_row = cur_frm.open_grid_row();
if(!grid_row || !grid_row.grid_form.fields_dict.serial_no ||
diff --git a/erpnext/public/js/utils/item_quick_entry.js b/erpnext/public/js/utils/item_quick_entry.js
new file mode 100644
index 0000000..ebb92da
--- /dev/null
+++ b/erpnext/public/js/utils/item_quick_entry.js
@@ -0,0 +1,408 @@
+frappe.provide('frappe.ui.form');
+
+frappe.ui.form.ItemQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
+ init: function(doctype, after_insert) {
+ this._super(doctype, after_insert);
+ },
+
+ render_dialog: function() {
+ this.mandatory = this.get_variant_fields().concat(this.mandatory);
+ this.mandatory = this.mandatory.concat(this.get_attributes_fields());
+ this._super();
+ this.init_post_render_dialog_operations();
+ this.preset_fields_for_template();
+ this.dialog.$wrapper.find('.edit-full').text(__('Edit in full page for more options like assets, serial nos, batches etc.'))
+ },
+
+ init_post_render_dialog_operations: function() {
+ this.dialog.fields_dict.attribute_html.$wrapper.append(frappe.render_template("item_quick_entry"));
+ this.init_for_create_variant_trigger();
+ this.init_for_item_template_trigger();
+ // explicitly hide manufacturing fields as hidden not working.
+ this.toggle_manufacturer_fields();
+ this.dialog.get_field("item_template").df.hidden = 1;
+ this.dialog.get_field("item_template").refresh();
+ },
+
+ register_primary_action: function() {
+ var me = this;
+ this.dialog.set_primary_action(__('Save'), function() {
+ if (me.dialog.working) return;
+
+ var data = me.dialog.get_values();
+ var variant_values = {};
+
+ if (me.dialog.fields_dict.create_variant.$input.prop("checked")) {
+ variant_values = me.get_variant_doc();
+ if (!Object.keys(variant_values).length) {
+ data = null;
+ }
+ variant_values.stock_uom = me.template_doc.stock_uom;
+ variant_values.item_group = me.template_doc.item_group;
+ }
+
+ if (data) {
+ me.dialog.working = true;
+ var values = me.update_doc();
+ //patch for manufacturer type variants as extend is overwriting it.
+ if (variant_values['variant_based_on'] == "Manufacturer") {
+ values['variant_based_on'] = "Manufacturer";
+ }
+ $.extend(variant_values, values);
+ me.insert(variant_values);
+ }
+ });
+ },
+
+ insert: function(variant_values) {
+ let me = this;
+ return new Promise(resolve => {
+ frappe.call({
+ method: "frappe.client.insert",
+ args: {
+ doc: variant_values
+ },
+ callback: function(r) {
+ me.dialog.hide();
+ // delete the old doc
+ frappe.model.clear_doc(me.dialog.doc.doctype, me.dialog.doc.name);
+ me.dialog.doc = r.message;
+ if (frappe._from_link) {
+ frappe.ui.form.update_calling_link(me.dialog.doc);
+ } else {
+ if (me.after_insert) {
+ me.after_insert(me.dialog.doc);
+ } else {
+ me.open_from_if_not_list();
+ }
+ }
+ },
+ error: function() {
+ me.open_doc();
+ },
+ always: function() {
+ me.dialog.working = false;
+ resolve(me.dialog.doc);
+ },
+ freeze: true
+ });
+ });
+ },
+
+ open_doc: function() {
+ this.dialog.hide();
+ this.update_doc();
+ if (this.dialog.fields_dict.create_variant.$input.prop("checked")) {
+ var template = this.dialog.fields_dict.item_template.input.value;
+ if (template)
+ frappe.set_route("Form", this.doctype, template);
+ } else {
+ frappe.set_route('Form', this.doctype, this.doc.name);
+ }
+ },
+
+ get_variant_fields: function() {
+ var variant_fields = [{
+ fieldname: "create_variant",
+ fieldtype: "Check",
+ label: __("Create Variant")
+ },
+ {
+ fieldname: 'item_template',
+ label: __('Item Template'),
+ reqd: 0,
+ fieldtype: 'Link',
+ options: "Item",
+ get_query: function() {
+ return {
+ filters: {
+ "has_variants": 1
+ }
+ };
+ }
+ }];
+
+ return variant_fields;
+ },
+
+ get_manufacturing_fields: function() {
+ this.manufacturer_fields = [{
+ fieldtype: 'Link',
+ options: 'Manufacturer',
+ label: 'Manufacturer',
+ fieldname: "manufacturer",
+ hidden: 1,
+ reqd: 0
+ }, {
+ fieldtype: 'Data',
+ label: 'Manufacturer Part Number',
+ fieldname: 'manufacturer_part_no',
+ hidden: 1,
+ reqd: 0
+ }];
+ return this.manufacturer_fields;
+ },
+
+ get_attributes_fields: function() {
+ var attribute_fields = [{
+ fieldname: 'attribute_html',
+ fieldtype: 'HTML'
+ }]
+
+ attribute_fields = attribute_fields.concat(this.get_manufacturing_fields());
+ return attribute_fields;
+ },
+
+ init_for_create_variant_trigger: function() {
+ var me = this;
+
+ this.dialog.fields_dict.create_variant.$input.on("click", function() {
+ me.preset_fields_for_template();
+ me.init_post_template_trigger_operations(false, [], true);
+ });
+ },
+
+ preset_fields_for_template: function() {
+ var for_variant = this.dialog.get_value('create_variant');
+
+ // setup template field, seen and mandatory if variant
+ let template_field = this.dialog.get_field("item_template");
+ template_field.df.reqd = for_variant;
+ template_field.set_value('');
+ template_field.df.hidden = !for_variant;
+ template_field.refresh();
+
+ // hide properties for variant
+ ['item_code', 'item_name', 'item_group', 'stock_uom'].forEach((d) => {
+ let f = this.dialog.get_field(d);
+ f.df.hidden = for_variant;
+ f.refresh();
+ });
+
+ this.dialog.get_field('attribute_html').toggle(false);
+
+ // non mandatory for variants
+ ['item_code', 'stock_uom', 'item_group'].forEach((d) => {
+ let f = this.dialog.get_field(d);
+ f.df.reqd = !for_variant;
+ f.refresh();
+ });
+
+ },
+
+ init_for_item_template_trigger: function() {
+ var me = this;
+
+ me.dialog.fields_dict["item_template"].df.onchange = () => {
+ var template = me.dialog.fields_dict.item_template.input.value;
+ me.template_doc = null;
+ if (template) {
+ frappe.call({
+ method: "frappe.client.get",
+ args: {
+ doctype: "Item",
+ name: template
+ },
+ callback: function(r) {
+ me.template_doc = r.message;
+ me.is_manufacturer = false;
+
+ if (me.template_doc.variant_based_on === "Manufacturer") {
+ me.init_post_template_trigger_operations(true, [], true);
+ } else {
+
+ me.init_post_template_trigger_operations(false, me.template_doc.attributes, false);
+ me.render_attributes(me.template_doc.attributes);
+ }
+ }
+ });
+ } else {
+ me.dialog.get_field('attribute_html').toggle(false);
+ me.init_post_template_trigger_operations(false, [], true);
+ }
+ }
+ },
+
+ init_post_template_trigger_operations: function(is_manufacturer, attributes, attributes_flag) {
+ this.attributes = attributes;
+ this.attribute_values = {};
+ this.attributes_count = attributes.length;
+
+ this.dialog.fields_dict.attribute_html.$wrapper.find(".attributes").empty();
+ this.is_manufacturer = is_manufacturer;
+ this.toggle_manufacturer_fields();
+ this.dialog.fields_dict.attribute_html.$wrapper.find(".attributes").toggleClass("hide-control", attributes_flag);
+ this.dialog.fields_dict.attribute_html.$wrapper.find(".attributes-header").toggleClass("hide-control", attributes_flag);
+ },
+
+ toggle_manufacturer_fields: function() {
+ var me = this;
+ $.each(this.manufacturer_fields, function(i, dialog_field) {
+ me.dialog.get_field(dialog_field.fieldname).df.hidden = !me.is_manufacturer;
+ me.dialog.get_field(dialog_field.fieldname).df.reqd = dialog_field.fieldname == 'manufacturer' ? me.is_manufacturer : false;
+ me.dialog.get_field(dialog_field.fieldname).refresh();
+ });
+ },
+
+ initiate_render_attributes: function() {
+ this.dialog.fields_dict.attribute_html.$wrapper.find(".attributes").empty();
+ this.render_attributes(this.attributes);
+ },
+
+ render_attributes: function(attributes) {
+ var me = this;
+
+ this.dialog.get_field('attribute_html').toggle(true);
+
+ $.each(attributes, function(index, row) {
+ var desc = "";
+ var fieldtype = "Data";
+ if (row.numeric_values) {
+ fieldtype = "Float";
+ desc = "Min Value: " + row.from_range + " , Max Value: " + row.to_range + ", in Increments of: " + row.increment;
+ }
+
+ me.init_make_control(fieldtype, row);
+ me[row.attribute].set_value(me.attribute_values[row.attribute] || "");
+ me[row.attribute].$wrapper.toggleClass("has-error", me.attribute_values[row.attribute] ? false : true);
+
+ // Set Label explicitly as make_control is not displaying label
+ $(me[row.attribute].label_area).text(__(row.attribute));
+
+ if (desc) {
+ $(repl(`<p class="help-box small text-muted hidden-xs">%(desc)s</p>`, {
+ "desc": desc
+ })).insertAfter(me[row.attribute].input_area);
+ }
+
+ if (!row.numeric_values) {
+ me.init_awesomplete_for_attribute(row);
+ } else {
+ me[row.attribute].$input.on("change", function() {
+ me.attribute_values[row.attribute] = $(this).val();
+ $(this).closest(".frappe-control").toggleClass("has-error", $(this).val() ? false : true);
+ });
+ }
+ });
+ },
+
+ init_make_control: function(fieldtype, row) {
+ this[row.attribute] = frappe.ui.form.make_control({
+ df: {
+ "fieldtype": fieldtype,
+ "label": row.attribute,
+ "fieldname": row.attribute,
+ "options": row.options || ""
+ },
+ parent: $(this.dialog.fields_dict.attribute_html.wrapper).find(".attributes"),
+ only_input: false
+ });
+ this[row.attribute].make_input();
+ },
+
+ init_awesomplete_for_attribute: function(row) {
+ var me = this;
+
+ this[row.attribute].input.awesomplete = new Awesomplete(this[row.attribute].input, {
+ minChars: 0,
+ maxItems: 99,
+ autoFirst: true,
+ list: [],
+ });
+
+ this[row.attribute].$input.on('input', function(e) {
+ frappe.call({
+ method: "frappe.client.get_list",
+ args: {
+ doctype: "Item Attribute Value",
+ filters: [
+ ["parent", "=", $(e.target).attr("data-fieldname")],
+ ["attribute_value", "like", e.target.value + "%"]
+ ],
+ fields: ["attribute_value"]
+ },
+ callback: function(r) {
+ if (r.message) {
+ e.target.awesomplete.list = r.message.map(function(d) {
+ return d.attribute_value;
+ });
+ }
+ }
+ });
+ }).on('focus', function(e) {
+ $(e.target).val('').trigger('input');
+ }).on("awesomplete-close", function (e) {
+ me.attribute_values[$(e.target).attr("data-fieldname")] = e.target.value;
+ $(e.target).closest(".frappe-control").toggleClass("has-error", e.target.value ? false : true);
+ });
+ },
+
+ get_variant_doc: function() {
+ var me = this;
+ var variant_doc = {};
+ var attribute = this.validate_mandatory_attributes();
+
+ if (Object.keys(attribute).length) {
+ frappe.call({
+ method: "erpnext.controllers.item_variant.create_variant_doc_for_quick_entry",
+ args: {
+ "template": me.dialog.fields_dict.item_template.$input.val(),
+ args: attribute
+ },
+ async: false,
+ callback: function(r) {
+ if (Object.prototype.toString.call(r.message) == "[object Object]") {
+ variant_doc = r.message;
+ } else {
+ var msgprint_dialog = frappe.msgprint(__("Item Variant {0} already exists with same attributes", [repl('<a class="strong variant-click" data-item-code="%(item)s" \
+ >%(item)s</a>', {
+ item: r.message
+ })]));
+
+ msgprint_dialog.$wrapper.find(".variant-click").on("click", function() {
+ msgprint_dialog.hide();
+ me.dialog.hide();
+ if (frappe._from_link) {
+ frappe._from_link.set_value($(this).attr("data-item-code"));
+ } else {
+ frappe.set_route('Form', "Item", $(this).attr("data-item-code"));
+ }
+ });
+ }
+ }
+ })
+ }
+ return variant_doc;
+ },
+
+ validate_mandatory_attributes: function() {
+ var me = this;
+ var attribute = {};
+ var mandatory = [];
+
+ $.each(this.attributes, function(index, attr) {
+ var value = me.attribute_values[attr.attribute] || "";
+ if (value) {
+ attribute[attr.attribute] = attr.numeric_values ? flt(value) : value;
+ } else {
+ mandatory.push(attr.attribute);
+ }
+ })
+
+ if (mandatory.length) {
+ frappe.msgprint({
+ title: __('Missing Values Required'),
+ message: __('Following fields have missing values:') + '<br><br><ul><li>' + mandatory.join('<li>') + '</ul>',
+ indicator: 'orange'
+ });
+ return {};
+ }
+
+ if (this.is_manufacturer) {
+ $.each(this.manufacturer_fields, function(index, field) {
+ attribute[field.fieldname] = me.dialog.fields_dict[field.fieldname].input.value;
+ });
+ }
+ return attribute;
+ }
+});
\ No newline at end of file
diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.js b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
index 1cc7c7f..f4a1343 100644
--- a/erpnext/restaurant/doctype/restaurant/test_restaurant.js
+++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
@@ -15,9 +15,11 @@
// values to be set
{__newname: 'Test Restaurant 1'},
{company: 'Test Company'},
- {invoice_series_prefix: 'Test-Rest-1-Inv-'}
+ {invoice_series_prefix: 'Test-Rest-1-Inv-'},
+ {default_customer: 'Test Customer 1'}
])
},
+ () => frappe.timeout(3),
() => {
assert.equal(cur_frm.doc.company, 'Test Company');
},
@@ -26,9 +28,11 @@
// values to be set
{__newname: 'Test Restaurant 2'},
{company: 'Test Company'},
- {invoice_series_prefix: 'Test-Rest-3-Inv-'}
+ {invoice_series_prefix: 'Test-Rest-3-Inv-'},
+ {default_customer: 'Test Customer 2'}
]);
},
+ () => frappe.timeout(3),
() => {
assert.equal(cur_frm.doc.company, 'Test Company');
},
diff --git a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
index 25057d8..f5ab9f0 100644
--- a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
+++ b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
@@ -16,7 +16,7 @@
{item_group: "Products"},
{is_stock_item: 1},
],
- "Test Product 3": [
+ "Food Item 3": [
{item_code: "Food Item 3"},
{item_group: "Products"},
{is_stock_item: 1},
@@ -50,6 +50,7 @@
]}
]);
},
+ () => frappe.timeout(2),
() => {
return frappe.tests.make("Restaurant Menu", [
{__newname: 'Restaurant Menu 2'},
@@ -66,6 +67,7 @@
]}
]);
},
+ () => frappe.timeout(2),
() => frappe.set_route('Form', 'Restaurant', 'Test Restaurant 1'),
() => cur_frm.set_value('active_menu', 'Restaurant Menu 1'),
() => cur_frm.save(),
diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.py b/erpnext/schools/doctype/assessment_plan/assessment_plan.py
index a09f3ee..55c4148 100644
--- a/erpnext/schools/doctype/assessment_plan/assessment_plan.py
+++ b/erpnext/schools/doctype/assessment_plan/assessment_plan.py
@@ -43,7 +43,7 @@
assessment_criteria_list = frappe.db.sql_list(''' select apc.assessment_criteria
from `tabAssessment Plan` ap , `tabAssessment Plan Criteria` apc
where ap.name = apc.parent and ap.course=%s and ap.student_group=%s and ap.assessment_group=%s
- and ap.name != %s''', (self.course, self.student_group, self.assessment_group, self.name))
+ and ap.name != %s and ap.docstatus=1''', (self.course, self.student_group, self.assessment_group, self.name))
for d in self.assessment_criteria:
if d.assessment_criteria in assessment_criteria_list:
frappe.throw(_("You have already assessed for the assessment criteria {}.")
diff --git a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js b/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js
index b75a41a..faa39bf 100644
--- a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js
+++ b/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js
@@ -2,7 +2,7 @@
QUnit.module('schools');
QUnit.test('Test: Assessment Plan', function(assert){
- assert.expect(7);
+ assert.expect(6);
let done = assert.async();
let room_name, instructor_name, assessment_name;
@@ -49,10 +49,6 @@
assert.equal(cur_frm.doc.assessment_plan, assessment_name, 'Assessment correctly set');
assert.equal(cur_frm.doc.student_group, 'test-course-wise-group-2', 'Course for Assessment correctly set');
},
- () => cur_frm.print_doc(),
- () => frappe.timeout(1),
- () => {assert.ok($('.btn-print-print').is(':visible'), "Print Format Available");},
-
() => done()
]);
-});
\ No newline at end of file
+});
diff --git a/erpnext/schools/doctype/assessment_result/assessment_result.js b/erpnext/schools/doctype/assessment_result/assessment_result.js
index e75f314..6d20896 100644
--- a/erpnext/schools/doctype/assessment_result/assessment_result.js
+++ b/erpnext/schools/doctype/assessment_result/assessment_result.js
@@ -7,30 +7,32 @@
frappe.ui.form.on("Assessment Result", {
assessment_plan: function(frm) {
- frappe.call({
- method: "erpnext.schools.api.get_assessment_details",
- args: {
- assessment_plan: frm.doc.assessment_plan
- },
- callback: function(r) {
- if (r.message) {
- frm.doc.details = [];
- $.each(r.message, function(i, d) {
- var row = frappe.model.add_child(frm.doc, "Assessment Result Detail", "details");
- row.assessment_criteria = d.assessment_criteria;
- row.maximum_score = d.maximum_score;
- });
+ if (frm.doc.assessment_plan) {
+ frappe.call({
+ method: "erpnext.schools.api.get_assessment_details",
+ args: {
+ assessment_plan: frm.doc.assessment_plan
+ },
+ callback: function(r) {
+ if (r.message) {
+ frm.doc.details = [];
+ $.each(r.message, function(i, d) {
+ var row = frappe.model.add_child(frm.doc, "Assessment Result Detail", "details");
+ row.assessment_criteria = d.assessment_criteria;
+ row.maximum_score = d.maximum_score;
+ });
+ }
+ refresh_field("details");
}
- refresh_field("details");
- }
- });
+ });
+ }
}
});
frappe.ui.form.on("Assessment Result Detail", {
score: function(frm, cdt, cdn) {
var d = locals[cdt][cdn];
- if (d.score >= d.maximum_score) {
+ if (d.score > d.maximum_score) {
frappe.throw(__("Score cannot be greater than Maximum Score"));
}
else {
diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js
index dfa7b14..142bbf4 100644
--- a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js
+++ b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js
@@ -12,10 +12,11 @@
frm.set_value("student_group", frappe.route_options.student_group);
frm.set_value("assessment_plan", frappe.route_options.assessment_plan);
frappe.route_options = null;
+ } else {
+ frm.trigger("assessment_plan");
}
frm.disable_save();
frm.page.clear_indicator();
- frm.trigger("assessment_plan");
},
assessment_plan: function(frm) {
diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
index a62a4d5..116fbad 100644
--- a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
+++ b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
@@ -175,7 +175,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-06-30 08:21:47.184562",
+ "modified": "2017-11-08 11:51:43.247815",
"modified_by": "Administrator",
"module": "Schools",
"name": "Assessment Result Tool",
@@ -188,17 +188,17 @@
"cancel": 0,
"create": 1,
"delete": 0,
- "email": 1,
+ "email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
- "print": 1,
+ "print": 0,
"read": 1,
"report": 0,
"role": "Academics User",
"set_user_permissions": 0,
- "share": 1,
+ "share": 0,
"submit": 0,
"write": 1
}
diff --git a/erpnext/schools/doctype/fee_category/fee_category.json b/erpnext/schools/doctype/fee_category/fee_category.json
index c51027a..2b55f8d 100644
--- a/erpnext/schools/doctype/fee_category/fee_category.json
+++ b/erpnext/schools/doctype/fee_category/fee_category.json
@@ -90,7 +90,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-06-30 08:21:47.851347",
+ "modified": "2017-11-02 17:57:18.069158",
"modified_by": "Administrator",
"module": "Schools",
"name": "Fee Category",
@@ -116,6 +116,46 @@
"share": 1,
"submit": 0,
"write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
}
],
"quick_entry": 1,
diff --git a/erpnext/schools/doctype/fee_schedule/fee_schedule.json b/erpnext/schools/doctype/fee_schedule/fee_schedule.json
index d2b5c52..ab60911 100644
--- a/erpnext/schools/doctype/fee_schedule/fee_schedule.json
+++ b/erpnext/schools/doctype/fee_schedule/fee_schedule.json
@@ -25,7 +25,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Fee Structure",
@@ -1029,7 +1029,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-19 16:24:17.266071",
+ "modified": "2017-11-02 17:55:22.851581",
"modified_by": "Administrator",
"module": "Schools",
"name": "Fee Schedule",
@@ -1039,7 +1039,7 @@
{
"amend": 1,
"apply_user_permissions": 0,
- "cancel": 1,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -1053,6 +1053,46 @@
"role": "Academics User",
"set_user_permissions": 0,
"share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 1,
"submit": 1,
"write": 1
}
@@ -1060,6 +1100,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
+ "restrict_to_domain": "Education",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
diff --git a/erpnext/schools/doctype/fee_schedule/fee_schedule.py b/erpnext/schools/doctype/fee_schedule/fee_schedule.py
index fc2907a..3e1dd0c 100644
--- a/erpnext/schools/doctype/fee_schedule/fee_schedule.py
+++ b/erpnext/schools/doctype/fee_schedule/fee_schedule.py
@@ -9,6 +9,7 @@
from frappe.utils import money_in_words
from frappe.utils import cint, flt, cstr
from frappe.utils.background_jobs import enqueue
+from frappe import _
class FeeSchedule(Document):
@@ -57,6 +58,10 @@
error = False
total_records = sum([int(d.total_students) for d in doc.student_groups])
created_records = 0
+
+ if not total_records:
+ frappe.throw(_("Please setup Students under Student Groups"))
+
for d in doc.student_groups:
students = frappe.db.sql(""" select sg.program, sg.batch, sgs.student, sgs.student_name
from `tabStudent Group` sg, `tabStudent Group Student` sgs
diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.json b/erpnext/schools/doctype/fee_structure/fee_structure.json
index d93a667..2ae0a48 100644
--- a/erpnext/schools/doctype/fee_structure/fee_structure.json
+++ b/erpnext/schools/doctype/fee_structure/fee_structure.json
@@ -165,7 +165,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0,
@@ -197,7 +197,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -577,7 +577,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-09-11 15:18:27.975666",
+ "modified": "2017-11-02 17:43:16.796845",
"modified_by": "Administrator",
"module": "Schools",
"name": "Fee Structure",
@@ -587,7 +587,7 @@
{
"amend": 1,
"apply_user_permissions": 0,
- "cancel": 1,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -601,6 +601,46 @@
"role": "Academics User",
"set_user_permissions": 0,
"share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 1,
"submit": 1,
"write": 1
}
@@ -609,6 +649,7 @@
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Education",
+ "search_fields": "program, student_category, academic_year",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
diff --git a/erpnext/schools/doctype/fees/fees.json b/erpnext/schools/doctype/fees/fees.json
index ab9a792..f34caf7 100644
--- a/erpnext/schools/doctype/fees/fees.json
+++ b/erpnext/schools/doctype/fees/fees.json
@@ -1,7 +1,7 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
- "allow_import": 0,
+ "allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
"beta": 1,
@@ -87,7 +87,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Student Name",
@@ -118,7 +118,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Fee Schedule",
@@ -158,7 +158,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -249,7 +249,7 @@
"options": "Company",
"permlevel": 0,
"precision": "",
- "print_hide": 1,
+ "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1,
@@ -310,7 +310,7 @@
"no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 1,
+ "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -494,7 +494,7 @@
"options": "Student Batch Name",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -708,7 +708,7 @@
"options": "Currency",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
@@ -739,7 +739,7 @@
"options": "Fee Structure",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -1011,7 +1011,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -1132,7 +1132,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -1163,7 +1163,7 @@
"options": "Account",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -1194,7 +1194,7 @@
"options": "Account",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -1223,7 +1223,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -1254,6 +1254,35 @@
"options": "Cost Center",
"permlevel": 0,
"precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "data_42",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1276,7 +1305,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-09-20 23:17:09.819606",
+ "modified": "2017-11-02 17:31:47.155873",
"modified_by": "Administrator",
"module": "Schools",
"name": "Fees",
@@ -1286,6 +1315,46 @@
{
"amend": 0,
"apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Academics User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -1297,7 +1366,7 @@
"print": 1,
"read": 1,
"report": 1,
- "role": "Academics User",
+ "role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
@@ -1308,7 +1377,8 @@
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
+ "search_fields": "student, student_name",
+ "show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "student_name",
diff --git a/erpnext/schools/doctype/fees/fees.py b/erpnext/schools/doctype/fees/fees.py
index 42b329e..bfe6af4 100644
--- a/erpnext/schools/doctype/fees/fees.py
+++ b/erpnext/schools/doctype/fees/fees.py
@@ -112,7 +112,7 @@
user = frappe.session.user
student = frappe.db.sql("select name from `tabStudent` where student_email_id= %s", user)
if student:
- return frappe. db.sql('''select name, program, due_date, paid_amount, outstanding_amount, total_amount from `tabFees`
+ return frappe. db.sql('''select name, program, due_date, paid_amount, outstanding_amount, grand_total from `tabFees`
where student= %s and docstatus=1
order by due_date asc limit {0} , {1}'''
.format(limit_start, limit_page_length), student, as_dict = True)
diff --git a/erpnext/schools/doctype/program/program.json b/erpnext/schools/doctype/program/program.json
index 95ef166..46581a1 100644
--- a/erpnext/schools/doctype/program/program.json
+++ b/erpnext/schools/doctype/program/program.json
@@ -223,67 +223,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "fee_schedule",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Fee Schedule",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "fees",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Fees",
- "length": 0,
- "no_copy": 0,
- "options": "Program Fee",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
}
],
"has_web_view": 0,
@@ -297,7 +236,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-06-30 08:21:49.176708",
+ "modified": "2017-11-02 18:08:20.823972",
"modified_by": "Administrator",
"module": "Schools",
"name": "Program",
diff --git a/erpnext/schools/doctype/student_admission/test_student_admission.js b/erpnext/schools/doctype/student_admission/test_student_admission.js
index 3e997ca..767f237 100644
--- a/erpnext/schools/doctype/student_admission/test_student_admission.js
+++ b/erpnext/schools/doctype/student_admission/test_student_admission.js
@@ -2,7 +2,7 @@
QUnit.module('schools');
QUnit.test('Test: Student Admission', function(assert) {
- assert.expect(9);
+ assert.expect(10);
let done = assert.async();
frappe.run_serially([
() => {
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.py b/erpnext/schools/doctype/student_applicant/student_applicant.py
index 7fa44a6..6d0957c 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant.py
+++ b/erpnext/schools/doctype/student_applicant/student_applicant.py
@@ -12,10 +12,14 @@
def autoname(self):
from frappe.model.naming import set_name_by_naming_series
if self.student_admission:
+ naming_series = None
if self.program:
+ # set the naming series from the student admission if provided.
student_admission = get_student_admission_data(self.student_admission, self.program)
if student_admission:
naming_series = student_admission.get("applicant_naming_series")
+ else:
+ naming_series = None
else:
frappe.throw(_("Select the program first"))
@@ -40,11 +44,17 @@
def validation_from_student_admission(self):
student_admission = get_student_admission_data(self.student_admission, self.program)
- if student_admission:
- if not (getdate(student_admission.minimum_age) >= getdate(self.date_of_birth) >=
- getdate(student_admission.maximum_age)):
+
+ # different validation for minimum and maximum age so that either min/max can also work independently.
+ if student_admission and student_admission.minimum_age and \
+ getdate(student_admission.minimum_age) < getdate(self.date_of_birth):
frappe.throw(_("Not eligible for the admission in this program as per DOB"))
+ if student_admission and student_admission.maximum_age and \
+ getdate(student_admission.maximum_age) > getdate(self.date_of_birth):
+ frappe.throw(_("Not eligible for the admission in this program as per DOB"))
+
+
def on_payment_authorized(self, *args, **kwargs):
self.db_set('paid', 1)
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
index 59c1a84..5c28655 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
+++ b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
@@ -273,7 +273,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-06-30 08:21:51.390809",
+ "modified": "2017-11-08 11:53:27.994112",
"modified_by": "Administrator",
"module": "Schools",
"name": "Student Attendance Tool",
@@ -306,17 +306,17 @@
"cancel": 0,
"create": 1,
"delete": 0,
- "email": 1,
+ "email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
- "print": 1,
+ "print": 0,
"read": 1,
"report": 0,
"role": "Academics User",
"set_user_permissions": 0,
- "share": 1,
+ "share": 0,
"submit": 0,
"write": 1
}
diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/schools/doctype/student_group/student_group.py
index 0a7fdf1..950632b 100644
--- a/erpnext/schools/doctype/student_group/student_group.py
+++ b/erpnext/schools/doctype/student_group/student_group.py
@@ -7,6 +7,7 @@
from frappe.model.document import Document
from frappe import _
from erpnext.schools.utils import validate_duplicate_student
+from frappe.utils import cint
class StudentGroup(Document):
def validate(self):
@@ -34,9 +35,13 @@
for d in self.students:
if not frappe.db.get_value("Student", d.student, "enabled") and d.active:
frappe.throw(_("{0} - {1} is inactive student".format(d.group_roll_number, d.student_name)))
- if self.group_based_on == "Batch" and d.student not in students and frappe.defaults.get_defaults().validate_batch:
+
+ if (self.group_based_on == "Batch") and cint(frappe.defaults.get_defaults().validate_batch)\
+ and d.student not in students:
frappe.throw(_("{0} - {1} is not enrolled in the Batch {2}".format(d.group_roll_number, d.student_name, self.batch)))
- if self.group_based_on == "Course" and d.student not in students and frappe.defaults.get_defaults().validate_course:
+
+ if (self.group_based_on == "Course") and cint(frappe.defaults.get_defaults().validate_course)\
+ and (d.student not in students):
frappe.throw(_("{0} - {1} is not enrolled in the Course {2}".format(d.group_roll_number, d.student_name, self.course)))
def validate_and_set_child_table_fields(self):
@@ -108,14 +113,14 @@
students = ([d.student for d in enrolled_students if d.student not in student_group_student]
if enrolled_students else [""]) or [""]
return frappe.db.sql("""select name, title from tabStudent
- where name in ({0}) and `{1}` LIKE %s
+ where name in ({0}) and (`{1}` LIKE %s or title LIKE %s)
order by idx desc, name
limit %s, %s""".format(", ".join(['%s']*len(students)), searchfield),
- tuple(students + ["%%%s%%" % txt, start, page_len]))
+ tuple(students + ["%%%s%%" % txt, "%%%s%%" % txt, start, page_len]))
else:
return frappe.db.sql("""select name, title from tabStudent
- where `{0}` LIKE %s
+ where `{0}` LIKE %s or title LIKE %s
order by idx desc, name
limit %s, %s""".format(searchfield),
- tuple(["%%%s%%" % txt, start, page_len]))
+ tuple(["%%%s%%" % txt, "%%%s%%" % txt, start, page_len]))
diff --git a/erpnext/schools/doctype/student_group/test_student_group.js b/erpnext/schools/doctype/student_group/test_student_group.js
index 634ad18..bee5067 100644
--- a/erpnext/schools/doctype/student_group/test_student_group.js
+++ b/erpnext/schools/doctype/student_group/test_student_group.js
@@ -4,15 +4,10 @@
QUnit.test('Test: Student Group', function(assert){
assert.expect(2);
let done = assert.async();
- let instructor_code;
let group_based_on = ["test-batch-wise-group", "test-course-wise-group"];
let tasks = [];
frappe.run_serially([
- // Saving Instructor code beforehand
- () => frappe.db.get_value('Instructor', {'instructor_name': 'Instructor 1'}, 'name'),
- (instructor) => {instructor_code = instructor.message.name;},
-
// Creating a Batch and Course based group
() => {
return frappe.tests.make('Student Group', [
@@ -22,12 +17,7 @@
{group_based_on: 'Batch'},
{student_group_name: group_based_on[0]},
{max_strength: 10},
- {batch: 'A'},
- {instructors: [
- [
- {instructor: instructor_code}
- ]
- ]}
+ {batch: 'A'}
]);
},
() => {
@@ -40,11 +30,6 @@
{max_strength: 10},
{batch: 'A'},
{course: 'Test_Sub'},
- {instructors: [
- [
- {instructor: instructor_code}
- ]
- ]}
]);
},
diff --git a/erpnext/schools/report/assessment_plan_status/__init__.py b/erpnext/schools/report/assessment_plan_status/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/schools/report/assessment_plan_status/__init__.py
diff --git a/erpnext/schools/report/assessment_plan_status/assessment_plan_status.js b/erpnext/schools/report/assessment_plan_status/assessment_plan_status.js
new file mode 100644
index 0000000..2d1eb09
--- /dev/null
+++ b/erpnext/schools/report/assessment_plan_status/assessment_plan_status.js
@@ -0,0 +1,28 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["Assessment Plan Status"] = {
+ "filters": [
+ {
+ "fieldname":"assessment_group",
+ "label": __("Assessment Group"),
+ "fieldtype": "Link",
+ "options": "Assessment Group",
+ "get_query": function() {
+ return{
+ filters: {
+ 'is_group': 0
+ }
+ };
+ }
+ },
+ {
+ "fieldname":"schedule_date",
+ "label": __("Scheduled Upto"),
+ "fieldtype": "Date",
+ "options": ""
+ }
+
+ ]
+}
diff --git a/erpnext/schools/report/assessment_plan_status/assessment_plan_status.json b/erpnext/schools/report/assessment_plan_status/assessment_plan_status.json
new file mode 100644
index 0000000..141747f5
--- /dev/null
+++ b/erpnext/schools/report/assessment_plan_status/assessment_plan_status.json
@@ -0,0 +1,23 @@
+{
+ "add_total_row": 0,
+ "apply_user_permissions": 1,
+ "creation": "2017-11-09 15:07:30.404428",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2017-11-13 11:25:50.651364",
+ "modified_by": "Administrator",
+ "module": "Schools",
+ "name": "Assessment Plan Status",
+ "owner": "Administrator",
+ "ref_doctype": "Assessment Plan",
+ "report_name": "Assessment Plan Status",
+ "report_type": "Script Report",
+ "roles": [
+ {
+ "role": "Academics User"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/schools/report/assessment_plan_status/assessment_plan_status.py b/erpnext/schools/report/assessment_plan_status/assessment_plan_status.py
new file mode 100644
index 0000000..21184a6
--- /dev/null
+++ b/erpnext/schools/report/assessment_plan_status/assessment_plan_status.py
@@ -0,0 +1,179 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from itertools import groupby
+from frappe.utils import cint
+
+DOCSTATUS = {
+ 0: "saved",
+ 1: "submitted",
+}
+
+def execute(filters=None):
+ columns, data = [], []
+
+ args = frappe._dict()
+ args["assessment_group"] = filters.get("assessment_group")
+ args["schedule_date"] = filters.get("schedule_date")
+
+ columns = get_column()
+
+ data, chart = get_assessment_data(args)
+
+ return columns, data, None, chart
+
+
+def get_assessment_data(args=None):
+
+ # [total, saved, submitted, remaining]
+ chart_data = [0, 0, 0, 0]
+
+ condition = ''
+ if args["assessment_group"]:
+ condition += "and assessment_group = %(assessment_group)s"
+ if args["schedule_date"]:
+ condition += "and schedule_date <= %(schedule_date)s"
+
+ assessment_plan = frappe.db.sql('''
+ SELECT
+ ap.name as assessment_plan,
+ ap.assessment_name,
+ ap.student_group,
+ ap.schedule_date,
+ (select count(*) from `tabStudent Group Student` sgs where sgs.parent=ap.student_group)
+ as student_group_strength
+ FROM
+ `tabAssessment Plan` ap
+ WHERE
+ ap.docstatus = 1 {condition}
+ ORDER BY
+ ap.modified desc
+ '''.format(condition=condition), (args), as_dict=1)
+
+ assessment_plan_list = [d.assessment_plan for d in assessment_plan] if assessment_plan else ['']
+ assessment_result = get_assessment_result(assessment_plan_list)
+
+ for d in assessment_plan:
+
+ assessment_plan_details = assessment_result.get(d.assessment_plan)
+ assessment_plan_details = frappe._dict() if not assessment_plan_details else \
+ frappe._dict(assessment_plan_details)
+ if "saved" not in assessment_plan_details:
+ assessment_plan_details.update({"saved": 0})
+ if "submitted" not in assessment_plan_details:
+ assessment_plan_details.update({"submitted": 0})
+
+ # remaining students whose marks not entered
+ remaining_students = cint(d.student_group_strength) - cint(assessment_plan_details.saved) -\
+ cint(assessment_plan_details.submitted)
+ assessment_plan_details.update({"remaining": remaining_students})
+ d.update(assessment_plan_details)
+
+ chart_data[0] += cint(d.student_group_strength)
+ chart_data[1] += assessment_plan_details.saved
+ chart_data[2] += assessment_plan_details.submitted
+ chart_data[3] += assessment_plan_details.remaining
+
+ chart = get_chart(chart_data[1:])
+
+ return assessment_plan, chart
+
+
+def get_assessment_result(assessment_plan_list):
+ assessment_result_dict = frappe._dict()
+
+ assessment_result = frappe.db.sql('''
+ SELECT
+ assessment_plan, docstatus, count(*) as count
+ FROM
+ `tabAssessment Result`
+ WHERE
+ assessment_plan in (%s)
+ GROUP BY
+ assessment_plan, docstatus
+ ORDER BY
+ assessment_plan
+ ''' %', '.join(['%s']*len(assessment_plan_list)), tuple(assessment_plan_list), as_dict=1)
+
+ for key, group in groupby(assessment_result, lambda ap: ap["assessment_plan"]):
+ tmp = {}
+ for d in group:
+ if d.docstatus in [0,1]:
+ tmp.update({DOCSTATUS[d.docstatus]:d.count})
+ assessment_result_dict[key] = tmp
+
+ return assessment_result_dict
+
+
+def get_chart(chart_data):
+ return {
+ "data": {
+ "labels": ["Saved", "Submitted", "Remaining"],
+ "datasets": [{
+ "values": chart_data
+ }]
+ },
+ "type": 'percentage',
+ }
+
+
+def get_column():
+ return [{
+ "fieldname": "assessment_plan",
+ "label": _("Assessment Plan"),
+ "fieldtype": "Link",
+ "options": "Assessment Plan",
+ "width": 120
+ },
+ {
+ "fieldname": "assessment_name",
+ "label": _("Assessment Plan Name"),
+ "fieldtype": "Data",
+ "options": "",
+ "width": 200
+ },
+ {
+ "fieldname": "schedule_date",
+ "label": _("Schedule Date"),
+ "fieldtype": "Date",
+ "options": "",
+ "width": 100
+ },
+ {
+ "fieldname": "student_group",
+ "label": _("Student Group"),
+ "fieldtype": "Link",
+ "options": "Student Group",
+ "width": 200
+ },
+ {
+ "fieldname": "student_group_strength",
+ "label": _("Total Student"),
+ "fieldtype": "Data",
+ "options": "",
+ "width": 100
+ },
+ {
+ "fieldname": "submitted",
+ "label": _("Submitted"),
+ "fieldtype": "Data",
+ "options": "",
+ "width": 100
+ },
+ {
+ "fieldname": "saved",
+ "label": _("Saved"),
+ "fieldtype": "Data",
+ "options": "",
+ "width": 100
+ },
+ {
+ "fieldname": "remaining",
+ "label": _("Remaining"),
+ "fieldtype": "Data",
+ "options": "",
+ "width": 100
+ }]
diff --git a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
index 9bdf621..492d738 100644
--- a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
+++ b/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
@@ -173,14 +173,16 @@
def get_chart_data(grades, assessment_criteria_list, kounter):
grades = sorted(grades)
datasets = []
+
for grade in grades:
- tmp = []
- for ac in assessment_criteria_list:
- if grade in kounter[ac]:
- tmp.append(kounter[ac][grade])
+ tmp = frappe._dict({"values":[], "title": grade})
+ for criteria in assessment_criteria_list:
+ if grade in kounter[criteria]:
+ tmp["values"].append(kounter[criteria][grade])
else:
- tmp.append(0)
+ tmp["values"].append(0)
datasets.append(tmp)
+
return {
"data": {
"labels": assessment_criteria_list,
diff --git a/erpnext/schools/report/student_fee_collection/student_fee_collection.json b/erpnext/schools/report/student_fee_collection/student_fee_collection.json
index 264638f..5c63765 100644
--- a/erpnext/schools/report/student_fee_collection/student_fee_collection.json
+++ b/erpnext/schools/report/student_fee_collection/student_fee_collection.json
@@ -5,14 +5,14 @@
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
- "idx": 2,
+ "idx": 3,
"is_standard": "Yes",
- "modified": "2017-02-24 20:05:08.514320",
+ "modified": "2017-10-25 11:59:26.003899",
"modified_by": "Administrator",
"module": "Schools",
"name": "Student Fee Collection",
"owner": "Administrator",
- "query": "SELECT\n student as \"Student:Link/Student:200\",\n student_name as \"Student Name::200\",\n sum(paid_amount) as \"Paid Amount:Currency:150\",\n sum(outstanding_amount) as \"Outstanding Amount:Currency:150\",\n sum(total_amount) as \"Total Amount:Currency:150\"\nFROM\n `tabFees` \nGROUP BY\n student",
+ "query": "SELECT\n student as \"Student:Link/Student:200\",\n student_name as \"Student Name::200\",\n sum(paid_amount) as \"Paid Amount:Currency:150\",\n sum(outstanding_amount) as \"Outstanding Amount:Currency:150\",\n sum(grand_total) as \"Grand Total:Currency:150\"\nFROM\n `tabFees` \nGROUP BY\n student",
"ref_doctype": "Fees",
"report_name": "Student Fee Collection",
"report_type": "Query Report",
diff --git a/erpnext/selling/doctype/product_bundle/product_bundle.json b/erpnext/selling/doctype/product_bundle/product_bundle.json
index 5a1aeb4..b63fb4b 100644
--- a/erpnext/selling/doctype/product_bundle/product_bundle.json
+++ b/erpnext/selling/doctype/product_bundle/product_bundle.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
"beta": 0,
@@ -12,6 +13,7 @@
"editable_grid": 0,
"fields": [
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -40,6 +42,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -72,6 +75,37 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "description",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -101,6 +135,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -132,6 +167,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -160,6 +196,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -190,19 +227,19 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-sitemap",
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-02-22 05:06:30.143089",
- "modified_by": "Administrator",
+ "modified": "2017-10-18 14:23:06.538568",
+ "modified_by": "tundebabzy@gmail.com",
"module": "Selling",
"name": "Product Bundle",
"owner": "Administrator",
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index f0cce5f..6d9c170 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -168,6 +168,48 @@
return doclist
+@frappe.whitelist()
+def make_sales_invoice(source_name, target_doc=None):
+ return _make_sales_invoice(source_name, target_doc)
+
+def _make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
+ customer = _make_customer(source_name, ignore_permissions)
+
+ def set_missing_values(source, target):
+ if customer:
+ target.customer = customer.name
+ target.customer_name = customer.customer_name
+ target.ignore_pricing_rule = 1
+ target.flags.ignore_permissions = ignore_permissions
+ target.run_method("set_missing_values")
+ target.run_method("calculate_taxes_and_totals")
+
+ def update_item(obj, target, source_parent):
+ target.stock_qty = flt(obj.qty) * flt(obj.conversion_factor)
+
+ doclist = get_mapped_doc("Quotation", source_name, {
+ "Quotation": {
+ "doctype": "Sales Invoice",
+ "validation": {
+ "docstatus": ["=", 1]
+ }
+ },
+ "Quotation Item": {
+ "doctype": "Sales Invoice Item",
+ "postprocess": update_item
+ },
+ "Sales Taxes and Charges": {
+ "doctype": "Sales Taxes and Charges",
+ "add_if_empty": True
+ },
+ "Sales Team": {
+ "doctype": "Sales Team",
+ "add_if_empty": True
+ }
+ }, target_doc, set_missing_values, ignore_permissions=ignore_permissions)
+
+ return doclist
+
def _make_customer(source_name, ignore_permissions=False):
quotation = frappe.db.get_value("Quotation", source_name, ["lead", "order_type", "customer"])
if quotation and quotation[0] and not quotation[2]:
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 70d79eb..a5e0059 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -40,6 +40,10 @@
if(!d.delivery_date) d.delivery_date = frm.doc.delivery_date;
});
refresh_field("items");
+ },
+
+ onload_post_render: function(frm) {
+ frm.get_field("items").grid.set_multiple_add("item_code", "qty");
}
});
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index b57895a..3ea34b1 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -3274,417 +3274,11 @@
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "subscription",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Subscription",
- "length": 0,
- "no_copy": 0,
- "options": "Subscription",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "is_recurring",
- "columns": 0,
- "depends_on": "eval:doc.docstatus<2 && !doc.__islocal",
- "fieldname": "recurring_order",
- "fieldtype": "Section Break",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Order",
- "length": 0,
- "no_copy": 0,
- "options": "fa fa-time",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "settings",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Settings",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:doc.docstatus<2",
- "description": "",
- "fieldname": "is_recurring",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Recurring",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_recurring",
- "description": "",
- "fieldname": "recurring_id",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Reference Document",
- "length": 0,
- "no_copy": 1,
- "options": "Sales Order",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "recurring_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Frequency",
- "length": 0,
- "no_copy": 1,
- "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "repeat_on_day_of_month",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Repeat on Day of Month",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Upto",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "fieldname": "submit_on_creation",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Submit on creation",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "notify_by_email",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Notify by email",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name",
- "description": "",
- "fieldname": "notification_email_address",
- "fieldtype": "Code",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Notification Email Address",
- "length": 0,
- "no_copy": 1,
- "options": "Email",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name",
- "fieldname": "recurring_print_format",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Recurring Print Format",
- "length": 0,
- "no_copy": 0,
- "options": "Print Format",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break83",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "This Document",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_recurring",
+ "depends_on": "",
"description": "",
"fieldname": "from_date",
"fieldtype": "Date",
@@ -3715,7 +3309,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "is_recurring",
+ "depends_on": "",
"description": "",
"fieldname": "to_date",
"fieldtype": "Date",
@@ -3746,10 +3340,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "is_recurring",
- "description": "",
- "fieldname": "next_date",
- "fieldtype": "Date",
+ "fieldname": "column_break_108",
+ "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -3757,11 +3349,42 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Next Date",
"length": 0,
- "no_copy": 1,
+ "no_copy": 0,
"permlevel": 0,
- "print_hide": 1,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "subscription",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Subscription",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Subscription",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -3783,7 +3406,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-19 11:21:36.332326",
+ "modified": "2017-11-03 05:31:56.636424",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
@@ -3920,5 +3543,5 @@
"timeline_field": "customer",
"title_field": "title",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index a3e13b6..a70fad1 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -349,15 +349,15 @@
return items
def on_recurring(self, reference_doc, subscription_doc):
- self.set("delivery_date", get_next_schedule_date(reference_doc.delivery_date, subscription_doc.frequency,
- cint(subscription_doc.repeat_on_day)))
+ self.set("delivery_date", get_next_schedule_date(reference_doc.delivery_date,
+ subscription_doc.frequency, cint(subscription_doc.repeat_on_day)))
for d in self.get("items"):
reference_delivery_date = frappe.db.get_value("Sales Order Item",
{"parent": reference_doc.name, "item_code": d.item_code, "idx": d.idx}, "delivery_date")
- d.set("delivery_date",
- get_next_schedule_date(reference_delivery_date, subscription_doc.frequency, cint(subscription_doc.repeat_on_day)))
+ d.set("delivery_date", get_next_schedule_date(reference_delivery_date,
+ subscription_doc.frequency, cint(subscription_doc.repeat_on_day)))
def get_list_context(context=None):
from erpnext.controllers.website_list_for_contact import get_list_context
@@ -479,9 +479,11 @@
target.qty = flt(source.qty) - flt(source.delivered_qty)
item = frappe.db.get_value("Item", target.item_code, ["item_group", "selling_cost_center"], as_dict=1)
- target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
- or item.selling_cost_center \
- or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
+
+ if item:
+ target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
+ or item.selling_cost_center \
+ or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
target_doc = get_mapped_doc("Sales Order", source_name, {
"Sales Order": {
diff --git a/erpnext/selling/doctype/sms_center/sms_center.json b/erpnext/selling/doctype/sms_center/sms_center.json
index 3ea5b14..833539a 100644
--- a/erpnext/selling/doctype/sms_center/sms_center.json
+++ b/erpnext/selling/doctype/sms_center/sms_center.json
@@ -1,49 +1,39 @@
{
"allow_copy": 1,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
+ "beta": 0,
"creation": "2013-01-10 16:34:22",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "editable_grid": 0,
"fields": [
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
+ "columns": 0,
"fieldname": "send_to",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Send To",
+ "length": 0,
"no_copy": 0,
"options": "\nAll Contact\nAll Customer Contact\nAll Supplier Contact\nAll Sales Partner Contact\nAll Lead (Open)\nAll Employee (Active)\nAll Sales Person",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -51,22 +41,30 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"depends_on": "eval:doc.send_to=='All Customer Contact'",
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Customer",
+ "length": 0,
"no_copy": 0,
"options": "Customer",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -74,22 +72,30 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"depends_on": "eval:doc.send_to=='All Supplier Contact'",
"fieldname": "supplier",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Supplier",
+ "length": 0,
"no_copy": 0,
"options": "Supplier",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -97,23 +103,31 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"depends_on": "eval:doc.send_to=='All Sales Partner Contact'",
"fieldname": "sales_partner",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Sales Partner",
+ "length": 0,
"no_copy": 0,
"options": "Sales Partner",
"permlevel": 0,
"precision": "",
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -121,22 +135,30 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"depends_on": "eval:doc.send_to=='All Employee (Active)'",
"fieldname": "department",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Department",
+ "length": 0,
"no_copy": 0,
"options": "Department",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -144,22 +166,30 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"depends_on": "eval:doc.send_to=='All Employee (Active)'",
"fieldname": "branch",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Branch",
+ "length": 0,
"no_copy": 0,
"options": "Branch",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -167,21 +197,29 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "create_receiver_list",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Create Receiver List",
+ "length": 0,
"no_copy": 0,
"options": "create_receiver_list",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -189,20 +227,28 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "receiver_list",
"fieldtype": "Code",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Receiver List",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -210,19 +256,27 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "column_break9",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -231,21 +285,29 @@
"width": "50%"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"description": "Messages greater than 160 characters will be split into multiple messages",
"fieldname": "message",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Message",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -253,20 +315,28 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "total_characters",
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Total Characters",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -274,20 +344,28 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "total_messages",
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Total Message(s)",
+ "length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 1,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -295,21 +373,29 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "send_sms",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
+ "in_standard_filter": 0,
"label": "Send SMS",
+ "length": 0,
"no_copy": 0,
"options": "send_sms",
"permlevel": 0,
"print_hide": 0,
+ "print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -317,16 +403,18 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-mobile-phone",
"idx": 1,
+ "image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-05-25 17:46:37.555503",
+ "max_attachments": 0,
+ "modified": "2017-11-10 18:46:21.021767",
"modified_by": "Administrator",
"module": "Selling",
"name": "SMS Center",
@@ -353,8 +441,12 @@
"write": 1
}
],
+ "quick_entry": 0,
"read_only": 1,
"read_only_onload": 0,
+ "show_name_in_global_search": 0,
"sort_field": "modified",
- "sort_order": "DESC"
+ "sort_order": "DESC",
+ "track_changes": 0,
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js
index 5feae9c..8ecdf85 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.js
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.js
@@ -43,6 +43,7 @@
make() {
return frappe.run_serially([
+ () => frappe.dom.freeze(),
() => {
this.prepare_dom();
this.prepare_menu();
@@ -55,6 +56,7 @@
frappe.timeout(1);
this.make_items();
this.bind_events();
+ frappe.dom.unfreeze();
},
() => this.page.set_title(__('Point of Sale'))
]);
@@ -113,6 +115,9 @@
},
on_select_change: () => {
this.cart.numpad.set_inactive();
+ },
+ get_item_details: (item_code) => {
+ return this.items.get(item_code);
}
}
});
@@ -153,6 +158,7 @@
}
update_item_in_cart(item_code, field='qty', value=1) {
+ frappe.dom.freeze();
if(this.cart.exists(item_code)) {
const item = this.frm.doc.items.find(i => i.item_code === item_code);
frappe.flags.hide_serial_batch_dialog = false;
@@ -205,7 +211,9 @@
this.update_item_in_frm(item)
.then(() => {
// update cart
- this.remove_item_from_cart(item);
+ if (item.qty === 0) {
+ frappe.model.clear_doc(item.doctype, item.name);
+ }
this.update_cart_data(item);
});
}, true);
@@ -215,6 +223,7 @@
this.cart.add_item(item);
this.cart.update_taxes_and_totals();
this.cart.update_grand_total();
+ frappe.dom.unfreeze();
}
update_item_in_frm(item, field, value) {
@@ -224,22 +233,16 @@
}
if (field) {
- frappe.model.set_value(item.doctype, item.name, field, value);
+ return frappe.model.set_value(item.doctype, item.name, field, value)
+ .then(() => this.frm.script_manager.trigger('qty', item.doctype, item.name))
+ .then(() => {
+ if (field === 'qty' && item.qty === 0) {
+ frappe.model.clear_doc(item.doctype, item.name);
+ }
+ })
}
- return this.frm.script_manager
- .trigger('qty', item.doctype, item.name)
- .then(() => {
- if (field === 'qty') {
- this.remove_item_from_cart(item);
- }
- });
- }
-
- remove_item_from_cart(item) {
- if (item.qty === 0) {
- frappe.model.clear_doc(item.doctype, item.name);
- }
+ return Promise.resolve();
}
make_payment_modal() {
@@ -282,25 +285,67 @@
}
setup_pos_profile() {
+ return new Promise((resolve) => {
+
+ const load_default = () => {
+ this.pos_profile = {
+ company: this.company,
+ currency: frappe.defaults.get_default('currency'),
+ selling_price_list: frappe.defaults.get_default('selling_price_list')
+ };
+ resolve();
+ }
+
+ const on_submit = ({ pos_profile }) => {
+ this.get_pos_profile_doc(pos_profile)
+ .then(doc => {
+ this.pos_profile = doc;
+ if (!this.pos_profile) {
+ load_default();
+ }
+ resolve();
+ });
+ }
+
+ frappe.call({
+ method: 'erpnext.accounts.doctype.pos_profile.pos_profile.get_pos_profiles_for_user'
+ }).then((r) => {
+ if (r && r.message) {
+ const pos_profiles = r.message.filter(a => a);
+
+ if (pos_profiles.length === 0) {
+ load_default();
+ } else if(pos_profiles.length === 1) {
+ // load profile directly
+ on_submit({pos_profile: pos_profiles[0]});
+ } else {
+ // ask prompt
+ frappe.prompt(
+ [{ fieldtype: 'Select', label: 'POS Profile', options: pos_profiles }],
+ on_submit,
+ __('Select POS Profile')
+ );
+ }
+ } else {
+ frappe.dom.unfreeze();
+ frappe.throw(__("POS Profile is required to use Point-of-Sale"));
+ }
+ });
+ });
+ }
+
+ get_pos_profile_doc(pos_profile_name) {
return new Promise(resolve => {
frappe.call({
- method: 'erpnext.stock.get_item_details.get_pos_profile',
+ method: 'erpnext.accounts.doctype.pos_profile.pos_profile.get_pos_profile',
args: {
- company: this.company
+ pos_profile_name
+ },
+ callback: (r) => {
+ resolve(r.message);
}
- }).then(r => {
- this.pos_profile = r.message;
-
- if (!this.pos_profile) {
- this.pos_profile = {
- company: this.company,
- currency: frappe.defaults.get_default('currency'),
- selling_price_list: frappe.defaults.get_default('selling_price_list')
- };
- }
- resolve();
});
- })
+ });
}
setup_company() {
@@ -408,6 +453,7 @@
class POSCart {
constructor({frm, wrapper, pos_profile, events}) {
this.frm = frm;
+ this.item_data = {};
this.wrapper = wrapper;
this.events = events;
this.pos_profile = pos_profile;
@@ -667,7 +713,8 @@
const $item = this.$cart_items.find(`[data-item-code="${item.item_code}"]`);
if(item.qty > 0) {
- const indicator_class = item.actual_qty >= item.qty ? 'green' : 'red';
+ const is_stock_item = this.get_item_details(item.item_code).is_stock_item;
+ const indicator_class = (!is_stock_item || item.actual_qty >= item.qty) ? 'green' : 'red';
const remove_class = indicator_class == 'green' ? 'red' : 'green';
$item.find('.quantity input').val(item.qty);
@@ -681,8 +728,9 @@
}
get_item_html(item) {
+ const is_stock_item = this.get_item_details(item.item_code).is_stock_item;
const rate = format_currency(item.rate, this.frm.doc.currency);
- const indicator_class = item.actual_qty >= item.qty ? 'green' : 'red';
+ const indicator_class = (!is_stock_item || item.actual_qty >= item.qty) ? 'green' : 'red';
return `
<div class="list-item indicator ${indicator_class}" data-item-code="${item.item_code}" title="Item: ${item.item_name} Available Qty: ${item.actual_qty}">
<div class="item-name list-item__content list-item__content--flex-1.5 ellipsis">
@@ -717,6 +765,14 @@
}
}
+ get_item_details(item_code) {
+ if (!this.item_data[item_code]) {
+ this.item_data[item_code] = this.events.get_item_details(item_code);
+ }
+
+ return this.item_data[item_code];
+ }
+
exists(item_code) {
let $item = this.$cart_items.find(`[data-item-code="${item_code}"]`);
return $item.length > 0;
@@ -965,26 +1021,29 @@
this.search_index = this.search_index || {};
if (this.search_index[search_term]) {
const items = this.search_index[search_term];
+ this.items = items;
this.render_items(items);
this.set_item_in_the_cart(items);
return;
}
} else if (item_group == "All Item Groups") {
+ this.items = this.all_items;
return this.render_items(this.all_items);
}
this.get_items({search_value: search_term, item_group })
- .then(({ items, serial_no, batch_no }) => {
+ .then(({ items, serial_no, batch_no, barcode }) => {
if (search_term) {
this.search_index[search_term] = items;
}
+ this.items = items;
this.render_items(items);
- this.set_item_in_the_cart(items, serial_no, batch_no);
+ this.set_item_in_the_cart(items, serial_no, batch_no, barcode);
});
}
- set_item_in_the_cart(items, serial_no, batch_no) {
+ set_item_in_the_cart(items, serial_no, batch_no, barcode) {
if (serial_no) {
this.events.update_cart(items[0].item_code,
'serial_no', serial_no);
@@ -999,7 +1058,7 @@
return;
}
- if (items.length === 1) {
+ if (items.length === 1 && (serial_no || batch_no || barcode)) {
this.events.update_cart(items[0].item_code,
'qty', '+1');
this.reset_search_field();
@@ -1021,7 +1080,14 @@
}
get(item_code) {
- return this.items[item_code];
+ let item = {};
+ this.items.map(data => {
+ if (data.item_code === item_code) {
+ item = data;
+ }
+ })
+
+ return item
}
get_all() {
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py
index b92c653..8dad0a3 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.py
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.py
@@ -36,7 +36,7 @@
lft, rgt = frappe.db.get_value('Item Group', item_group, ['lft', 'rgt'])
# locate function is used to sort by closest match from the beginning of the value
res = frappe.db.sql("""select i.name as item_code, i.item_name, i.image as item_image,
- item_det.price_list_rate, item_det.currency
+ i.is_stock_item, item_det.price_list_rate, item_det.currency
from `tabItem` i LEFT JOIN
(select item_code, price_list_rate, currency from
`tabItem Price` where price_list=%(price_list)s) item_det
@@ -67,13 +67,18 @@
'batch_no': batch_no
})
+ if barcode:
+ res.update({
+ 'barcode': barcode
+ })
+
return res
def get_conditions(item_code, serial_no, batch_no, barcode):
if serial_no or batch_no or barcode:
- return frappe.db.escape(item_code), "i.item_code = %(item_code)s"
+ return frappe.db.escape(item_code), "i.name = %(item_code)s"
- condition = """(i.item_code like %(item_code)s
+ condition = """(i.name like %(item_code)s
or i.item_name like %(item_code)s)"""
return '%%%s%%'%(frappe.db.escape(item_code)), condition
diff --git a/erpnext/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py
index 0f1ee81..7472c51 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.py
+++ b/erpnext/setup/doctype/customer_group/customer_group.py
@@ -17,11 +17,11 @@
def validate_name_with_customer(self):
if frappe.db.exists("Customer", self.name):
- frappe.msgprint(_("An Customer exists with same name"), raise_exception=1)
+ frappe.msgprint(_("A customer with the same name already exists"), raise_exception=1)
def get_parent_customer_groups(customer_group):
lft, rgt = frappe.db.get_value("Customer Group", customer_group, ['lft', 'rgt'])
return frappe.db.sql("""select name from `tabCustomer Group`
where lft <= %s and rgt >= %s
- order by lft asc""", (lft, rgt), as_dict=True)
\ No newline at end of file
+ order by lft asc""", (lft, rgt), as_dict=True)
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index 2766ba0..a4c377e 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -47,9 +47,6 @@
return self.route
- def after_rename(self, olddn, newdn, merge=False):
- NestedSet.after_rename(self, olddn, newdn, merge)
-
def on_trash(self):
NestedSet.on_trash(self)
WebsiteGenerator.on_trash(self)
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index f7b09d6..766f9b5 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -40,7 +40,7 @@
frappe.local.message_log = []
domain_settings = frappe.get_single('Domain Settings')
- domain_settings.set_active_domains([args.get('domain')])
+ domain_settings.set_active_domains([_(args.get('domain'))])
frappe.db.commit()
login_as_first_user(args)
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index 390bc27..75899e1 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -39,3 +39,4 @@
frappe.db.sql("update `tabTax Rule` set use_for_shopping_cart = 1")
+test_dependencies = ["Tax Rule"]
\ No newline at end of file
diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py
index 3164306..e940f94 100644
--- a/erpnext/startup/boot.py
+++ b/erpnext/startup/boot.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
+from frappe.utils import cint
def boot_session(bootinfo):
"""boot session - send website info if guest"""
@@ -19,6 +20,8 @@
'territory')
bootinfo.sysdefaults.customer_group = frappe.db.get_single_value('Selling Settings',
'customer_group')
+ bootinfo.sysdefaults.allow_stale = cint(frappe.db.get_single_value('Accounts Settings',
+ 'allow_stale'))
bootinfo.notification_settings = frappe.get_doc("Notification Control",
"Notification Control")
diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js
index 113a2ef..3c334c4 100644
--- a/erpnext/stock/dashboard/item_dashboard.js
+++ b/erpnext/stock/dashboard/item_dashboard.js
@@ -80,7 +80,7 @@
$(frappe.render_template('item_dashboard_list', context)).appendTo(this.result);
} else {
var message = __(" Currently no stock available in any warehouse")
- $("<span class='small'> <i class='fa fa-exclamation-triangle' aria-hidden='true'></i>"+message+"</span>").appendTo(this.result);
+ $("<span class='text-muted small'>"+message+"</span>").appendTo(this.result);
}
},
get_item_dashboard_data: function(data, max_count, show_item) {
diff --git a/erpnext/stock/doctype/batch/batch.js b/erpnext/stock/doctype/batch/batch.js
index 1822a06..20581dc 100644
--- a/erpnext/stock/doctype/batch/batch.js
+++ b/erpnext/stock/doctype/batch/batch.js
@@ -24,6 +24,11 @@
frm.trigger('make_dashboard');
}
},
+ item: (frm) => {
+ frappe.db.get_value('Item', {name: frm.doc.item}, 'has_expiry_date', (r) => {
+ frm.toggle_reqd('expiry_date', r.has_expiry_date);
+ });
+ },
make_dashboard: (frm) => {
if(!frm.is_new()) {
frappe.call({
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index a41ae68..239891c 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -3610,7 +3610,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-09-19 11:21:59.084183",
+ "modified": "2017-11-03 05:31:56.636424",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
@@ -3727,5 +3727,5 @@
"timeline_field": "customer",
"title_field": "title",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index baa59bf..656ee69 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -74,19 +74,8 @@
}
erpnext.item.edit_prices_button(frm);
-
- // make sensitive fields(has_serial_no, is_stock_item, valuation_method, has_batch_no)
- // read only if any stock ledger entry exists
- if (!frm.doc.__islocal && frm.doc.is_stock_item) {
- frm.toggle_enable(['has_serial_no', 'is_stock_item', 'valuation_method', 'has_batch_no'],
- (frm.doc.__onload && frm.doc.__onload.sle_exists=="exists") ? false : true);
- }
-
erpnext.item.toggle_attributes(frm);
- frm.toggle_enable("is_fixed_asset", (frm.doc.__islocal || (!frm.doc.is_stock_item &&
- ((frm.doc.__onload && frm.doc.__onload.asset_exists) ? false : true))));
-
frm.add_custom_button(__('Duplicate'), function() {
var new_item = frappe.model.copy_doc(frm.doc);
if(new_item.item_name===new_item.item_code) {
@@ -109,14 +98,12 @@
erpnext.item.weight_to_validate(frm);
},
- image: function(frm) {
+ image: function() {
refresh_field("image_view");
},
is_fixed_asset: function(frm) {
- if (frm.doc.is_fixed_asset) {
- frm.set_value("is_stock_item", 0);
- }
+ frm.set_value("is_stock_item", frm.doc.is_fixed_asset ? 0 : 1);
},
page_name: frappe.utils.warn_page_name_change,
@@ -464,5 +451,6 @@
// nothing to do with attributes, hide it
frm.toggle_display("attributes", false);
}
+ frm.layout.refresh_sections();
}
});
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 05525ab..bfb4c62 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -1,3509 +1,3540 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:item_code",
- "beta": 0,
- "creation": "2013-05-03 10:45:46",
- "custom": 0,
- "default_print_format": "",
- "description": "A Product or a Service that is bought, sold or kept in stock.",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Setup",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:item_code",
+ "beta": 0,
+ "creation": "2013-05-03 10:45:46",
+ "custom": 0,
+ "default_print_format": "",
+ "description": "A Product or a Service that is bought, sold or kept in stock.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 1,
+ "engine": "InnoDB",
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "name_and_description_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "fa fa-flag",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "name_and_description_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-flag",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Series",
- "length": 0,
- "no_copy": 0,
- "options": "ITEM-",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 1,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Series",
+ "length": 0,
+ "no_copy": 0,
+ "options": "ITEM-",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "columns": 0,
- "description": "",
- "fieldname": "item_code",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 1,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Item Code",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_code",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "item_code",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 1,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Item Code",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "variant_of",
- "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified",
- "fieldname": "variant_of",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 1,
- "label": "Variant Of",
- "length": 0,
- "no_copy": 0,
- "options": "Item",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "variant_of",
+ "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified",
+ "fieldname": "variant_of",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 1,
+ "label": "Variant Of",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "item_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 1,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Item Name",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 1,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Item Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "barcode",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Barcode",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "barcode",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Barcode",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Item Group",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Item Group",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "is_item_from_hub",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Item from Hub",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "is_item_from_hub",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Is Item from Hub",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Unit of Measure",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Unit of Measure",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "disabled",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Disabled",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "disabled",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Disabled",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "1",
- "description": "",
- "fieldname": "is_stock_item",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Maintain Stock",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "is_stock_item",
- "oldfieldtype": "Select",
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "description": "",
+ "fieldname": "is_stock_item",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Maintain Stock",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "is_stock_item",
+ "oldfieldtype": "Select",
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:(doc.__islocal&&doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)",
- "fieldname": "opening_stock",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Opening Stock",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(doc.__islocal&&doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)",
+ "fieldname": "opening_stock",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Opening Stock",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:(doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)",
- "fieldname": "valuation_rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Valuation Rate",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)",
+ "fieldname": "valuation_rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Valuation Rate",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "standard_rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Standard Selling Rate",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "standard_rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Standard Selling Rate",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "is_fixed_asset",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Fixed Asset",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "is_fixed_asset",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Is Fixed Asset",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_fixed_asset",
- "fieldname": "asset_category",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Asset Category",
- "length": 0,
- "no_copy": 0,
- "options": "Asset Category",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_fixed_asset",
+ "fieldname": "asset_category",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Asset Category",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Asset Category",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:!doc.__islocal",
- "description": "",
- "fieldname": "tolerance",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Allow over delivery or receipt upto this percent",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "tolerance",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:!doc.__islocal",
+ "description": "",
+ "fieldname": "tolerance",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Allow over delivery or receipt upto this percent",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "tolerance",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "image",
- "fieldtype": "Attach Image",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Image",
- "length": 0,
- "no_copy": 0,
- "options": "image",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach Image",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "options": "image",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "section_break_11",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Description",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "section_break_11",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Brand",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Brand",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Description",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "is_stock_item",
- "columns": 0,
- "depends_on": "is_stock_item",
- "fieldname": "inventory",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Inventory",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "fa fa-truck",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "is_stock_item",
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "inventory",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Inventory",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-truck",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_stock_item",
- "description": "",
- "fieldname": "default_warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Warehouse",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "default_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "description": "",
+ "fieldname": "default_warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "default_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "2099-12-31",
- "depends_on": "is_stock_item",
- "fieldname": "end_of_life",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "End of Life",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "end_of_life",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "2099-12-31",
+ "depends_on": "is_stock_item",
+ "fieldname": "end_of_life",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "End of Life",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "end_of_life",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Purchase",
- "fieldname": "default_material_request_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Material Request Type",
- "length": 0,
- "no_copy": 0,
- "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Purchase",
+ "fieldname": "default_material_request_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Material Request Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_stock_item",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_stock_item",
- "fieldname": "valuation_method",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Valuation Method",
- "length": 0,
- "no_copy": 0,
- "options": "\nFIFO\nMoving Average",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "valuation_method",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Valuation Method",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nFIFO\nMoving Average",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_stock_item",
- "fieldname": "warranty_period",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Warranty Period (in days)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "warranty_period",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.is_stock_item",
+ "fieldname": "warranty_period",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Warranty Period (in days)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "warranty_period",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_stock_item",
- "description": "",
- "fieldname": "net_weight",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Net Weight",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "description": "",
+ "fieldname": "net_weight",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Net Weight",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_stock_item",
- "fieldname": "weight_uom",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Weight UOM",
- "length": 0,
- "no_copy": 0,
- "options": "UOM",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.is_stock_item",
+ "fieldname": "weight_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Weight UOM",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "is_stock_item",
- "description": "",
- "fieldname": "reorder_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Auto re-order",
- "length": 0,
- "no_copy": 0,
- "options": "fa fa-rss",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "description": "",
+ "fieldname": "reorder_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Auto re-order",
+ "length": 0,
+ "no_copy": 0,
+ "options": "fa fa-rss",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "description": "Will also apply for variants unless overrridden",
- "fieldname": "reorder_levels",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Reorder level based on Warehouse",
- "length": 0,
- "no_copy": 0,
- "options": "Item Reorder",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "Will also apply for variants unless overrridden",
+ "fieldname": "reorder_levels",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Reorder level based on Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Reorder",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "",
- "fieldname": "unit_of_measure_conversion",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Units of Measure",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "unit_of_measure_conversion",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Units of Measure",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "description": "Will also apply for variants",
- "fieldname": "uoms",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "UOMs",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "uom_conversion_details",
- "oldfieldtype": "Table",
- "options": "UOM Conversion Detail",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "Will also apply for variants",
+ "fieldname": "uoms",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "UOMs",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "uom_conversion_details",
+ "oldfieldtype": "Table",
+ "options": "UOM Conversion Detail",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "eval:doc.has_batch_no || doc.has_serial_no",
- "columns": 0,
- "depends_on": "is_stock_item",
- "fieldname": "serial_nos_and_batches",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Serial Nos and Batches",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "eval:doc.has_batch_no || doc.has_serial_no",
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "serial_nos_and_batches",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Serial Nos and Batches",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "",
- "depends_on": "eval:doc.is_stock_item",
- "fieldname": "has_batch_no",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Has Batch No",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "has_batch_no",
- "oldfieldtype": "Select",
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "depends_on": "eval:doc.is_stock_item",
+ "fieldname": "has_batch_no",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Has Batch No",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "has_batch_no",
+ "oldfieldtype": "Select",
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "has_batch_no",
- "description": "",
- "fieldname": "create_new_batch",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Automatically Create New Batch",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "has_batch_no",
+ "fieldname": "has_expiry_date",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Has Expiry Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_37",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "has_batch_no",
+ "description": "",
+ "fieldname": "create_new_batch",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Automatically Create New Batch",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "",
- "depends_on": "eval:doc.is_stock_item",
- "description": "",
- "fieldname": "has_serial_no",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Has Serial No",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "has_serial_no",
- "oldfieldtype": "Select",
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_37",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "has_serial_no",
- "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.",
- "fieldname": "serial_no_series",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Serial Number Series",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "depends_on": "eval:doc.is_stock_item",
+ "description": "",
+ "fieldname": "has_serial_no",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Has Serial No",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "has_serial_no",
+ "oldfieldtype": "Select",
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "attributes",
- "columns": 0,
- "depends_on": "",
- "fieldname": "variants_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Variants",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "has_serial_no",
+ "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.",
+ "fieldname": "serial_no_series",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Serial Number Series",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "0",
- "depends_on": "eval:!doc.variant_of",
- "description": "If this item has variants, then it cannot be selected in sales orders etc.",
- "fieldname": "has_variants",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Has Variants",
- "length": 0,
- "no_copy": 1,
- "options": "",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "attributes",
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "variants_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Variants",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Item Attribute",
- "depends_on": "has_variants",
- "fieldname": "variant_based_on",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Variant Based On",
- "length": 0,
- "no_copy": 0,
- "options": "Item Attribute\nManufacturer",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "depends_on": "eval:!doc.variant_of",
+ "description": "If this item has variants, then it cannot be selected in sales orders etc.",
+ "fieldname": "has_variants",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Has Variants",
+ "length": 0,
+ "no_copy": 1,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.has_variants && doc.variant_based_on==='Item Attribute'",
- "fieldname": "attributes",
- "fieldtype": "Table",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Attributes",
- "length": 0,
- "no_copy": 1,
- "options": "Item Variant Attribute",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Item Attribute",
+ "depends_on": "has_variants",
+ "fieldname": "variant_based_on",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Variant Based On",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Attribute\nManufacturer",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "purchase_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Purchase Details",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "fa fa-shopping-cart",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(doc.has_variants || doc.variant_of) && doc.variant_based_on==='Item Attribute'",
+ "fieldname": "attributes",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Attributes",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Item Variant Attribute",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "1",
- "fieldname": "is_purchase_item",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Purchase Item",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "purchase_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Purchase Details",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-shopping-cart",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "purchase_uom",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Purchase Unit of Measure",
- "length": 0,
- "no_copy": 0,
- "options": "UOM",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "is_purchase_item",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Is Purchase Item",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "0.00",
- "depends_on": "is_stock_item",
- "description": "",
- "fieldname": "min_order_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Minimum Order Qty",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "min_order_qty",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "purchase_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Purchase Unit of Measure",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "safety_stock",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Safety Stock",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0.00",
+ "depends_on": "is_stock_item",
+ "description": "",
+ "fieldname": "min_order_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Minimum Order Qty",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "min_order_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "description": "Average time taken by the supplier to deliver",
- "fieldname": "lead_time_days",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Lead Time in days",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "lead_time_days",
- "oldfieldtype": "Int",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "safety_stock",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Safety Stock",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "description": "",
- "fieldname": "buying_cost_center",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Buying Cost Center",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "Average time taken by the supplier to deliver",
+ "fieldname": "lead_time_days",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Lead Time in days",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "lead_time_days",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "description": "",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Expense Account",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "purchase_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "",
+ "fieldname": "buying_cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Buying Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "last_purchase_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Last Purchase Rate",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "last_purchase_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "",
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Expense Account",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "purchase_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "",
- "fieldname": "supplier_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Supplier Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "last_purchase_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Last Purchase Rate",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "last_purchase_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "default_supplier",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Supplier",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "supplier_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Supplier Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "delivered_by_supplier",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Delivered by Supplier (Drop Ship)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "default_supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "manufacturer",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Manufacturer",
- "length": 0,
- "no_copy": 0,
- "options": "Manufacturer",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "delivered_by_supplier",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Delivered by Supplier (Drop Ship)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "manufacturer_part_no",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Manufacturer Part Number",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "manufacturer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Manufacturer",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Manufacturer",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Item Code for Suppliers",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Manufacturer Part Number",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Item Code for Suppliers",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "supplier_items",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Supplier Items",
- "length": 0,
- "no_copy": 0,
- "options": "Item Supplier",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "supplier_items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Supplier Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Supplier",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "foreign_trade_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Foreign Trade Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "foreign_trade_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Foreign Trade Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "country_of_origin",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Country of Origin",
- "length": 0,
- "no_copy": 0,
- "options": "Country",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "country_of_origin",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Country of Origin",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Country",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_59",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_59",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "customs_tariff_number",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Customs Tariff Number",
- "length": 0,
- "no_copy": 0,
- "options": "Customs Tariff Number",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customs_tariff_number",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Customs Tariff Number",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customs Tariff Number",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "sales_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Sales Details",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "fa fa-tag",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "sales_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Sales Details",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-tag",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "1",
- "fieldname": "is_sales_item",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Sales Item",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "is_sales_item",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Is Sales Item",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "sales_uom",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Sales Unit of Measure",
- "length": 0,
- "no_copy": 0,
- "options": "UOM",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "sales_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Sales Unit of Measure",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "income_account",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Income Account",
- "length": 0,
- "no_copy": 0,
- "options": "Account",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "income_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Income Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "selling_cost_center",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default Selling Cost Center",
- "length": 0,
- "no_copy": 0,
- "options": "Cost Center",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "selling_cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Selling Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Customer Item Codes",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Customer Item Codes",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "description": "",
- "fieldname": "customer_items",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Customer Items",
- "length": 0,
- "no_copy": 0,
- "options": "Item Customer Detail",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "",
+ "fieldname": "customer_items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Customer Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Customer Detail",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "max_discount",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Max Discount (%)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "max_discount",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "max_discount",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Max Discount (%)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "max_discount",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "item_tax_section_break",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Item Tax",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "fa fa-money",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "item_tax_section_break",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Item Tax",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-money",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Will also apply for variants",
- "fieldname": "taxes",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Taxes",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_tax",
- "oldfieldtype": "Table",
- "options": "Item Tax",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Will also apply for variants",
+ "fieldname": "taxes",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Taxes",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_tax",
+ "oldfieldtype": "Table",
+ "options": "Item Tax",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "inspection_criteria",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Inspection Criteria",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "fa fa-search",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "inspection_criteria",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Inspection Criteria",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-search",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "",
- "fieldname": "inspection_required_before_purchase",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Inspection Required before Purchase",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "inspection_required",
- "oldfieldtype": "Select",
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "fieldname": "inspection_required_before_purchase",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Inspection Required before Purchase",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "inspection_required",
+ "oldfieldtype": "Select",
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "inspection_required_before_delivery",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Inspection Required before Delivery",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "inspection_required_before_delivery",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Inspection Required before Delivery",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:(doc.inspection_required_before_purchase || doc.inspection_required_before_delivery)",
- "description": "Will also apply to variants",
- "fieldname": "quality_parameters",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Quality Parameters",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_specification_details",
- "oldfieldtype": "Table",
- "options": "Item Quality Inspection Parameter",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(doc.inspection_required_before_purchase || doc.inspection_required_before_delivery)",
+ "description": "Will also apply to variants",
+ "fieldname": "quality_parameters",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Quality Parameters",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_specification_details",
+ "oldfieldtype": "Table",
+ "options": "Item Quality Inspection Parameter",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "is_stock_item",
- "fieldname": "manufacturing",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Manufacturing",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "fa fa-cogs",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "manufacturing",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Manufacturing",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-cogs",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "default_bom",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Default BOM",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "default_bom",
- "oldfieldtype": "Link",
- "options": "BOM",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "default_bom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default BOM",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "default_bom",
+ "oldfieldtype": "Link",
+ "options": "BOM",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "",
- "description": "If subcontracted to a vendor",
- "fieldname": "is_sub_contracted_item",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Supply Raw Materials for Purchase",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "is_sub_contracted_item",
- "oldfieldtype": "Select",
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "description": "If subcontracted to a vendor",
+ "fieldname": "is_sub_contracted_item",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Supply Raw Materials for Purchase",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "is_sub_contracted_item",
+ "oldfieldtype": "Select",
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_74",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_74",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "customer_code",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Customer Code",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customer_code",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Customer Code",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "website_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Website",
- "length": 0,
- "no_copy": 0,
- "options": "fa fa-globe",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "website_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Website",
+ "length": 0,
+ "no_copy": 0,
+ "options": "fa fa-globe",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:!doc.variant_of",
- "fieldname": "show_in_website",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Show in Website",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:!doc.variant_of",
+ "fieldname": "show_in_website",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Show in Website",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "variant_of",
- "fieldname": "show_variant_in_website",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Show in Website (Variant)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "variant_of",
+ "fieldname": "show_variant_in_website",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Show in Website (Variant)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "fieldname": "route",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Route",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "route",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Route",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "description": "Items with higher weightage will be shown higher",
- "fieldname": "weightage",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Weightage",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "Items with higher weightage will be shown higher",
+ "fieldname": "weightage",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Weightage",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "description": "Show a slideshow at the top of the page",
- "fieldname": "slideshow",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Slideshow",
- "length": 0,
- "no_copy": 0,
- "options": "Website Slideshow",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "Show a slideshow at the top of the page",
+ "fieldname": "slideshow",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Slideshow",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Website Slideshow",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "description": "Item Image (if not slideshow)",
- "fieldname": "website_image",
- "fieldtype": "Attach",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Image",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "Item Image (if not slideshow)",
+ "fieldname": "website_image",
+ "fieldtype": "Attach",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "thumbnail",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Thumbnail",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "thumbnail",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Thumbnail",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "cb72",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "cb72",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.",
- "fieldname": "website_warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Website Warehouse",
- "length": 0,
- "no_copy": 0,
- "options": "Warehouse",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.",
+ "fieldname": "website_warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Website Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "description": "List this Item in multiple groups on the website.",
- "fieldname": "website_item_groups",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Website Item Groups",
- "length": 0,
- "no_copy": 0,
- "options": "Website Item Group",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "List this Item in multiple groups on the website.",
+ "fieldname": "website_item_groups",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Website Item Groups",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Website Item Group",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "website_specifications",
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "fieldname": "sb72",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Website Specifications",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "website_specifications",
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "sb72",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Website Specifications",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "fieldname": "copy_from_item_group",
- "fieldtype": "Button",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Copy From Item Group",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "copy_from_item_group",
+ "fieldtype": "Button",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Copy From Item Group",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "fieldname": "website_specifications",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Website Specifications",
- "length": 0,
- "no_copy": 0,
- "options": "Item Website Specification",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "website_specifications",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Website Specifications",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Website Specification",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
- "fieldname": "web_long_description",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Website Description",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "web_long_description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Website Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "total_projected_qty",
- "fieldtype": "Float",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Total Projected Qty",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "total_projected_qty",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Total Projected Qty",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:(!doc.is_item_from_hub)",
- "fieldname": "hub_publishing_sb",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Hub Publishing Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(!doc.is_item_from_hub)",
+ "fieldname": "hub_publishing_sb",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Hub Publishing Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "0",
- "description": "Publish Item to hub.erpnext.com",
- "fieldname": "publish_in_hub",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Publish in Hub",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "description": "Publish Item to hub.erpnext.com",
+ "fieldname": "publish_in_hub",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Publish in Hub",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "hub_category_to_publish",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Hub Category to Publish",
- "length": 0,
- "no_copy": 0,
- "options": "Hub Category",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "hub_category_to_publish",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Hub Category to Publish",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Hub Category",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Publish \"In Stock\" or \"Not in Stock\" on Hub based on stock available in this warehouse.",
- "fieldname": "hub_warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Hub Warehouse",
- "length": 0,
- "no_copy": 0,
- "options": "Warehouse",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Publish \"In Stock\" or \"Not in Stock\" on Hub based on stock available in this warehouse.",
+ "fieldname": "hub_warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Hub Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Warehouse",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "0",
- "fieldname": "synced_with_hub",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Synced With Hub",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "fieldname": "synced_with_hub",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Synced With Hub",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "fa fa-tag",
- "idx": 2,
- "image_field": "image",
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 1,
- "modified": "2017-10-03 14:08:02.948326",
- "modified_by": "Administrator",
- "module": "Stock",
- "name": "Item",
- "owner": "Administrator",
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "fa fa-tag",
+ "idx": 2,
+ "image_field": "image",
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 1,
+ "modified": "2017-11-13 15:49:13.213990",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Item Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Item Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Stock Manager",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock Manager",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Stock User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Stock User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "Sales User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Sales User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "Purchase User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Purchase User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "Maintenance User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Maintenance User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "Accounts User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "Manufacturing User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Manufacturing User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
}
- ],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "item_name,description,item_group,customer_code",
- "show_name_in_global_search": 1,
- "sort_field": "idx desc, modified desc",
- "sort_order": "DESC",
- "title_field": "item_name",
- "track_changes": 1,
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "search_fields": "item_name,description,item_group,customer_code",
+ "show_name_in_global_search": 1,
+ "sort_field": "idx desc, modified desc",
+ "sort_order": "DESC",
+ "title_field": "item_name",
+ "track_changes": 1,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index e7ed5d0..929c0ee 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -9,6 +9,7 @@
from frappe import msgprint, _
from frappe.utils import (cstr, flt, cint, getdate, now_datetime, formatdate,
strip, get_timestamp, random_string)
+from frappe.utils.html_utils import clean_html
from frappe.website.website_generator import WebsiteGenerator
from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for, get_parent_item_groups
from frappe.website.render import clear_cache
@@ -17,6 +18,7 @@
make_variant_item_code, validate_item_variant_attributes, ItemVariantExistsError)
class DuplicateReorderRows(frappe.ValidationError): pass
+class StockExistsForTemplate(frappe.ValidationError): pass
class Item(WebsiteGenerator):
website = frappe._dict(
@@ -28,7 +30,8 @@
def onload(self):
super(Item, self).onload()
- self.set_onload('sle_exists', self.check_if_sle_exists())
+
+ self.set_onload('stock_exists', self.stock_ledger_created())
if self.is_fixed_asset:
asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)
self.set_onload("asset_exists", True if asset else False)
@@ -52,7 +55,7 @@
if not self.description:
self.description = self.item_name
- if self.is_sales_item and not self.is_item_from_hub:
+ if self.is_sales_item and not self.get('is_item_from_hub'):
self.publish_in_hub = 1
def after_insert(self):
@@ -64,9 +67,7 @@
self.set_opening_stock()
def validate(self):
- self.before_update = None
- if frappe.db.exists('Item', self.name):
- self.before_update = frappe.get_doc('Item', self.name)
+ self.get_doc_before_save()
super(Item, self).validate()
@@ -77,6 +78,7 @@
self.description = self.item_name
self.validate_uom()
+ self.validate_description()
self.add_default_uom_in_conversion_factor_table()
self.validate_conversion_factor()
self.validate_item_type()
@@ -84,12 +86,12 @@
self.fill_customer_code()
self.check_item_tax()
self.validate_barcode()
- self.cant_change()
self.validate_warehouse_for_reorder()
- self.update_item_desc()
+ self.update_bom_item_desc()
self.synced_with_hub = 0
self.validate_has_variants()
+ self.validate_stock_exists_for_template_item()
self.validate_attributes()
self.validate_variant_attributes()
self.validate_website_image()
@@ -109,6 +111,11 @@
self.update_item_price()
self.update_template_item()
+ def validate_description(self):
+ '''Clean HTML description if set'''
+ if cint(frappe.db.get_single_value('Stock Settings', 'clean_description_html')):
+ self.description = clean_html(self.description)
+
def add_price(self, price_list=None):
'''Add a new price'''
if not price_list:
@@ -241,6 +248,14 @@
if not self.asset_category:
frappe.throw(_("Asset Category is mandatory for Fixed Asset item"))
+ if self.stock_ledger_created():
+ frappe.throw(_("Cannot be a fixed asset item as Stock Ledger is created."))
+
+ if not self.is_fixed_asset:
+ asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)
+ if asset:
+ frappe.throw(_('"Is Fixed Asset" cannot be unchecked, as Asset record exists against the item'))
+
def get_context(self, context):
context.show_search=True
context.search_link = '/product_search'
@@ -450,62 +465,27 @@
if duplicate:
frappe.throw(_("Barcode {0} already used in Item {1}").format(self.barcode, duplicate[0][0]))
- def cant_change(self):
- if not self.get("__islocal"):
- to_check = ("has_serial_no", "is_stock_item",
- "valuation_method", "has_batch_no", "is_fixed_asset")
- vals = frappe.db.get_value("Item", self.name, to_check, as_dict=True)
- if not vals.get('valuation_method') and self.get('valuation_method'):
- vals['valuation_method'] = frappe.db.get_single_value("Stock Settings", "valuation_method") or "FIFO"
-
- if vals:
- for key in to_check:
- if cstr(self.get(key)) != cstr(vals.get(key)):
- if not self.check_if_linked_document_exists(key):
- break # no linked document, allowed
- else:
- frappe.throw(_("As there are existing transactions against item {0}, you can not change the value of {1}").format(self.name, frappe.bold(self.meta.get_label(key))))
-
- if vals and not self.is_fixed_asset and self.is_fixed_asset != vals.is_fixed_asset:
- asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1)
- if asset:
- frappe.throw(_('"Is Fixed Asset" cannot be unchecked, as Asset record exists against the item'))
-
- def check_if_linked_document_exists(self, key):
- linked_doctypes = ["Delivery Note Item", "Sales Invoice Item", "Purchase Receipt Item",
- "Purchase Invoice Item", "Stock Entry Detail", "Stock Reconciliation Item"]
-
- # For "Is Stock Item", following doctypes is important
- # because reserved_qty, ordered_qty and requested_qty updated from these doctypes
- if key == "is_stock_item":
- linked_doctypes += ["Sales Order Item", "Purchase Order Item", "Material Request Item"]
-
- for doctype in linked_doctypes:
- if frappe.db.get_value(doctype, filters={"item_code": self.name, "docstatus": 1}) or \
- frappe.db.get_value("Production Order",
- filters={"production_item": self.name, "docstatus": 1}):
- return True
-
+ def validate_warehouse_for_reorder(self):
+ '''Validate Reorder level table for duplicate and conditional mandatory'''
+ warehouse = []
for d in self.get("reorder_levels"):
+ if not d.warehouse_group:
+ d.warehouse_group = d.warehouse
+ if d.get("warehouse") and d.get("warehouse") not in warehouse:
+ warehouse += [d.get("warehouse")]
+ else:
+ frappe.throw(_("Row {0}: An Reorder entry already exists for this warehouse {1}")
+ .format(d.idx, d.warehouse), DuplicateReorderRows)
+
if d.warehouse_reorder_level and not d.warehouse_reorder_qty:
frappe.throw(_("Row #{0}: Please set reorder quantity").format(d.idx))
- def validate_warehouse_for_reorder(self):
- warehouse = []
- for i in self.get("reorder_levels"):
- if not i.warehouse_group:
- i.warehouse_group = i.warehouse
- if i.get("warehouse") and i.get("warehouse") not in warehouse:
- warehouse += [i.get("warehouse")]
- else:
- frappe.throw(_("Row {0}: An Reorder entry already exists for this warehouse {1}")
- .format(i.idx, i.warehouse), DuplicateReorderRows)
-
- def check_if_sle_exists(self):
- sle = frappe.db.sql("""select name from `tabStock Ledger Entry`
- where item_code = %s""", self.name)
- return sle and 'exists' or 'not exists'
+ def stock_ledger_created(self):
+ if not hasattr(self, '_stock_ledger_created'):
+ self._stock_ledger_created = len(frappe.db.sql("""select name from `tabStock Ledger Entry`
+ where item_code = %s limit 1""", self.name))
+ return self._stock_ledger_created
def validate_name_with_item_group(self):
# causes problem with tree build
@@ -593,13 +573,27 @@
row.label = label
row.description = desc
- def update_item_desc(self):
- if frappe.db.get_value('BOM',self.name, 'description') != self.description:
- frappe.db.sql("""update `tabBOM` set description = %s where item = %s and docstatus < 2""",(self.description, self.name))
- frappe.db.sql("""update `tabBOM Item` set description = %s where
- item_code = %s and docstatus < 2""",(self.description, self.name))
- frappe.db.sql("""update `tabBOM Explosion Item` set description = %s where
- item_code = %s and docstatus < 2""",(self.description, self.name))
+ def update_bom_item_desc(self):
+ if self.is_new(): return
+
+ if self.db_get('description') != self.description:
+ frappe.db.sql("""
+ update `tabBOM`
+ set description = %s
+ where item = %s and docstatus < 2
+ """, (self.description, self.name))
+
+ frappe.db.sql("""
+ update `tabBOM Item`
+ set description = %s
+ where item_code = %s and docstatus < 2
+ """, (self.description, self.name))
+
+ frappe.db.sql("""
+ update `tabBOM Explosion Item`
+ set description = %s
+ where item_code = %s and docstatus < 2
+ """, (self.description, self.name))
def update_template_item(self):
"""Set Show in Website for Template Item if True for its Variant"""
@@ -618,24 +612,37 @@
template_item.save()
def update_variants(self):
- if self.flags.dont_update_variants:
- return
- if self.has_variants:
- updated = []
- variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name })
- for d in variants:
- variant = frappe.get_doc("Item", d)
- copy_attributes_to_variant(self, variant)
- variant.save()
- updated.append(d.item_code)
- if updated:
- frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
+ if self.flags.dont_update_variants or \
+ frappe.db.get_single_value('Item Variant Settings', 'do_not_update_variants'):
+ return
+ if self.has_variants:
+ updated = []
+ variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name })
+ for d in variants:
+ variant = frappe.get_doc("Item", d)
+ copy_attributes_to_variant(self, variant)
+ variant.save()
+ updated.append(d.item_code)
+ if updated:
+ frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
def validate_has_variants(self):
if not self.has_variants and frappe.db.get_value("Item", self.name, "has_variants"):
if frappe.db.exists("Item", {"variant_of": self.name}):
frappe.throw(_("Item has variants."))
+ def validate_stock_exists_for_template_item(self):
+ if self.stock_ledger_created():
+ if ((self._doc_before_save
+ and self._doc_before_save.has_variants != self.has_variants)
+ or self.variant_of != self._doc_before_save.variant_of):
+ frappe.throw(_("Cannot change Variant properties after stock transction. You will have to make a new Item to do this.").format(self.name),
+ StockExistsForTemplate)
+
+ if self.has_variants or self.variant_of:
+ if not self.is_child_table_same('attributes'):
+ frappe.throw(_('Cannot change Attributes after stock transaction. Make a new Item and transfer stock to the new Item'))
+
def validate_uom(self):
if not self.get("__islocal"):
check_stock_uom_with_bin(self.name, self.stock_uom)
diff --git a/erpnext/stock/doctype/item/item_list.js b/erpnext/stock/doctype/item/item_list.js
index cc46177..db53ae9 100644
--- a/erpnext/stock/doctype/item/item_list.js
+++ b/erpnext/stock/doctype/item/item_list.js
@@ -4,12 +4,12 @@
filters: [["disabled", "=", "0"]],
get_indicator: function(doc) {
- if(doc.total_projected_qty < 0) {
- return [__("Shortage"), "red", "total_projected_qty,<,0"];
- } else if (doc.disabled) {
+ if (doc.disabled) {
return [__("Disabled"), "grey", "disabled,=,Yes"];
} else if (doc.end_of_life && doc.end_of_life < frappe.datetime.get_today()) {
return [__("Expired"), "grey", "end_of_life,<,Today"];
+ } else if(doc.total_projected_qty < 0) {
+ return [__("Shortage"), "red", "total_projected_qty,<,0"];
} else if (doc.has_variants) {
return [__("Template"), "orange", "has_variants,=,Yes"];
} else if (doc.variant_of) {
diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py
index c3f399a..8693414 100644
--- a/erpnext/stock/doctype/item/test_item.py
+++ b/erpnext/stock/doctype/item/test_item.py
@@ -8,6 +8,7 @@
from frappe.test_runner import make_test_records
from erpnext.controllers.item_variant import (create_variant, ItemVariantExistsError,
InvalidItemAttributeValueError, get_variant)
+from erpnext.stock.doctype.item.item import StockExistsForTemplate
from frappe.model.rename_doc import rename_doc
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
@@ -190,7 +191,8 @@
"increment": 0.5
}
],
- "default_warehouse": "_Test Warehouse - _TC"
+ "default_warehouse": "_Test Warehouse - _TC",
+ "has_variants": 1
})
variant = create_variant("_Test Numeric Template Item",
@@ -263,6 +265,15 @@
self.assertEquals(variant.manufacturer, 'MSG1')
self.assertEquals(variant.manufacturer_part_no, '007')
+ def test_stock_exists_against_template_item(self):
+ stock_item = frappe.get_all('Stock Ledger Entry', fields = ["item_code"], limit=1)
+ if stock_item:
+ item_code = stock_item[0].item_code
+
+ item_doc = frappe.get_doc('Item', item_code)
+ item_doc.has_variants = 1
+ self.assertRaises(StockExistsForTemplate, item_doc.save)
+
def set_item_variant_settings(fields):
doc = frappe.get_doc('Item Variant Settings')
doc.set('fields', fields)
diff --git a/erpnext/crm/doctype/item/test_item.js b/erpnext/stock/doctype/item/tests/test_item.js
similarity index 98%
rename from erpnext/crm/doctype/item/test_item.js
rename to erpnext/stock/doctype/item/tests/test_item.js
index c9b14ca..5e3524e 100644
--- a/erpnext/crm/doctype/item/test_item.js
+++ b/erpnext/stock/doctype/item/tests/test_item.js
@@ -1,3 +1,4 @@
+QUnit.module('stock');
QUnit.test("test: item", function (assert) {
assert.expect(6);
let done = assert.async();
diff --git a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json
index a29137c..8ad73d1 100644
--- a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json
+++ b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json
@@ -18,6 +18,66 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "section_break_3",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Fields will be copied over only at time of creation.",
+ "fieldname": "do_not_update_variants",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Do not update variants on save",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "copy_fields_to_variant",
"fieldtype": "Section Break",
"hidden": 0,
@@ -84,8 +144,8 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-11 12:05:16.288601",
- "modified_by": "rohit@erpnext.com",
+ "modified": "2017-11-14 15:54:12.190518",
+ "modified_by": "Administrator",
"module": "Stock",
"name": "Item Variant Settings",
"name_case": "",
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py
index 25fde08..ec5392f 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.py
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.py
@@ -2,11 +2,13 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
-import frappe
-from frappe.utils import flt, cint
-from frappe import _
+import frappe
+from frappe import _
+from frappe.model import no_value_fields
from frappe.model.document import Document
+from frappe.utils import cint, flt
+
class PackingSlip(Document):
@@ -84,11 +86,12 @@
* No. of Cases of this packing slip
"""
- # also pick custom fields from delivery note
rows = [d.item_code for d in self.get("items")]
- custom_fields = ', '.join(['dni.`{0}`'.format(d.fieldname) for d in \
- frappe.get_meta("Delivery Note Item").get_custom_fields()])
+ # also pick custom fields from delivery note
+ custom_fields = ', '.join(['dni.`{0}`'.format(d.fieldname)
+ for d in frappe.get_meta("Delivery Note Item").get_custom_fields()
+ if d.fieldtype not in no_value_fields])
if custom_fields:
custom_fields = ', ' + custom_fields
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.json b/erpnext/stock/doctype/stock_settings/stock_settings.json
index 4801d40..16726be 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.json
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
@@ -11,6 +12,7 @@
"editable_grid": 0,
"fields": [
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -22,6 +24,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Item Naming By",
@@ -40,6 +43,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -51,6 +55,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Default Item Group",
@@ -69,6 +74,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -79,6 +85,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Default Stock UOM",
@@ -97,6 +104,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -107,6 +115,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Warehouse",
@@ -126,6 +135,38 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "clean_description_html",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Convert Item Description to Clean HTML",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -136,6 +177,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -152,6 +194,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -162,6 +205,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Valuation Method",
@@ -180,6 +224,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -191,6 +236,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Limit Percent",
@@ -208,6 +254,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -219,6 +266,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Show Barcode Field",
@@ -237,6 +285,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -247,6 +296,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -264,6 +314,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -274,6 +325,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Auto insert Price List rate if missing",
@@ -292,6 +344,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -302,6 +355,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allow Negative Stock",
@@ -319,6 +373,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -329,6 +384,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -346,6 +402,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -357,6 +414,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Automatically Set Serial Nos based on FIFO",
@@ -375,6 +433,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -385,6 +444,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Auto Material Request",
@@ -402,6 +462,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -412,6 +473,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Raise Material Request when stock reaches re-order level",
@@ -429,6 +491,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -439,6 +502,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Notify by Email on creation of automatic Material Request",
@@ -456,6 +520,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -466,6 +531,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Freeze Stock Entries",
@@ -483,6 +549,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -493,6 +560,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Stock Frozen Upto",
@@ -510,6 +578,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -520,6 +589,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Freeze Stocks Older Than [Days]",
@@ -537,6 +607,7 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -547,6 +618,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Role Allowed to edit frozen stock",
@@ -565,18 +637,18 @@
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-cog",
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-12-16 02:18:58.187847",
+ "modified": "2017-11-14 16:19:50.274518",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Settings",
@@ -592,7 +664,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -607,6 +678,8 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
+ "show_name_in_global_search": 0,
"sort_order": "ASC",
+ "track_changes": 0,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py
index 186eaee..89ece33 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.py
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.py
@@ -7,6 +7,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
+from frappe.utils.html_utils import clean_html
class StockSettings(Document):
def validate(self):
@@ -26,19 +27,34 @@
# show/hide barcode field
frappe.make_property_setter({'fieldname': 'barcode', 'property': 'hidden',
'value': 0 if self.show_barcode_field else 1})
-
+
self.cant_change_valuation_method()
-
+ self.validate_clean_description_html()
+
def cant_change_valuation_method(self):
db_valuation_method = frappe.db.get_single_value("Stock Settings", "valuation_method")
-
+
if db_valuation_method and db_valuation_method != self.valuation_method:
- # check if there are any stock ledger entries against items
+ # check if there are any stock ledger entries against items
# which does not have it's own valuation method
sle = frappe.db.sql("""select name from `tabStock Ledger Entry` sle
- where exists(select name from tabItem
- where name=sle.item_code and (valuation_method is null or valuation_method=''))
+ where exists(select name from tabItem
+ where name=sle.item_code and (valuation_method is null or valuation_method='')) limit 1
""")
-
+
if sle:
- frappe.throw(_("Can't change valuation method, as there are transactions against some items which does not have it's own valuation method"))
\ No newline at end of file
+ frappe.throw(_("Can't change valuation method, as there are transactions against some items which does not have it's own valuation method"))
+
+ def validate_clean_description_html(self):
+ if int(self.clean_description_html or 0) \
+ and not int(self.db_get('clean_description_html') or 0):
+ # changed to text
+ frappe.enqueue('erpnext.stock.doctype.stock_settings.stock_settings.clean_all_descriptions', now=frappe.flags.in_test)
+
+
+def clean_all_descriptions():
+ for item in frappe.get_all('Item', ['name', 'description']):
+ if item.description:
+ clean_description = clean_html(item.description)
+ if item.description != clean_description:
+ frappe.db.set_value('Item', item.name, 'description', clean_description)
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.js b/erpnext/stock/doctype/stock_settings/test_stock_settings.js
similarity index 66%
rename from erpnext/buying/doctype/purchase_order/test_purchase_order.js
rename to erpnext/stock/doctype/stock_settings/test_stock_settings.js
index e9db270..57d9fc6 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.js
+++ b/erpnext/stock/doctype/stock_settings/test_stock_settings.js
@@ -2,15 +2,15 @@
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
-QUnit.test("test: Purchase Order", function (assert) {
+QUnit.test("test: Stock Settings", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
- frappe.run_serially('Purchase Order', [
- // insert a new Purchase Order
- () => frappe.tests.make([
+ frappe.run_serially([
+ // insert a new Stock Settings
+ () => frappe.tests.make('Stock Settings', [
// values to be set
{key: 'value'}
]),
diff --git a/erpnext/stock/doctype/stock_settings/test_stock_settings.py b/erpnext/stock/doctype/stock_settings/test_stock_settings.py
new file mode 100644
index 0000000..43c0c57
--- /dev/null
+++ b/erpnext/stock/doctype/stock_settings/test_stock_settings.py
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestStockSettings(unittest.TestCase):
+ def setUp(self):
+ settings = frappe.get_single('Stock Settings')
+ settings.clean_description_html = 0
+ settings.save()
+
+ frappe.delete_doc('Item', 'Item for description test')
+
+ def tearDown(self):
+ settings = frappe.get_single('Stock Settings')
+ settings.clean_description_html = 1
+ settings.save()
+
+ def test_settings(self):
+ item = frappe.get_doc(dict(
+ doctype = 'Item',
+ item_code = 'Item for description test',
+ item_group = 'Products',
+ description = '<p><span style="font-size: 12px;">Drawing No. 07-xxx-PO132<br></span><span style="font-size: 12px;">1800 x 1685 x 750<br></span><span style="font-size: 12px;">All parts made of Marine Ply<br></span><span style="font-size: 12px;">Top w/ Corian dd<br></span><span style="font-size: 12px;">CO, CS, VIP Day Cabin</span></p>'
+ )).insert()
+
+ settings = frappe.get_single('Stock Settings')
+ settings.clean_description_html = 1
+ settings.save()
+
+ item.reload()
+
+ self.assertEquals(item.description, '<p>Drawing No. 07-xxx-PO132<br>1800 x 1685 x 750<br>All parts made of Marine Ply<br>Top w/ Corian dd<br>CO, CS, VIP Day Cabin</p>')
+
+ item.delete()
+
+ def test_clean_html(self):
+ settings = frappe.get_single('Stock Settings')
+ settings.clean_description_html = 1
+ settings.save()
+
+ item = frappe.get_doc(dict(
+ doctype = 'Item',
+ item_code = 'Item for description test',
+ item_group = 'Products',
+ description = '<p><span style="font-size: 12px;">Drawing No. 07-xxx-PO132<br></span><span style="font-size: 12px;">1800 x 1685 x 750<br></span><span style="font-size: 12px;">All parts made of Marine Ply<br></span><span style="font-size: 12px;">Top w/ Corian dd<br></span><span style="font-size: 12px;">CO, CS, VIP Day Cabin</span></p>'
+ )).insert()
+
+ self.assertEquals(item.description, '<p>Drawing No. 07-xxx-PO132<br>1800 x 1685 x 750<br>All parts made of Marine Ply<br>Top w/ Corian dd<br>CO, CS, VIP Day Cabin</p>')
+
+ item.delete()
diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py
index b0335d7..5186408 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.py
+++ b/erpnext/stock/doctype/warehouse/warehouse.py
@@ -57,13 +57,15 @@
def check_if_sle_exists(self):
return frappe.db.sql("""select name from `tabStock Ledger Entry`
- where warehouse = %s""", self.name)
+ where warehouse = %s limit 1""", self.name)
def check_if_child_exists(self):
return frappe.db.sql("""select name from `tabWarehouse`
- where parent_warehouse = %s""", self.name)
+ where parent_warehouse = %s limit 1""", self.name)
def before_rename(self, old_name, new_name, merge=False):
+ super(Warehouse, self).before_rename(old_name, new_name, merge)
+
# Add company abbr if not provided
new_warehouse = erpnext.encode_company_abbr(new_name, self.company)
@@ -77,19 +79,21 @@
return new_warehouse
def after_rename(self, old_name, new_name, merge=False):
+ super(Warehouse, self).after_rename(old_name, new_name, merge)
+
new_warehouse_name = self.get_new_warehouse_name_without_abbr(new_name)
self.db_set("warehouse_name", new_warehouse_name)
-
+
if merge:
self.recalculate_bin_qty(new_name)
-
+
def get_new_warehouse_name_without_abbr(self, name):
company_abbr = frappe.db.get_value("Company", self.company, "abbr")
parts = name.rsplit(" - ", 1)
-
+
if parts[-1].lower() == company_abbr.lower():
name = parts[0]
-
+
return name
def recalculate_bin_qty(self, new_name):
@@ -135,25 +139,19 @@
return 1
@frappe.whitelist()
-def get_children():
+def get_children(doctype, parent=None, company=None, is_root=False):
from erpnext.stock.utils import get_stock_value_on
- doctype = frappe.local.form_dict.get('doctype')
- company = frappe.local.form_dict.get('company')
- parent_field = 'parent_' + doctype.lower().replace(' ', '_')
- parent = frappe.form_dict.get("parent") or ""
-
- if parent == "Warehouses":
+ if is_root:
parent = ""
warehouses = frappe.db.sql("""select name as value,
is_group as expandable
- from `tab{doctype}`
+ from `tabWarehouse`
where docstatus < 2
- and ifnull(`{parent_field}`,'') = %s
+ and ifnull(`parent_warehouse`,'') = %s
and (`company` = %s or company is null or company = '')
- order by name""".format(doctype=frappe.db.escape(doctype),
- parent_field=frappe.db.escape(parent_field)), (parent, company), as_dict=1)
+ order by name""", (parent, company), as_dict=1)
# return warehouses
for wh in warehouses:
diff --git a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json
index ed48a0f..58b1be4 100644
--- a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json
+++ b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json
@@ -1,5 +1,5 @@
{
- "add_total_row": 0,
+ "add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-02-22 18:01:55",
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 3,
"is_standard": "Yes",
- "modified": "2017-09-18 12:28:49.322622",
+ "modified": "2017-11-06 13:05:38.965229",
"modified_by": "Administrator",
"module": "Stock",
"name": "Ordered Items To Be Delivered",
diff --git a/erpnext/support/doctype/issue/issue.js b/erpnext/support/doctype/issue/issue.js
index 306736f..77c59f4 100644
--- a/erpnext/support/doctype/issue/issue.js
+++ b/erpnext/support/doctype/issue/issue.js
@@ -4,7 +4,7 @@
},
"refresh": function(frm) {
- if(frm.doc.status==="Open") {
+ if(frm.doc.status!=="Closed") {
frm.add_custom_button(__("Close"), function() {
frm.set_value("status", "Closed");
frm.save();
diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py
index ab73b34..6a18f11 100644
--- a/erpnext/support/doctype/issue/issue.py
+++ b/erpnext/support/doctype/issue/issue.py
@@ -32,7 +32,7 @@
if email_id:
if not self.lead:
self.lead = frappe.db.get_value("Lead", {"email_id": email_id})
- if not self.contact:
+ if not self.contact and not self.customer:
self.contact = frappe.db.get_value("Contact", {"email_id": email_id})
if self.contact:
diff --git a/erpnext/templates/emails/recurring_document_failed.html b/erpnext/templates/emails/recurring_document_failed.html
index 27c43bc..f9e8c2d 100644
--- a/erpnext/templates/emails/recurring_document_failed.html
+++ b/erpnext/templates/emails/recurring_document_failed.html
@@ -2,8 +2,8 @@
<p>{{_("An error occured while creating recurring")}} {{ type }} <b>{{ name }}</b> {{_("for")}} <b>{{ party }}</b>.</p>
<p>{{_("This could be because of some invalid Email Addresses in the")}} {{ type }}.</p>
-<p>{{_("To stop sending repetitive error notifications from the system, we have checked "Disabled" field in the subscription")}} {{ subscription}} {{_("for the")}} {{ type }} {{ name }}.</p>
-<p><b>{{_("Please correct the")}} {{ type }} {{_('and unchcked "Disabled" in the')}} {{ subscription }} {{_("for making recurring again.")}}</b></p>
+<p>{{_("To stop sending repetitive error notifications from the system, we have checked Disabled field in the subscription")}} {{ subscription}} {{_("for the")}} {{ type }} {{ name }}.</p>
+<p><b>{{_("Please correct the")}} {{ type }} {{_('and unchcked Disabled in the')}} {{ subscription }} {{_("for making recurring again.")}}</b></p>
<hr>
<p><b>{{_("It is necessary to take this action today itself for the above mentioned recurring")}} {{ type }}
{{_('to be generated. If delayed, you will have to manually change the "Repeat on Day of Month" field
diff --git a/erpnext/templates/utils.py b/erpnext/templates/utils.py
index 6ebe411..7ee3960 100644
--- a/erpnext/templates/utils.py
+++ b/erpnext/templates/utils.py
@@ -28,11 +28,12 @@
)).insert(ignore_permissions=True)
opportunity = frappe.get_doc(dict(
- doctype='Opportunity',
+ doctype ='Opportunity',
enquiry_from = 'Customer' if customer else 'Lead',
status = 'Open',
title = subject,
- to_discuss=message
+ contact_email = sender,
+ to_discuss = message
))
if customer:
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
index 4b3c2c5..cbaaf10 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -9,7 +9,7 @@
erpnext/crm/doctype/lead/test_lead.js
erpnext/crm/doctype/opportunity/test_opportunity.js
erpnext/setup/doctype/company/tests/test_company_production.js
-erpnext/crm/doctype/item/test_item.js
+erpnext/stock/doctype/item/tests/test_item.js
erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
erpnext/selling/doctype/quotation/tests/test_quotation_with_item_wise_discount.js
erpnext/selling/doctype/quotation/tests/test_quotation_with_multi_uom.js
@@ -50,8 +50,8 @@
erpnext/schools/doctype/instructor/test_instructor.js
erpnext/stock/doctype/warehouse/test_warehouse.js
erpnext/manufacturing/doctype/production_order/test_production_order.js #long
-erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js
erpnext/accounts/page/pos/test_pos.js
+erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js
erpnext/selling/doctype/product_bundle/test_product_bundle.js
erpnext/stock/doctype/delivery_note/test_delivery_note.js
erpnext/stock/doctype/material_request/tests/test_material_request.js
@@ -72,7 +72,6 @@
erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js
erpnext/hr/doctype/expense_claim/test_expense_claim.js
erpnext/hr/doctype/training_event/tests/test_training_event.js
-erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js
erpnext/hr/doctype/training_result_employee/test_training_result.js
erpnext/hr/doctype/training_feedback/test_training_feedback.js
erpnext/hr/doctype/loan_type/test_loan_type.js
@@ -131,6 +130,7 @@
erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js
erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
erpnext/restaurant/doctype/restaurant/test_restaurant.js
-erpnext/restaurant/doctype/test_restaurant_table/test_restaurant_table.js
+erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.js
erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js
+erpnext/projects/doctype/task/tests/test_task_tree.js
diff --git a/requirements.txt b/requirements.txt
index 0e81b15..0bfd3df 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
frappe
unidecode
+pygithub