Merge pull request #14079 from saurabh6790/TDS_sprint
[fix] calculate withholding only on invoice
diff --git a/erpnext/accounts/doctype/budget_account/budget_account.json b/erpnext/accounts/doctype/budget_account/budget_account.json
index 172e092..ead0761 100644
--- a/erpnext/accounts/doctype/budget_account/budget_account.json
+++ b/erpnext/accounts/doctype/budget_account/budget_account.json
@@ -73,7 +73,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.json b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.json
index e78620e..9da4411 100644
--- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.json
+++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.json
@@ -150,7 +150,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json
index 51da9c0..e9993c3 100644
--- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json
+++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json
@@ -1020,7 +1020,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.json b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.json
index 4e568f1..3eb0d74 100644
--- a/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.json
+++ b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.json
@@ -42,7 +42,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.json b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.json
index 8b03e2e..9609e3d 100644
--- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.json
+++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.json
@@ -109,7 +109,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.json b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.json
index 2340340..14f2d80 100644
--- a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.json
+++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.json
@@ -109,7 +109,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json
index 373d090..8c9fc5e 100644
--- a/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json
+++ b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json
@@ -68,7 +68,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/party_account/party_account.json b/erpnext/accounts/doctype/party_account/party_account.json
index a83bb26..aa32d95 100644
--- a/erpnext/accounts/doctype/party_account/party_account.json
+++ b/erpnext/accounts/doctype/party_account/party_account.json
@@ -66,7 +66,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.json b/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.json
index 10e147e..d69a5eb 100644
--- a/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.json
+++ b/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.json
@@ -93,7 +93,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.json b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.json
index bf18fca..24b366c 100644
--- a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.json
+++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.json
@@ -220,7 +220,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json
index fc4edae..b211b50 100644
--- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json
+++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json
@@ -391,7 +391,7 @@
"icon": "fa fa-resize-horizontal",
"idx": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 1,
"istable": 0,
diff --git a/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.json b/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.json
index ab8761a..ce7ce98 100644
--- a/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.json
+++ b/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.json
@@ -162,7 +162,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json
index 57fce65..ba6f100 100644
--- a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json
+++ b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json
@@ -318,7 +318,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.json b/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.json
index 4f6a675..3ad450b 100644
--- a/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.json
+++ b/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.json
@@ -45,7 +45,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/pos_item_group/pos_item_group.json b/erpnext/accounts/doctype/pos_item_group/pos_item_group.json
index b278765..860c449 100644
--- a/erpnext/accounts/doctype/pos_item_group/pos_item_group.json
+++ b/erpnext/accounts/doctype/pos_item_group/pos_item_group.json
@@ -45,7 +45,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 2788a82..84367de 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -808,4 +808,3 @@
def make_inter_company_sales_invoice(source_name, target_doc=None):
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_inter_company_invoice
return make_inter_company_invoice("Purchase Invoice", source_name, target_doc)
-
diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.json b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.json
index 49582a4..5801b17 100644
--- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.json
+++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.json
@@ -215,7 +215,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.json b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.json
index 50426df..bc42630 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.json
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.json
@@ -217,7 +217,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/accounts/doctype/salary_component_account/salary_component_account.json b/erpnext/accounts/doctype/salary_component_account/salary_component_account.json
index 6ba820e..23dc6c4 100644
--- a/erpnext/accounts/doctype/salary_component_account/salary_component_account.json
+++ b/erpnext/accounts/doctype/salary_component_account/salary_component_account.json
@@ -71,7 +71,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 4789464..4d2e7cc 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -39,7 +39,7 @@
update_multi_mode_option(doc, pos_profile)
default_print_format = pos_profile.get('print_format') or "Point of Sale"
print_template = frappe.db.get_value('Print Format', default_print_format, 'html')
- items_list = get_items_list(pos_profile)
+ items_list = get_items_list(pos_profile, doc.company)
customers = get_customers_list(pos_profile)
return {
@@ -151,25 +151,26 @@
doc.append('taxes', tax)
-def get_items_list(pos_profile):
- cond = "1=1"
- item_groups = []
+def get_items_list(pos_profile, company):
+ cond = ""
+ args_list = [company]
if pos_profile.get('item_groups'):
# Get items based on the item groups defined in the POS profile
for d in pos_profile.get('item_groups'):
- item_groups.extend([d.name for d in get_child_nodes('Item Group', d.item_group)])
- cond = "item_group in (%s)" % (', '.join(['%s'] * len(item_groups)))
+ args_list.extend([d.name for d in get_child_nodes('Item Group', d.item_group)])
+ cond = "and i.item_group in (%s)" % (', '.join(['%s'] * len(args_list)))
return frappe.db.sql("""
select
- name, item_code, item_name, description, item_group, expense_account, has_batch_no,
- has_serial_no, expense_account, selling_cost_center, stock_uom, image,
- default_warehouse, is_stock_item, brand
+ i.name, i.item_code, i.item_name, i.description, i.item_group, i.has_batch_no,
+ i.has_serial_no, i.is_stock_item, i.brand, i.stock_uom, i.image,
+ id.expense_account, id.selling_cost_center, id.default_warehouse
from
- tabItem
+ `tabItem` i, `tabItem Default` id
where
- disabled = 0 and has_variants = 0 and is_sales_item = 1 and {cond}
- """.format(cond=cond), tuple(item_groups), as_dict=1)
+ id.parent = i.name and i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
+ and id.company = %s {cond}
+ """.format(cond=cond), tuple(args_list), as_dict=1)
def get_item_groups(pos_profile):
@@ -531,9 +532,12 @@
item_doc.item_code = item.get('item_code')
item_doc.item_name = item.get('item_name')
item_doc.description = item.get('description')
- item_doc.default_warehouse = item.get('warehouse')
item_doc.stock_uom = item.get('stock_uom')
item_doc.item_group = item.get('item_group')
+ item_doc.append('item_defaults', {
+ "company": doc.get("company"),
+ "default_warehouse": item.get('warehouse')
+ })
item_doc.save(ignore_permissions=True)
frappe.db.commit()
diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.json b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.json
index dbbe368..14bf4d8 100644
--- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.json
+++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.json
@@ -215,7 +215,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json
index a0a6312..50eed24 100644
--- a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json
+++ b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json
@@ -134,7 +134,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.json b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.json
index 894d5ab..29e15d1 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.json
@@ -216,7 +216,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.json b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.json
index a6df2ac..0a06f57 100644
--- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.json
+++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.json
@@ -89,7 +89,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
index fe28fcb..46fd377 100644
--- a/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
+++ b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
@@ -42,7 +42,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index a33f867..f53f924 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -681,23 +681,29 @@
def get_children(doctype, parent, company, is_root=False):
from erpnext.accounts.report.financial_statements import sort_accounts
- parent_fieldname = 'parent_' + doctype.lower().replace(' ', '_')
- fields = [
- 'name as value',
- 'is_group as expandable'
- ]
- filters = [['docstatus', '<', 2]]
+ fieldname = frappe.db.escape(doctype.lower().replace(' ','_'))
+ doctype = frappe.db.escape(doctype)
+
+ # root
if is_root:
- fields += ['root_type', 'report_type', 'account_currency'] if doctype == 'Account' else []
- filters.append([parent_fieldname, '=', ''])
- filters.append(['company', '=', company])
-
+ fields = ", root_type, report_type, account_currency" if doctype=="Account" else ""
+ acc = frappe.db.sql(""" select
+ name as value, is_group as expandable {fields}
+ from `tab{doctype}`
+ where ifnull(`parent_{fieldname}`,'') = ''
+ and `company` = %s and docstatus<2
+ order by name""".format(fields=fields, fieldname = fieldname, doctype=doctype),
+ company, as_dict=1)
else:
- fields += ['account_currency'] if doctype == 'Account' else []
- fields += [parent_fieldname + ' as parent']
-
-
- acc = frappe.get_list(doctype, fields=fields, filters=filters)
+ # other
+ fields = ", account_currency" if doctype=="Account" else ""
+ acc = frappe.db.sql("""select
+ name as value, is_group as expandable, parent_{fieldname} as parent {fields}
+ from `tab{doctype}`
+ where ifnull(`parent_{fieldname}`,'') = %s
+ and docstatus<2
+ order by name""".format(fields=fields, fieldname=fieldname, doctype=doctype),
+ parent, as_dict=1)
if doctype == 'Account':
sort_accounts(acc, is_root, key="value")
diff --git a/erpnext/agriculture/doctype/land_unit/land_unit.py b/erpnext/agriculture/doctype/land_unit/land_unit.py
index 35bda1c..f577eca 100644
--- a/erpnext/agriculture/doctype/land_unit/land_unit.py
+++ b/erpnext/agriculture/doctype/land_unit/land_unit.py
@@ -169,10 +169,11 @@
if is_root:
parent = ''
- land_units = frappe.get_list(doctype,
- fields = ['name as value', 'is_group as expandable'],
- filters= [['parent_land_unit', '=', parent]],
- order_by='name')
+ land_units = frappe.db.sql("""select name as value,
+ is_group as expandable
+ from `tabLand Unit`
+ where ifnull(`parent_land_unit`,'') = %s
+ order by name""", (parent), as_dict=1)
# return nodes
return land_units
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index 5a7573b..846c5b4 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -14,6 +14,7 @@
from erpnext.buying.utils import validate_for_items, check_for_closed_status
from erpnext.stock.utils import get_bin
from six import string_types
+from erpnext.stock.doctype.item.item import get_item_defaults
form_grid_templates = {
"items": "templates/form_grid/item_grid.html"
@@ -374,7 +375,7 @@
target.base_amount = target.amount * flt(source_parent.conversion_rate)
target.qty = target.amount / flt(obj.rate) if (flt(obj.rate) and flt(obj.billed_amt)) else flt(obj.qty)
- item = frappe.db.get_value("Item", target.item_code, ["item_group", "buying_cost_center"], as_dict=1)
+ item = get_item_defaults(target.item_code, target.company)
target.cost_center = frappe.db.get_value("Project", obj.project, "cost_center") \
or item.buying_cost_center \
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
diff --git a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json
index a7ae8a6..6833a4a 100644
--- a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json
+++ b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.json
@@ -715,7 +715,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index fa2436d..13baf6f 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -216,8 +216,9 @@
raw_materials_cost = 0
items = list(set([d.item_code for d in bom_items]))
- item_wh = frappe._dict(frappe.db.sql("""select item_code, default_warehouse
- from `tabItem` where name in ({0})""".format(", ".join(["%s"] * len(items))), items))
+ item_wh = frappe._dict(frappe.db.sql("""select i.item_code, id.default_warehouse
+ from `tabItem` i, `tabItem Default` id where id.company=%s and i.name in ({0})"""
+ .format(", ".join(["%s"] * len(items))), [self.company] + items))
for bom_item in bom_items:
if self.doctype == "Purchase Order":
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index 2a22b32..83e7916 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -340,10 +340,22 @@
def check_active_sales_items(obj):
for d in obj.get("items"):
if d.item_code:
- item = frappe.db.sql("""select docstatus,
- income_account from tabItem where name = %s""",
- d.item_code, as_dict=True)[0]
+ item = frappe.db.sql("""select i.docstatus, id.income_account
+ from `tabItem` i, `tabItem Default` id
+ where i.name=%s and id.parent=i.name and id.company=%s""",
+ (d.item_code,obj.company), as_dict=True)[0]
+ income_account_set = False
if getattr(d, "income_account", None) and not item.income_account:
- frappe.db.set_value("Item", d.item_code, "income_account",
- d.income_account)
+ doc = frappe.get_doc("Item", d.item_code)
+ for default in doc.item_defaults:
+ if default.company == obj.company:
+ default.income_account = d.income_account
+ income_account_set = True
+ break
+ if not income_account_set:
+ doc.append("item_defaults", {
+ "company": obj.company,
+ "income_account": d.income_account
+ })
+ doc.save()
\ No newline at end of file
diff --git a/erpnext/crm/doctype/opportunity_item/opportunity_item.json b/erpnext/crm/doctype/opportunity_item/opportunity_item.json
index 0845d42..ee7c1e3 100644
--- a/erpnext/crm/doctype/opportunity_item/opportunity_item.json
+++ b/erpnext/crm/doctype/opportunity_item/opportunity_item.json
@@ -407,7 +407,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/demo/data/item.json b/erpnext/demo/data/item.json
index 6974b94..908de15 100644
--- a/erpnext/demo/data/item.json
+++ b/erpnext/demo/data/item.json
@@ -1,7 +1,9 @@
[
{
"default_supplier": "Asiatic Solutions",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "For Upper Bearing",
"image": "/assets/erpnext_demo/images/disc.png",
"item_code": "Disc Collars",
@@ -10,7 +12,9 @@
},
{
"default_supplier": "Nan Duskin",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "CAST IRON, MCMASTER PART NO. 3710T13",
"image": "/assets/erpnext_demo/images/bearing.jpg",
"item_code": "Bearing Block",
@@ -19,7 +23,9 @@
},
{
"default_supplier": null,
- "default_warehouse": "Finished Goods",
+ "item_defaults": [{
+ "default_warehouse": "Finished Goods"
+ }],
"description": "Wind Mill C Series for Commercial Use 18ft",
"image": "/assets/erpnext_demo/images/wind-turbine-2.png",
"item_code": "Wind MIll C Series",
@@ -28,7 +34,9 @@
},
{
"default_supplier": null,
- "default_warehouse": "Finished Goods",
+ "item_defaults": [{
+ "default_warehouse": "Finished Goods"
+ }],
"description": "Wind Mill A Series for Home Use 9ft",
"image": "/assets/erpnext_demo/images/wind-turbine.png",
"item_code": "Wind Mill A Series",
@@ -37,7 +45,9 @@
},
{
"default_supplier": null,
- "default_warehouse": "Finished Goods",
+ "item_defaults": [{
+ "default_warehouse": "Finished Goods"
+ }],
"description": "Small Wind Turbine for Home Use\n\n\n<!-- html -->",
"image": "/assets/erpnext_demo/images/wind-turbine-1.jpg",
"item_code": "Wind Turbine",
@@ -51,7 +61,9 @@
},
{
"default_supplier": "HomeBase",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "1.5 in. Diameter x 36 in. Mild Steel Tubing",
"image": null,
"item_code": "Bearing Pipe",
@@ -60,7 +72,9 @@
},
{
"default_supplier": "New World Realty",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet",
"image": null,
"item_code": "Wing Sheet",
@@ -69,7 +83,9 @@
},
{
"default_supplier": "Eagle Hardware",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate",
"image": null,
"item_code": "Upper Bearing Plate",
@@ -78,7 +94,9 @@
},
{
"default_supplier": "Asiatic Solutions",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "Bearing Assembly",
"image": null,
"item_code": "Bearing Assembly",
@@ -87,7 +105,9 @@
},
{
"default_supplier": "HomeBase",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "3/4 in. x 2 ft. x 4 ft. Pine Plywood",
"image": null,
"item_code": "Base Plate",
@@ -97,7 +117,9 @@
},
{
"default_supplier": "Scott Ties",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "N/A",
"image": null,
"item_code": "Stand",
@@ -106,7 +128,9 @@
},
{
"default_supplier": "Eagle Hardware",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar",
"image": null,
"item_code": "Bearing Collar",
@@ -115,7 +139,9 @@
},
{
"default_supplier": "Eagle Hardware",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "1/4 in. x 6 in. x 6 in. Mild Steel Plate",
"image": null,
"item_code": "Base Bearing Plate",
@@ -124,7 +150,9 @@
},
{
"default_supplier": "HomeBase",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing",
"image": null,
"item_code": "External Disc",
@@ -133,7 +161,9 @@
},
{
"default_supplier": "Eagle Hardware",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "1.25 in. Diameter x 6 ft. Mild Steel Tubing",
"image": null,
"item_code": "Shaft",
@@ -142,7 +172,9 @@
},
{
"default_supplier": "Ks Merchandise",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "1/2 in. x 2 ft. x 4 ft. Pine Plywood",
"image": null,
"item_code": "Blade Rib",
@@ -151,7 +183,9 @@
},
{
"default_supplier": "HomeBase",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "For Bearing Collar",
"image": null,
"item_code": "Internal Disc",
@@ -160,7 +194,9 @@
},
{
"default_supplier": null,
- "default_warehouse": "Finished Goods",
+ "item_defaults": [{
+ "default_warehouse": "Finished Goods"
+ }],
"description": "Small Wind Turbine for Home Use\n\n\n<!-- html -->\n<p>Size: Small</p>",
"image": "/assets/erpnext_demo/images/wind-turbine-1.jpg",
"item_code": "Wind Turbine-S",
@@ -177,7 +213,9 @@
},
{
"default_supplier": null,
- "default_warehouse": "Finished Goods",
+ "item_defaults": [{
+ "default_warehouse": "Finished Goods"
+ }],
"description": "Small Wind Turbine for Home Use\n\n\n<!-- html -->\n<p>Size: Medium</p>",
"image": "/assets/erpnext_demo/images/wind-turbine-1.jpg",
"item_code": "Wind Turbine-M",
@@ -194,7 +232,9 @@
},
{
"default_supplier": null,
- "default_warehouse": "Finished Goods",
+ "item_defaults": [{
+ "default_warehouse": "Finished Goods"
+ }],
"description": "Small Wind Turbine for Home Use\n\n\n<!-- html -->\n<p>Size: Large</p>",
"image": "/assets/erpnext_demo/images/wind-turbine-1.jpg",
"item_code": "Wind Turbine-L",
@@ -218,7 +258,9 @@
},
{
"default_supplier": "HomeBase",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "3/4 in. x 2 ft. x 4 ft. Pine Plywood",
"image": null,
"item_code": "Base Plate Un Painted",
@@ -284,7 +326,9 @@
"has_batch_no": 1,
"create_new_batch": 1,
"valuation_rate": 200,
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores"
+ }],
"description": "Corrugated Box",
"item_code": "Corrugated Box",
"item_name": "Corrugated Box",
diff --git a/erpnext/demo/data/item_education.json b/erpnext/demo/data/item_education.json
index 077fcaa..40e4701 100644
--- a/erpnext/demo/data/item_education.json
+++ b/erpnext/demo/data/item_education.json
@@ -1,63 +1,90 @@
[
{
"default_supplier": "Asiatic Solutions",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Books",
"item_group": "Raw Material",
"item_name": "Books"
},
{
"default_supplier": "HomeBase",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Pencil",
"item_group": "Raw Material",
"item_name": "Pencil"
},
{
"default_supplier": "New World Realty",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Tables",
"item_group": "Raw Material",
"item_name": "Tables"
},
{
"default_supplier": "Eagle Hardware",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Chair",
"item_group": "Raw Material",
"item_name": "Chair"
},
{
"default_supplier": "Asiatic Solutions",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Black Board",
"item_group": "Sub Assemblies",
"item_name": "Black Board"
},
{
"default_supplier": "HomeBase",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Chalk",
"item_group": "Raw Material",
"item_name": "Chalk"
},
{
"default_supplier": "HomeBase",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Notepad",
"item_group": "Raw Material",
"item_name": "Notepad"
},
{
"default_supplier": "Ks Merchandise",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Uniform",
"item_group": "Raw Material",
"item_name": "Uniform"
},
{
"is_stock_item": 0,
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"description": "Computer",
"item_code": "Computer",
"item_name": "Computer",
@@ -65,7 +92,10 @@
},
{
"is_stock_item": 0,
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"description": "Mobile",
"item_code": "Mobile",
"item_name": "Mobile",
@@ -73,7 +103,10 @@
},
{
"is_stock_item": 0,
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"description": "ERP",
"item_code": "ERP",
"item_name": "ERP",
@@ -81,15 +114,20 @@
},
{
"is_stock_item": 0,
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"description": "Autocad",
"item_code": "Autocad",
"item_name": "Autocad",
"item_group": "All Item Groups"
},
{
- "default_warehouse": "Stores",
- "default_warehouse": "Stores",
+ "item_defaults": [{
+ "default_warehouse": "Stores",
+ "company": "Whitmore College"
+ }],
"item_code": "Service",
"item_group": "Services",
"item_name": "Service",
diff --git a/erpnext/demo/setup/education.py b/erpnext/demo/setup/education.py
index 2a894f7..0403c06 100644
--- a/erpnext/demo/setup/education.py
+++ b/erpnext/demo/setup/education.py
@@ -36,7 +36,8 @@
item = frappe.new_doc('Item')
item.update(i)
item.min_order_qty = random.randint(10, 30)
- item.default_warehouse = frappe.get_all('Warehouse', filters={'warehouse_name': item.default_warehouse}, limit=1)[0].name
+ item.item_defaults[0].default_warehouse = frappe.get_all('Warehouse',
+ filters={'warehouse_name': item.item_defaults[0].default_warehouse}, limit=1)[0].name
item.insert()
def make_student_applicants():
diff --git a/erpnext/demo/setup/manufacture.py b/erpnext/demo/setup/manufacture.py
index 4d8c450..4db510a 100644
--- a/erpnext/demo/setup/manufacture.py
+++ b/erpnext/demo/setup/manufacture.py
@@ -4,6 +4,7 @@
import frappe
from frappe.utils import nowdate, add_days
from erpnext.demo.setup.setup_data import import_json
+from erpnext.demo.domains import data
from six import iteritems
@@ -65,10 +66,11 @@
for i in items:
item = frappe.new_doc('Item')
item.update(i)
- if item.default_warehouse:
- warehouse = frappe.get_all('Warehouse', filters={'warehouse_name': item.default_warehouse}, limit=1)
+ if item.item_defaults[0].default_warehouse:
+ item.item_defaults[0].company = data.get("Manufacturing").get('company_name')
+ warehouse = frappe.get_all('Warehouse', filters={'warehouse_name': item.item_defaults[0].default_warehouse}, limit=1)
if warehouse:
- item.default_warehouse = warehouse[0].name
+ item.item_defaults[0].default_warehouse = warehouse[0].name
item.insert()
def setup_product_bundle():
diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json
index 49fe105..f22969b 100644
--- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json
+++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json
@@ -202,7 +202,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.json b/erpnext/hr/doctype/appraisal_template/appraisal_template.json
index 97402ac..ac6e400 100644
--- a/erpnext/hr/doctype/appraisal_template/appraisal_template.json
+++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.json
@@ -108,7 +108,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json
index d11ec64..34ea5d8 100644
--- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json
+++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json
@@ -73,7 +73,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/branch/branch.json b/erpnext/hr/doctype/branch/branch.json
index 609456c..221b522 100644
--- a/erpnext/hr/doctype/branch/branch.json
+++ b/erpnext/hr/doctype/branch/branch.json
@@ -44,7 +44,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/department/test_records.json b/erpnext/hr/doctype/department/test_records.json
index 5bb5871..654925e 100644
--- a/erpnext/hr/doctype/department/test_records.json
+++ b/erpnext/hr/doctype/department/test_records.json
@@ -1,4 +1,4 @@
[
- {"doctype":"Department", "department_name":"_Test Department"},
- {"doctype":"Department", "department_name":"_Test Department 1"}
+ {"doctype":"Department", "department_name":"_Test Department", "company": "_Test Company"},
+ {"doctype":"Department", "department_name":"_Test Department 1", "company": "_Test Company"}
]
\ No newline at end of file
diff --git a/erpnext/hr/doctype/designation/designation.json b/erpnext/hr/doctype/designation/designation.json
index 9315cfd..1d4a3cf 100644
--- a/erpnext/hr/doctype/designation/designation.json
+++ b/erpnext/hr/doctype/designation/designation.json
@@ -77,7 +77,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 93f6532..824ddf5 100755
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -318,26 +318,26 @@
@frappe.whitelist()
def get_children(doctype, parent=None, company=None, is_root=False, is_tree=False):
- filters = [['company', '=', company]]
- fields = ['name as value', 'employee_name as title']
+ condition = ''
if is_root:
- parent = ''
+ parent = ""
if parent and company and parent!=company:
- filters.append(['reports_to', '=', parent])
+ condition = ' and reports_to = "{0}"'.format(frappe.db.escape(parent))
else:
- filters.append(['reports_to', '=', ''])
+ condition = ' and ifnull(reports_to, "")=""'
- employees = frappe.get_list(doctype, fields=fields,
- filters=filters, order_by='name')
+ employee = frappe.db.sql("""
+ select
+ name as value, employee_name as title,
+ exists(select name from `tabEmployee` where reports_to=emp.name) as expandable
+ from
+ `tabEmployee` emp
+ where company='{company}' {condition} order by name"""
+ .format(company=company, condition=condition), as_dict=1)
- for employee in employees:
- is_expandable = frappe.get_all(doctype, filters=[
- ['reports_to', '=', employee.get('value')]
- ])
- employee.expandable = 1 if is_expandable else 0
-
- return employees
+ # return employee
+ return employee
def on_doctype_update():
diff --git a/erpnext/hr/doctype/employee/test_records.json b/erpnext/hr/doctype/employee/test_records.json
index 087265f..0bfd2aa 100644
--- a/erpnext/hr/doctype/employee/test_records.json
+++ b/erpnext/hr/doctype/employee/test_records.json
@@ -3,7 +3,7 @@
"company": "_Test Company",
"date_of_birth": "1980-01-01",
"date_of_joining": "2010-01-01",
- "department": "_Test Department",
+ "department": "_Test Department - _TC",
"doctype": "Employee",
"employee_name": "_Test Employee",
"gender": "Female",
@@ -15,7 +15,7 @@
"company": "_Test Company",
"date_of_birth": "1980-01-01",
"date_of_joining": "2010-01-01",
- "department": "_Test Department 1",
+ "department": "_Test Department 1 - _TC",
"doctype": "Employee",
"employee_name": "_Test Employee 1",
"gender": "Male",
@@ -27,7 +27,7 @@
"company": "_Test Company",
"date_of_birth": "1980-01-01",
"date_of_joining": "2010-01-01",
- "department": "_Test Department 1",
+ "department": "_Test Department 1 - _TC",
"doctype": "Employee",
"employee_name": "_Test Employee 2",
"gender": "Male",
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.json b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.json
index f31bcf8..256e056 100644
--- a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.json
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.json
@@ -235,7 +235,7 @@
"hide_toolbar": 1,
"idx": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 1,
"istable": 0,
diff --git a/erpnext/hr/doctype/employee_education/employee_education.json b/erpnext/hr/doctype/employee_education/employee_education.json
index e41c6ca..ef216e3 100644
--- a/erpnext/hr/doctype/employee_education/employee_education.json
+++ b/erpnext/hr/doctype/employee_education/employee_education.json
@@ -174,7 +174,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.json b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.json
index fcabbbc..f357b20 100644
--- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.json
+++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.json
@@ -172,7 +172,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.json b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.json
index 3d277af..98632b6 100644
--- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.json
+++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.json
@@ -148,7 +148,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/employee_onboarding/employee_onboarding.json b/erpnext/hr/doctype/employee_onboarding/employee_onboarding.json
index bd2ec4c..257ee32 100644
--- a/erpnext/hr/doctype/employee_onboarding/employee_onboarding.json
+++ b/erpnext/hr/doctype/employee_onboarding/employee_onboarding.json
@@ -19,38 +19,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "employee_name",
- "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": "Employee 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employee",
+ "fieldname": "job_applicant",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -59,18 +28,18 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Employee",
+ "label": "Job Applicant",
"length": 0,
"no_copy": 0,
- "options": "Employee",
+ "options": "Job Applicant",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 1,
+ "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
@@ -114,19 +83,19 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "job_applicant",
- "fieldtype": "Link",
+ "fieldname": "employee_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_list_view": 1,
"in_standard_filter": 0,
- "label": "Job Applicant",
+ "label": "Employee Name",
"length": 0,
"no_copy": 0,
- "options": "Job Applicant",
+ "options": "job_applicant.applicant_name",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -146,6 +115,38 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "employee",
+ "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": "Employee",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Employee",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "date_of_joining",
"fieldtype": "Date",
"hidden": 0,
@@ -530,7 +531,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-05-10 06:34:21.103617",
+ "modified": "2018-05-16 05:01:09.897011",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Onboarding",
@@ -557,7 +558,7 @@
"write": 1
}
],
- "quick_entry": 1,
+ "quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
diff --git a/erpnext/hr/doctype/employment_type/employment_type.json b/erpnext/hr/doctype/employment_type/employment_type.json
index da84ce4..9dcae3c 100644
--- a/erpnext/hr/doctype/employment_type/employment_type.json
+++ b/erpnext/hr/doctype/employment_type/employment_type.json
@@ -48,7 +48,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/expense_claim_account/expense_claim_account.json b/erpnext/hr/doctype/expense_claim_account/expense_claim_account.json
index a2bbe0b..c7d71d3 100644
--- a/erpnext/hr/doctype/expense_claim_account/expense_claim_account.json
+++ b/erpnext/hr/doctype/expense_claim_account/expense_claim_account.json
@@ -68,7 +68,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.json b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.json
index f59111a..b60ba5f 100644
--- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.json
+++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.json
@@ -101,7 +101,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/holiday/holiday.json b/erpnext/hr/doctype/holiday/holiday.json
index cc65631..6498530 100644
--- a/erpnext/hr/doctype/holiday/holiday.json
+++ b/erpnext/hr/doctype/holiday/holiday.json
@@ -68,7 +68,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/identification_document_type/__init__.py b/erpnext/hr/doctype/identification_document_type/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/doctype/identification_document_type/__init__.py
diff --git a/erpnext/hr/doctype/identification_document_type/identification_document_type.js b/erpnext/hr/doctype/identification_document_type/identification_document_type.js
new file mode 100644
index 0000000..351cf9d
--- /dev/null
+++ b/erpnext/hr/doctype/identification_document_type/identification_document_type.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Identification Document Type', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/hr/doctype/identification_document_type/identification_document_type.json b/erpnext/hr/doctype/identification_document_type/identification_document_type.json
new file mode 100644
index 0000000..33cbde7
--- /dev/null
+++ b/erpnext/hr/doctype/identification_document_type/identification_document_type.json
@@ -0,0 +1,93 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:identification_document_type",
+ "beta": 0,
+ "creation": "2018-05-15 07:13:28.620570",
+ "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": "identification_document_type",
+ "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": "Identification Document Type",
+ "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,
+ "translatable": 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": "2018-05-16 04:34:00.448680",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Identification Document Type",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 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": 0,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/identification_document_type/identification_document_type.py b/erpnext/hr/doctype/identification_document_type/identification_document_type.py
new file mode 100644
index 0000000..d9d81d2
--- /dev/null
+++ b/erpnext/hr/doctype/identification_document_type/identification_document_type.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class IdentificationDocumentType(Document):
+ pass
diff --git a/erpnext/hr/doctype/identification_document_type/test_identification_document_type.js b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.js
new file mode 100644
index 0000000..6587909
--- /dev/null
+++ b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Identification Document Type", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Identification Document Type
+ () => frappe.tests.make('Identification Document Type', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py
new file mode 100644
index 0000000..1265afa
--- /dev/null
+++ b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestIdentificationDocumentType(unittest.TestCase):
+ pass
diff --git a/erpnext/hr/doctype/interest/interest.json b/erpnext/hr/doctype/interest/interest.json
index 955c40f..d6d2342 100644
--- a/erpnext/hr/doctype/interest/interest.json
+++ b/erpnext/hr/doctype/interest/interest.json
@@ -42,7 +42,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.json b/erpnext/hr/doctype/job_applicant/job_applicant.json
index 2a97f28..dc8d82c 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.json
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.json
@@ -249,7 +249,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py
index b467350..9b02559 100644
--- a/erpnext/hr/doctype/leave_application/test_leave_application.py
+++ b/erpnext/hr/doctype/leave_application/test_leave_application.py
@@ -71,7 +71,7 @@
add_role("test1@example.com", "Leave Approver")
clear_user_permissions_for_doctype("Employee")
- frappe.db.set_value("Department", "_Test Department",
+ frappe.db.set_value("Department", "_Test Department - _TC",
"leave_block_list", "_Test Leave Block List")
make_allocation_record()
@@ -214,7 +214,7 @@
frappe.db.set_value("Leave Block List", "_Test Leave Block List",
"applies_to_all_departments", 1)
frappe.db.set_value("Employee", "_T-Employee-00002", "department",
- "_Test Department")
+ "_Test Department - _TC")
frappe.set_user("test1@example.com")
application.insert()
diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.json b/erpnext/hr/doctype/leave_block_list/leave_block_list.json
index 16dbda8..fdb975b 100644
--- a/erpnext/hr/doctype/leave_block_list/leave_block_list.json
+++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.json
@@ -207,7 +207,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
index 3abe406..0eb69a5 100644
--- a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
+++ b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py
@@ -14,20 +14,20 @@
def test_get_applicable_block_dates(self):
frappe.set_user("test@example.com")
- frappe.db.set_value("Department", "_Test Department", "leave_block_list",
+ frappe.db.set_value("Department", "_Test Department - _TC", "leave_block_list",
"_Test Leave Block List")
self.assertTrue(getdate("2013-01-02") in
[d.block_date for d in get_applicable_block_dates("2013-01-01", "2013-01-03")])
def test_get_applicable_block_dates_for_allowed_user(self):
frappe.set_user("test1@example.com")
- frappe.db.set_value("Department", "_Test Department 1", "leave_block_list",
+ frappe.db.set_value("Department", "_Test Department 1 - _TC", "leave_block_list",
"_Test Leave Block List")
self.assertEqual([], [d.block_date for d in get_applicable_block_dates("2013-01-01", "2013-01-03")])
def test_get_applicable_block_dates_all_lists(self):
frappe.set_user("test1@example.com")
- frappe.db.set_value("Department", "_Test Department 1", "leave_block_list",
+ frappe.db.set_value("Department", "_Test Department 1 - _TC", "leave_block_list",
"_Test Leave Block List")
self.assertTrue(getdate("2013-01-02") in
[d.block_date for d in get_applicable_block_dates("2013-01-01", "2013-01-03", all_lists=True)])
diff --git a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.json b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.json
index fbc2991..fe10c78 100644
--- a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.json
+++ b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.json
@@ -42,7 +42,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.json b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.json
index 1d0ac01..dbb9039 100644
--- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.json
+++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.json
@@ -67,7 +67,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/offer_term/offer_term.json b/erpnext/hr/doctype/offer_term/offer_term.json
index cb059a1..3b7bd42 100644
--- a/erpnext/hr/doctype/offer_term/offer_term.json
+++ b/erpnext/hr/doctype/offer_term/offer_term.json
@@ -42,7 +42,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/purpose_of_travel/__init__.py b/erpnext/hr/doctype/purpose_of_travel/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/doctype/purpose_of_travel/__init__.py
diff --git a/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.js b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.js
new file mode 100644
index 0000000..a9424d6
--- /dev/null
+++ b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Purpose of Travel', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.json b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.json
new file mode 100644
index 0000000..68d2d6b
--- /dev/null
+++ b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.json
@@ -0,0 +1,93 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:purpose_of_travel",
+ "beta": 0,
+ "creation": "2018-05-15 07:00:30.933908",
+ "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": "purpose_of_travel",
+ "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": "Purpose of Travel",
+ "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,
+ "translatable": 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": "2018-05-15 07:05:26.219209",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Purpose of Travel",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 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": 0,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py
new file mode 100644
index 0000000..62f62a5
--- /dev/null
+++ b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class PurposeofTravel(Document):
+ pass
diff --git a/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.js b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.js
new file mode 100644
index 0000000..936c21c
--- /dev/null
+++ b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Purpose of Travel", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Purpose of Travel
+ () => frappe.tests.make('Purpose of Travel', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py
new file mode 100644
index 0000000..ccd950d
--- /dev/null
+++ b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestPurposeofTravel(unittest.TestCase):
+ pass
diff --git a/erpnext/hr/doctype/retention_bonus/retention_bonus.json b/erpnext/hr/doctype/retention_bonus/retention_bonus.json
index b21d309..c1f46e5 100644
--- a/erpnext/hr/doctype/retention_bonus/retention_bonus.json
+++ b/erpnext/hr/doctype/retention_bonus/retention_bonus.json
@@ -178,6 +178,37 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "bonus_amount",
+ "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": "Bonus Amount",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
@@ -214,7 +245,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-05-13 15:00:55.913521",
+ "modified": "2018-05-16 05:20:19.226522",
"modified_by": "Administrator",
"module": "HR",
"name": "Retention Bonus",
diff --git a/erpnext/hr/doctype/salary_component/salary_component.json b/erpnext/hr/doctype/salary_component/salary_component.json
index f08b1d7..cf85af4 100644
--- a/erpnext/hr/doctype/salary_component/salary_component.json
+++ b/erpnext/hr/doctype/salary_component/salary_component.json
@@ -114,6 +114,70 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "eval:doc.type==\"Earning\"",
+ "fieldname": "is_tax_applicable",
+ "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 Tax Applicable",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "is_payable",
+ "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 Payable",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
@@ -554,6 +618,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "is_payable",
"fieldname": "section_break_5",
"fieldtype": "Section Break",
"hidden": 0,
@@ -924,320 +989,6 @@
"set_only_once": 0,
"translatable": 0,
"unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "condition_and_formula",
- "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": "Condition and Formula",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "condition",
- "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": "Condition",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "If selected, the value specified or calculated in this component will not contribute to the earnings or deductions. However, it's value can be referenced by other components that can be added or deducted. ",
- "fieldname": "statistical_component",
- "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": "Statistical Component",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "depends_on_lwp",
- "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": "Depends on Leave Without Pay",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "do_not_include_in_total",
- "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 include in total",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "1",
- "fieldname": "amount_based_on_formula",
- "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": "Amount based on formula",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.amount_based_on_formula!==0",
- "fieldname": "formula",
- "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": "Formula",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.amount_based_on_formula!==1",
- "fieldname": "amount",
- "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": "Amount",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_28",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "help",
- "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": "Help",
- "length": 0,
- "no_copy": 0,
- "options": "<h3>Help</h3>\n\n<p>Notes:</p>\n\n<ol>\n<li>Use field <code>base</code> for using base salary of the Employee</li>\n<li>Use Salary Component abbreviations in conditions and formulas. <code>BS = Basic Salary</code></li>\n<li>Use field name for employee details in conditions and formulas. <code>Employment Type = employment_type</code><code>Branch = branch</code></li>\n<li>Use field name from Salary Slip in conditions and formulas. <code>Payment Days = payment_days</code><code>Leave without pay = leave_without_pay</code></li>\n<li>Direct Amount can also be entered based on Condtion. See example 3</li></ol>\n\n<h4>Examples</h4>\n<ol>\n<li>Calculating Basic Salary based on <code>base</code>\n<pre><code>Condition: base < 10000</code></pre>\n<pre><code>Formula: base * .2</code></pre></li>\n<li>Calculating HRA based on Basic Salary<code>BS</code> \n<pre><code>Condition: BS > 2000</code></pre>\n<pre><code>Formula: BS * .1</code></pre></li>\n<li>Calculating TDS based on Employment Type<code>employment_type</code> \n<pre><code>Condition: employment_type==\"Intern\"</code></pre>\n<pre><code>Amount: 1000</code></pre></li>\n</ol>",
- "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,
- "translatable": 0,
- "unique": 0
}
],
"has_web_view": 0,
@@ -1251,7 +1002,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-05-09 17:35:11.073733",
+ "modified": "2018-05-16 12:15:43.117948",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Component",
@@ -1286,4 +1037,4 @@
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0
-}
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json b/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json
index 52f829e..7a9393c 100644
--- a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json
+++ b/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json
@@ -67,7 +67,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/salary_structure_employee/salary_structure_employee.json b/erpnext/hr/doctype/salary_structure_employee/salary_structure_employee.json
index 0e238d3..6c7a61c 100644
--- a/erpnext/hr/doctype/salary_structure_employee/salary_structure_employee.json
+++ b/erpnext/hr/doctype/salary_structure_employee/salary_structure_employee.json
@@ -194,7 +194,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/training_feedback/training_feedback.json b/erpnext/hr/doctype/training_feedback/training_feedback.json
index ece6ed1..80c1005 100644
--- a/erpnext/hr/doctype/training_feedback/training_feedback.json
+++ b/erpnext/hr/doctype/training_feedback/training_feedback.json
@@ -309,7 +309,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 1,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/hr/doctype/training_result_employee/training_result_employee.json b/erpnext/hr/doctype/training_result_employee/training_result_employee.json
index 477a8e6..c5e791a 100644
--- a/erpnext/hr/doctype/training_result_employee/training_result_employee.json
+++ b/erpnext/hr/doctype/training_result_employee/training_result_employee.json
@@ -233,7 +233,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/hr/doctype/travel_itinerary/__init__.py b/erpnext/hr/doctype/travel_itinerary/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/doctype/travel_itinerary/__init__.py
diff --git a/erpnext/hr/doctype/travel_itinerary/travel_itinerary.json b/erpnext/hr/doctype/travel_itinerary/travel_itinerary.json
new file mode 100644
index 0000000..f887027
--- /dev/null
+++ b/erpnext/hr/doctype/travel_itinerary/travel_itinerary.json
@@ -0,0 +1,512 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-05-15 07:40:59.181192",
+ "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": "travel_from",
+ "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": "Travel From",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "travel_to",
+ "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": "Travel To",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "mode_of_travel",
+ "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": "Mode of Travel",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nFlight\nTrain\nTaxi\nRented Car",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "meal_preference",
+ "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": "Meal Preference",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nVegetarian\nNon-Vegetarian\nGluten Free\nNon Diary",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "travel_advance_required",
+ "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": "Travel Advance Required",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "travel_advance_required",
+ "fieldname": "advance_amount",
+ "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": "Advance Amount",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_6",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "departure_date",
+ "fieldtype": "Datetime",
+ "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": "Departure Datetime",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "arrival_date",
+ "fieldtype": "Datetime",
+ "hidden": 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": "Arrival Datetime",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "lodging_required",
+ "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": "Lodging Required",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "lodging_required",
+ "fieldname": "preferred_area_for_lodging",
+ "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": "Preferred Area for Lodging",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "lodging_required",
+ "fieldname": "check_in_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": "Check-in 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "lodging_required",
+ "fieldname": "check_out_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": "Check-out 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_14",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "other_details",
+ "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": "Other 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,
+ "translatable": 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": 1,
+ "max_attachments": 0,
+ "modified": "2018-05-15 09:55:20.138108",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Travel Itinerary",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "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/hr/doctype/travel_itinerary/travel_itinerary.py b/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py
new file mode 100644
index 0000000..0b369be
--- /dev/null
+++ b/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class TravelItinerary(Document):
+ pass
diff --git a/erpnext/hr/doctype/travel_request/__init__.py b/erpnext/hr/doctype/travel_request/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request/__init__.py
diff --git a/erpnext/hr/doctype/travel_request/test_travel_request.js b/erpnext/hr/doctype/travel_request/test_travel_request.js
new file mode 100644
index 0000000..7e64591
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request/test_travel_request.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Travel Request", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Travel Request
+ () => frappe.tests.make('Travel Request', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/hr/doctype/travel_request/test_travel_request.py b/erpnext/hr/doctype/travel_request/test_travel_request.py
new file mode 100644
index 0000000..dac5517
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request/test_travel_request.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestTravelRequest(unittest.TestCase):
+ pass
diff --git a/erpnext/hr/doctype/travel_request/travel_request.js b/erpnext/hr/doctype/travel_request/travel_request.js
new file mode 100644
index 0000000..9dd48eb
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request/travel_request.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Travel Request', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/hr/doctype/travel_request/travel_request.json b/erpnext/hr/doctype/travel_request/travel_request.json
new file mode 100644
index 0000000..2f22bbc
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request/travel_request.json
@@ -0,0 +1,909 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "TRQ.#####",
+ "beta": 0,
+ "creation": "2018-05-15 06:32:33.950356",
+ "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": "travel_type",
+ "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": "Travel Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nDomestic\nInternational",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "travel_funding",
+ "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": "Travel Funding",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nRequire Full Funding\nFully Sponsored\nPartially Sponsored, Require Partial Funding",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "travel_proof",
+ "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": "Copy of Invitation/Announcement",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_2",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "purpose_of_travel",
+ "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": "Purpose of Travel",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Purpose of Travel",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "details_of_sponsor",
+ "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": "Details of Sponsor (Name, Location)",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "section_break_4",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "description",
+ "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": "Any other 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "employee_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": "Employee 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "employee",
+ "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": "Employee",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Employee",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "employee_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": "Employee Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "employee.employee_name",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "cell_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,
+ "options": "employee.cell_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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "prefered_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": "Contact Email",
+ "length": 0,
+ "no_copy": 0,
+ "options": "employee.prefered_email",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_7",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "date_of_birth",
+ "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": "Date of Birth",
+ "length": 0,
+ "no_copy": 0,
+ "options": "employee.date_of_birth",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "personal_id_type",
+ "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": "Identification Document Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Identification Document Type",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "personal_id_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": "Identification Document 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "passport_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": "Passport Number",
+ "length": 0,
+ "no_copy": 0,
+ "options": "employee.passport_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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "travel_itinerary",
+ "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": "Travel Itinerary",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "itinerary",
+ "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,
+ "length": 0,
+ "no_copy": 0,
+ "options": "Travel Itinerary",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "costing_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": "Costing 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "cost_center",
+ "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": "Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Cost Center",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "costings",
+ "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": "Costing",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Travel Request Costing",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "event_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": "Event 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "name_of_organizer",
+ "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": "Name of Organizer",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "address_of_organizer",
+ "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": "Address of Organizer",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "other_details",
+ "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": "Other 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,
+ "translatable": 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": "2018-05-16 04:35:56.819570",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Travel Request",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 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": 0,
+ "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/hr/doctype/travel_request/travel_request.py b/erpnext/hr/doctype/travel_request/travel_request.py
new file mode 100644
index 0000000..01d3f34
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request/travel_request.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class TravelRequest(Document):
+ pass
diff --git a/erpnext/hr/doctype/travel_request_costing/__init__.py b/erpnext/hr/doctype/travel_request_costing/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request_costing/__init__.py
diff --git a/erpnext/hr/doctype/travel_request_costing/travel_request_costing.json b/erpnext/hr/doctype/travel_request_costing/travel_request_costing.json
new file mode 100644
index 0000000..b64b1a9
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request_costing/travel_request_costing.json
@@ -0,0 +1,257 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-05-15 10:28:37.429581",
+ "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": "expense_type",
+ "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": "Expense Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Expense Claim Type",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_2",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "sponsored_amount",
+ "fieldtype": "Currency",
+ "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": "Sponsored Amount",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "funded_amount",
+ "fieldtype": "Currency",
+ "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": "Funded Amount",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "total_amount",
+ "fieldtype": "Currency",
+ "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": "Total Amount",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_4",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "comments",
+ "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": "Comments",
+ "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,
+ "translatable": 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": 1,
+ "max_attachments": 0,
+ "modified": "2018-05-15 10:42:07.960530",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Travel Request Costing",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "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/hr/doctype/travel_request_costing/travel_request_costing.py b/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py
new file mode 100644
index 0000000..9fa85e8
--- /dev/null
+++ b/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class TravelRequestCosting(Document):
+ pass
diff --git a/erpnext/hr/doctype/vehicle_service/vehicle_service.json b/erpnext/hr/doctype/vehicle_service/vehicle_service.json
index 635a0b6..7d9d0df 100644
--- a/erpnext/hr/doctype/vehicle_service/vehicle_service.json
+++ b/erpnext/hr/doctype/vehicle_service/vehicle_service.json
@@ -131,7 +131,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json b/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json
index 0a74436..7cd3086 100644
--- a/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json
+++ b/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json
@@ -202,7 +202,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json b/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json
index e55f562..d2a0ffa 100644
--- a/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json
+++ b/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json
@@ -328,7 +328,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 559bbdf..bbf8f71 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -544,14 +544,16 @@
item.image,
item.stock_uom,
item.allow_alternative_item,
- item.default_warehouse,
- item.expense_account as expense_account,
- item.buying_cost_center as cost_center
+ item_default.default_warehouse,
+ item_default.expense_account as expense_account,
+ item_default.buying_cost_center as cost_center
{select_columns}
from
- `tab{table}` bom_item, `tabBOM` bom, `tabItem` item
+ `tab{table}` bom_item, `tabBOM` bom, `tabItem` item, `tabItem Default` item_default
where
bom_item.docstatus < 2
+ and item_default.parent = item.name
+ and item_default.company = %(company)s
and bom.name = %(bom)s
and bom_item.parent = bom.name
and item.name = bom_item.item_code
@@ -564,14 +566,14 @@
query = query.format(table="BOM Explosion Item",
where_conditions="",
select_columns = ", bom_item.source_warehouse, (Select idx from `tabBOM Item` where item_code = bom_item.item_code and parent = %(parent)s ) as idx")
- items = frappe.db.sql(query, { "parent": bom, "qty": qty, "bom": bom }, as_dict=True)
+ items = frappe.db.sql(query, { "parent": bom, "qty": qty, "bom": bom, "company": company }, as_dict=True)
elif fetch_scrap_items:
query = query.format(table="BOM Scrap Item", where_conditions="", select_columns=", bom_item.idx")
- items = frappe.db.sql(query, { "qty": qty, "bom": bom }, as_dict=True)
+ items = frappe.db.sql(query, { "qty": qty, "bom": bom, "company": company }, as_dict=True)
else:
query = query.format(table="BOM Item", where_conditions="",
select_columns = ", bom_item.source_warehouse, bom_item.idx")
- items = frappe.db.sql(query, { "qty": qty, "bom": bom }, as_dict=True)
+ items = frappe.db.sql(query, { "qty": qty, "bom": bom, "company": company }, as_dict=True)
for item in items:
if item.item_code in item_dict:
@@ -624,28 +626,18 @@
return
if frappe.form_dict.parent:
- bom_items = frappe.get_list('BOM Item',
- fields=['item_code', 'bom_no as value', 'stock_qty'],
- filters=[['parent', '=', frappe.form_dict.parent]],
- order_by='idx')
-
- item_names = tuple(d.get('item_code') for d in bom_items)
-
- items = frappe.get_list('Item',
- fields=['image', 'description', 'name'],
- filters=[['name', 'in', item_names]]) # to get only required item dicts
-
- for bom_item in bom_items:
- # extend bom_item dict with respective item dict
- bom_item.update(
- # returns an item dict from items list which matches with item_code
- (item for item in items if item.get('name')
- == bom_item.get('item_code')).next()
- )
- bom_item.expandable = 0 if bom_item.value in ('', None) else 1
-
- return bom_items
-
+ return frappe.db.sql("""select
+ bom_item.item_code,
+ bom_item.bom_no as value,
+ bom_item.stock_qty,
+ if(ifnull(bom_item.bom_no, "")!="", 1, 0) as expandable,
+ item.image,
+ item.description
+ from `tabBOM Item` bom_item, tabItem item
+ where bom_item.parent=%s
+ and bom_item.item_code = item.name
+ order by bom_item.idx
+ """, frappe.form_dict.parent, as_dict=True)
def get_boms_in_bottom_up_order(bom_no=None):
def _get_parent(bom_no):
diff --git a/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.json b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.json
index 7df728b..b6e20af 100644
--- a/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.json
+++ b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.json
@@ -154,7 +154,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.json b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.json
index 8f28dd7..3fad2ef 100644
--- a/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.json
+++ b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.json
@@ -154,7 +154,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/manufacturing/doctype/operation/operation.json b/erpnext/manufacturing/doctype/operation/operation.json
index 69eb449..c231fba 100644
--- a/erpnext/manufacturing/doctype/operation/operation.json
+++ b/erpnext/manufacturing/doctype/operation/operation.json
@@ -103,7 +103,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index ee64a16..006e542 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -293,14 +293,15 @@
for d in frappe.db.sql("""select bei.item_code, item.default_bom as bom,
ifnull(sum(bei.stock_qty/ifnull(bom.quantity, 1)), 0) as qty, item.item_name,
bei.description, bei.stock_uom, item.min_order_qty, bei.source_warehouse,
- item.default_material_request_type, item.min_order_qty, item.default_warehouse
+ item.default_material_request_type, item.min_order_qty, item_default.default_warehouse
from
- `tabBOM Explosion Item` bei, `tabBOM` bom, `tabItem` item
+ `tabBOM Explosion Item` bei, `tabBOM` bom, `tabItem` item, `tabItem Default` item_default
where
- bom.name = bei.parent and item.name = bei.item_code
- and bei.docstatus < 2 and bom.name=%s and item.is_stock_item in (1, {0})
+ bom.name = bei.parent and item.name = bei.item_code and bei.docstatus < 2
+ and item_default.parent = item.name and item_default.company=%s
+ and bom.name=%s and item.is_stock_item in (1, {0})
group by bei.item_code, bei.stock_uom""".format(self.include_non_stock_items),
- data.bom_no, as_dict=1):
+ (self.company, data.bom_no), as_dict=1):
bom_wise_item_details.setdefault(d.item_code, d)
else:
bom_wise_item_details = self.get_subitems(data, bom_wise_item_details, data.bom_no, 1)
@@ -317,16 +318,18 @@
item.is_sub_contracted_item as is_sub_contracted, bom_item.source_warehouse,
item.default_bom as default_bom, bom_item.description as description,
bom_item.stock_uom as stock_uom, item.min_order_qty as min_order_qty,
- item.default_warehouse
+ item_default.default_warehouse
FROM
- `tabBOM Item` bom_item, `tabBOM` bom, tabItem item
+ `tabBOM Item` bom_item, `tabBOM` bom, tabItem item, `tabItem Default` item_default
where
bom.name = bom_item.parent and bom.name = %(bom)s
and bom_item.docstatus < 2 and bom_item.item_code = item.name
+ and item.name = item_default.parent and item_default.company = %(company)s
and item.is_stock_item in (1, {0})
group by bom_item.item_code""".format(self.include_non_stock_items),{
'bom': bom_no,
- 'parent_qty': parent_qty
+ 'parent_qty': parent_qty,
+ 'company': self.company
}, as_dict=1)
for d in items:
diff --git a/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.json b/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.json
index 89ca714..a79182f 100644
--- a/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.json
+++ b/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.json
@@ -129,7 +129,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index f1d3677..97c6dd6 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -541,3 +541,4 @@
erpnext.patches.v11_0.make_asset_finance_book_against_old_entries
erpnext.patches.v11_0.check_buying_selling_in_currency_exchange
erpnext.patches.v11_0.refactor_erpnext_shopify
+erpnext.patches.v11_0.move_item_defaults_to_child_table_for_multicompany
diff --git a/erpnext/patches/v11_0/move_item_defaults_to_child_table_for_multicompany.py b/erpnext/patches/v11_0/move_item_defaults_to_child_table_for_multicompany.py
new file mode 100644
index 0000000..8e17ea6
--- /dev/null
+++ b/erpnext/patches/v11_0/move_item_defaults_to_child_table_for_multicompany.py
@@ -0,0 +1,59 @@
+# Copyright (c) 2018, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ '''
+
+ Fields to move from the item to item defaults child table
+ [ default_warehouse, buying_cost_center, expense_account, selling_cost_center, income_account ]
+
+ '''
+
+ frappe.reload_doc('stock', 'doctype', 'item_default')
+ frappe.reload_doc('stock', 'doctype', 'item')
+
+ companies = frappe.get_all("Company")
+ if len(companies) == 1:
+ frappe.db.sql('''
+ INSERT INTO `tabItem Default`
+ (name, parent, parenttype, parentfield, idx, company, default_warehouse,
+ buying_cost_center, selling_cost_center, expense_account, income_account, default_supplier)
+ SELECT
+ SUBSTRING(SHA2(name,224), 1, 10) as name, name as parent, 'Item' as parenttype,
+ 'item_defaults' as parentfield, 1 as idx, %s as company, default_warehouse,
+ buying_cost_center, selling_cost_center, expense_account, income_account, default_supplier
+ FROM `tabItem`;
+ ''', companies[0].name)
+ else:
+ item_details = frappe.get_all("Item", fields=["name", "default_warehouse", "buying_cost_center",
+ "expense_account", "selling_cost_center", "income_account"], limit=100)
+
+ for item in item_details:
+ item_defaults = []
+
+ def insert_into_item_defaults(doc_field_name, doc_field_value, company):
+ for d in item_defaults:
+ if d.get("company") == company:
+ d[doc_field_name] = doc_field_value
+ return
+ item_defaults.append({
+ "company": company,
+ doc_field_name: doc_field_value
+ })
+
+ for d in [
+ ["default_warehouse", "Warehouse"], ["expense_account", "Account"], ["expense_account", "Account"],
+ ["buying_cost_center", "Cost Center"], ["selling_cost_center", "Cost Center"]
+ ]:
+ if item.get(d[0]):
+ company = frappe.get_value(d[1], item.get(d[0]), "company", cache=True)
+ insert_into_item_defaults(d[0], item.get(d[0]), company)
+
+ doc = frappe.get_doc("Item", item.name)
+ doc.extend("item_defaults", item_defaults)
+
+ for child_doc in doc.item_defaults:
+ child_doc.db_insert()
\ No newline at end of file
diff --git a/erpnext/portal/doctype/homepage/homepage.json b/erpnext/portal/doctype/homepage/homepage.json
index e0e47d1..81433b1 100644
--- a/erpnext/portal/doctype/homepage/homepage.json
+++ b/erpnext/portal/doctype/homepage/homepage.json
@@ -199,7 +199,6 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
diff --git a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json
index 870c8b1..c8b4ae9 100644
--- a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json
+++ b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json
@@ -280,7 +280,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.json b/erpnext/projects/doctype/activity_cost/activity_cost.json
index 9d812dd..78a66c4 100644
--- a/erpnext/projects/doctype/activity_cost/activity_cost.json
+++ b/erpnext/projects/doctype/activity_cost/activity_cost.json
@@ -274,7 +274,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/projects/doctype/dependent_task/dependent_task.json b/erpnext/projects/doctype/dependent_task/dependent_task.json
index 18e6c0d..e00a2b2 100644
--- a/erpnext/projects/doctype/dependent_task/dependent_task.json
+++ b/erpnext/projects/doctype/dependent_task/dependent_task.json
@@ -43,7 +43,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/projects/doctype/project_user/project_user.json b/erpnext/projects/doctype/project_user/project_user.json
index ea57589..a7cc810 100644
--- a/erpnext/projects/doctype/project_user/project_user.json
+++ b/erpnext/projects/doctype/project_user/project_user.json
@@ -67,7 +67,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index c86e699..fcaa344 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -186,25 +186,27 @@
@frappe.whitelist()
def get_children(doctype, parent, task=None, project=None, is_root=False):
-
- filters = [['docstatus', '<', '2']]
+ conditions = ''
if task:
- filters.append(['parent_task', '=', task])
+ # via filters
+ conditions += ' and parent_task = "{0}"'.format(frappe.db.escape(task))
elif parent and not is_root:
# via expand child
- filters.append(['parent_task', '=', parent])
+ conditions += ' and parent_task = "{0}"'.format(frappe.db.escape(parent))
else:
- filters.append(['parent_task', '=', ''])
+ conditions += ' and ifnull(parent_task, "")=""'
if project:
- filters.append(['project', '=', project])
+ conditions += ' and project = "{0}"'.format(frappe.db.escape(project))
- tasks = frappe.get_list(doctype, fields=[
- 'name as value',
- 'subject as title',
- 'is_group as expandable'
- ], filters=filters, order_by='name')
+ 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
diff --git a/erpnext/projects/doctype/task_depends_on/task_depends_on.json b/erpnext/projects/doctype/task_depends_on/task_depends_on.json
index 25657af..dbbe9d3 100644
--- a/erpnext/projects/doctype/task_depends_on/task_depends_on.json
+++ b/erpnext/projects/doctype/task_depends_on/task_depends_on.json
@@ -133,7 +133,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/selling/doctype/industry_type/industry_type.json b/erpnext/selling/doctype/industry_type/industry_type.json
index 027626c..f4fcae4 100644
--- a/erpnext/selling/doctype/industry_type/industry_type.json
+++ b/erpnext/selling/doctype/industry_type/industry_type.json
@@ -44,7 +44,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.json b/erpnext/selling/doctype/installation_note_item/installation_note_item.json
index 17bf278..79bcf10 100644
--- a/erpnext/selling/doctype/installation_note_item/installation_note_item.json
+++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.json
@@ -238,7 +238,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/selling/doctype/lead_source/lead_source.json b/erpnext/selling/doctype/lead_source/lead_source.json
index e677915..868f6d1 100644
--- a/erpnext/selling/doctype/lead_source/lead_source.json
+++ b/erpnext/selling/doctype/lead_source/lead_source.json
@@ -69,7 +69,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/selling/doctype/product_bundle_item/product_bundle_item.json b/erpnext/selling/doctype/product_bundle_item/product_bundle_item.json
index d31b5fb..38f51de 100644
--- a/erpnext/selling/doctype/product_bundle_item/product_bundle_item.json
+++ b/erpnext/selling/doctype/product_bundle_item/product_bundle_item.json
@@ -169,7 +169,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py
index ced5ebf..3b36a2d 100644
--- a/erpnext/selling/doctype/quotation/test_quotation.py
+++ b/erpnext/selling/doctype/quotation/test_quotation.py
@@ -150,12 +150,10 @@
from erpnext.stock.doctype.item.test_item import make_item
first_item = make_item("_Test Laptop",
- {"is_stock_item": 1, "expense_account": "_Test Account Cost for Goods Sold - _TC",
- "cost_center": "_Test Cost Center - _TC"})
+ {"is_stock_item": 1})
second_item = make_item("_Test CPU",
- {"is_stock_item": 1, "expense_account": "_Test Account Cost for Goods Sold - _TC",
- "cost_center": "_Test Cost Center - _TC"})
+ {"is_stock_item": 1})
qo_item1 = [
{
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 7e6c3dc..5116725 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -15,6 +15,8 @@
from erpnext.controllers.selling_controller import SellingController
from frappe.desk.doctype.auto_repeat.auto_repeat import get_next_schedule_date
from erpnext.selling.doctype.customer.customer import check_credit_limit
+from erpnext.stock.doctype.item.item import get_item_defaults
+
form_grid_templates = {
"items": "templates/form_grid/item_grid.html"
@@ -493,7 +495,7 @@
target.amount = (flt(source.qty) - flt(source.delivered_qty)) * flt(source.rate)
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)
+ item = get_item_defaults(target.item_code, target.company)
if item:
target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
@@ -557,7 +559,7 @@
if source_parent.project:
target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center")
if not target.cost_center and target.item_code:
- item = frappe.db.get_value("Item", target.item_code, ["item_group", "selling_cost_center"], as_dict=1)
+ item = get_item_defaults(target.item_code, target.company)
target.cost_center = item.selling_cost_center \
or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index c5f7ef2..8388941 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -359,14 +359,9 @@
make_stock_entry(target="_Test Warehouse - _TC", qty=10, rate=100)
- po_item = make_item("_Test Item for Drop Shipping", {"is_stock_item": 1, "delivered_by_supplier": 1,
- 'default_supplier': '_Test Supplier',
- "expense_account": "_Test Account Cost for Goods Sold - _TC",
- "cost_center": "_Test Cost Center - _TC"
- })
+ po_item = make_item("_Test Item for Drop Shipping", {"is_stock_item": 1, "delivered_by_supplier": 1})
- dn_item = make_item("_Test Regular Item", {"is_stock_item": 1, "expense_account": "_Test Account Cost for Goods Sold - _TC",
- "cost_center": "_Test Cost Center - _TC"})
+ dn_item = make_item("_Test Regular Item", {"is_stock_item": 1})
so_items = [
{
diff --git a/erpnext/selling/doctype/sales_team/sales_team.json b/erpnext/selling/doctype/sales_team/sales_team.json
index fcd61a1..c77f9f4 100644
--- a/erpnext/selling/doctype/sales_team/sales_team.json
+++ b/erpnext/selling/doctype/sales_team/sales_team.json
@@ -157,7 +157,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.json b/erpnext/setup/doctype/authorization_control/authorization_control.json
index 43afc06..823ff26 100644
--- a/erpnext/setup/doctype/authorization_control/authorization_control.json
+++ b/erpnext/setup/doctype/authorization_control/authorization_control.json
@@ -11,7 +11,7 @@
"hide_toolbar": 0,
"idx": 1,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 1,
"istable": 0,
diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.json b/erpnext/setup/doctype/authorization_rule/authorization_rule.json
index 70047bc..56df330 100644
--- a/erpnext/setup/doctype/authorization_rule/authorization_rule.json
+++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.json
@@ -558,7 +558,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/brand/brand.json b/erpnext/setup/doctype/brand/brand.json
index 8d4ba74..064eff6 100644
--- a/erpnext/setup/doctype/brand/brand.json
+++ b/erpnext/setup/doctype/brand/brand.json
@@ -79,7 +79,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index a2feddc..9e9ac55 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -291,9 +291,6 @@
Trash accounts and cost centers for this company if no gl entry exists
"""
self.update_nsm_model()
- accounts = frappe.db.sql_list("select name from tabAccount where company=%s", self.name)
- cost_centers = frappe.db.sql_list("select name from `tabCost Center` where company=%s", self.name)
- warehouses = frappe.db.sql_list("select name from tabWarehouse where company=%s", self.name)
rec = frappe.db.sql("SELECT name from `tabGL Entry` where company = %s", self.name)
if not rec:
@@ -308,33 +305,19 @@
frappe.db.sql("""delete from `tabWarehouse` where company=%s""", self.name)
frappe.defaults.clear_default("company", value=self.name)
- frappe.db.sql("delete from `tabMode of Payment Account` where company=%s", self.name)
+ for doctype in ["Mode of Payment Account", "Item Default"]:
+ frappe.db.sql("delete from `tab{0}` where company = %s".format(doctype), self.name)
# clear default accounts, warehouses from item
+ warehouses = frappe.db.sql_list("select name from tabWarehouse where company=%s", self.name)
if warehouses:
- for f in ["default_warehouse", "website_warehouse"]:
- frappe.db.sql("""update tabItem set %s=NULL where %s in (%s)"""
- % (f, f, ', '.join(['%s']*len(warehouses))), tuple(warehouses))
-
frappe.db.sql("""delete from `tabItem Reorder` where warehouse in (%s)"""
% ', '.join(['%s']*len(warehouses)), tuple(warehouses))
- if accounts:
- for f in ["income_account", "expense_account"]:
- frappe.db.sql("""update tabItem set %s=NULL where %s in (%s)"""
- % (f, f, ', '.join(['%s']*len(accounts))), tuple(accounts))
-
- if cost_centers:
- for f in ["selling_cost_center", "buying_cost_center"]:
- frappe.db.sql("""update tabItem set %s=NULL where %s in (%s)"""
- % (f, f, ', '.join(['%s']*len(cost_centers))), tuple(cost_centers))
-
# reset default company
frappe.db.sql("""update `tabSingles` set value=""
where doctype='Global Defaults' and field='default_company'
and value=%s""", self.name)
- # delete mode of payment account
- frappe.db.sql("delete from `tabMode of Payment Account` where company=%s", self.name)
# delete BOMs
boms = frappe.db.sql_list("select name from tabBOM where company=%s", self.name)
diff --git a/erpnext/setup/doctype/customer_group/customer_group.json b/erpnext/setup/doctype/customer_group/customer_group.json
index 062a49a..3392c6c 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.json
+++ b/erpnext/setup/doctype/customer_group/customer_group.json
@@ -379,7 +379,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/email_digest/email_digest.json b/erpnext/setup/doctype/email_digest/email_digest.json
index a75a59a..12f275c 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.json
+++ b/erpnext/setup/doctype/email_digest/email_digest.json
@@ -1073,7 +1073,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.json b/erpnext/setup/doctype/global_defaults/global_defaults.json
index ce3f2cf..a6c5964 100644
--- a/erpnext/setup/doctype/global_defaults/global_defaults.json
+++ b/erpnext/setup/doctype/global_defaults/global_defaults.json
@@ -225,7 +225,7 @@
"icon": "fa fa-cog",
"idx": 1,
"in_create": 1,
- "in_dialog": 0,
+
"is_submittable": 0,
"is_transaction_doc": 0,
"issingle": 1,
diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json
index 6230706..29486b2 100644
--- a/erpnext/setup/doctype/item_group/item_group.json
+++ b/erpnext/setup/doctype/item_group/item_group.json
@@ -525,7 +525,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/print_heading/print_heading.json b/erpnext/setup/doctype/print_heading/print_heading.json
index d992fcb..dc07f0c 100644
--- a/erpnext/setup/doctype/print_heading/print_heading.json
+++ b/erpnext/setup/doctype/print_heading/print_heading.json
@@ -71,7 +71,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.json b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.json
index b95a936..5d778ee 100644
--- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.json
+++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.json
@@ -44,7 +44,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.json b/erpnext/setup/doctype/sales_partner/sales_partner.json
index 6c2d705..3c31c23 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.json
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.json
@@ -712,7 +712,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/sales_person/sales_person.json b/erpnext/setup/doctype/sales_person/sales_person.json
index 9f46501..b25f6a7 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.json
+++ b/erpnext/setup/doctype/sales_person/sales_person.json
@@ -412,7 +412,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/target_detail/target_detail.json b/erpnext/setup/doctype/target_detail/target_detail.json
index 9bc8550..509733b 100644
--- a/erpnext/setup/doctype/target_detail/target_detail.json
+++ b/erpnext/setup/doctype/target_detail/target_detail.json
@@ -122,7 +122,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.json b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.json
index 40e54d8..5f25406 100644
--- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.json
+++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.json
@@ -138,7 +138,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/territory/territory.json b/erpnext/setup/doctype/territory/territory.json
index b123d5e..81c2839 100644
--- a/erpnext/setup/doctype/territory/territory.json
+++ b/erpnext/setup/doctype/territory/territory.json
@@ -357,7 +357,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/uom/uom.json b/erpnext/setup/doctype/uom/uom.json
index e752d0f..e4322fe 100644
--- a/erpnext/setup/doctype/uom/uom.json
+++ b/erpnext/setup/doctype/uom/uom.json
@@ -77,7 +77,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.json b/erpnext/setup/doctype/website_item_group/website_item_group.json
index 73084b5..8176e40 100644
--- a/erpnext/setup/doctype/website_item_group/website_item_group.json
+++ b/erpnext/setup/doctype/website_item_group/website_item_group.json
@@ -43,7 +43,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index fbf0ded..4f0bd0d 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -472,7 +472,8 @@
fields: ["attribute_value"],
limit_start: 0,
limit_page_length: 500,
- parent: "Item"
+ parent: "Item",
+ order_by: "idx"
}
}).then((r) => {
if(r.message) {
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 5013e23..ce1bdc3 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -1614,6 +1614,69 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "defaults",
+ "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": "Defaults",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "item_defaults",
+ "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": "Item Defaults",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Default",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 945bde3..9487963 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -81,7 +81,8 @@
def after_insert(self):
'''set opening stock and item price'''
if self.standard_rate:
- self.add_price()
+ for default in self.item_defaults:
+ self.add_price(default.default_price_list)
if self.opening_stock:
self.set_opening_stock()
@@ -166,15 +167,16 @@
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
# default warehouse, or Stores
- default_warehouse = (self.default_warehouse
- or frappe.db.get_single_value('Stock Settings', 'default_warehouse')
- or frappe.db.get_value('Warehouse', {'warehouse_name': _('Stores')}))
+ for default in self.item_defaults:
+ default_warehouse = (default.default_warehouse
+ or frappe.db.get_single_value('Stock Settings', 'default_warehouse')
+ or frappe.db.get_value('Warehouse', {'warehouse_name': _('Stores')}))
- if default_warehouse:
- stock_entry = make_stock_entry(item_code=self.name, target=default_warehouse,
- qty=self.opening_stock, rate=self.valuation_rate)
+ if default_warehouse:
+ stock_entry = make_stock_entry(item_code=self.name, target=default_warehouse, qty=self.opening_stock,
+ rate=self.valuation_rate, company=default.company)
- stock_entry.add_comment("Comment", _("Opening Stock"))
+ stock_entry.add_comment("Comment", _("Opening Stock"))
def make_route(self):
if not self.route:
@@ -880,3 +882,14 @@
if not matched:
frappe.throw(
_("Default Unit of Measure for Item {0} cannot be changed directly because you have already made some transaction(s) with another UOM. You will need to create a new Item to use a different Default UOM.").format(item))
+
+def get_item_defaults(item, company):
+ return frappe.db.sql('''
+ select
+ i.item_name, i.description, i.stock_uom, i.name, i.is_stock_item, i.item_code, i.item_group,
+ id.expense_account, id.buying_cost_center, id.default_warehouse, id.selling_cost_center
+ from
+ `tabItem` i, `tabItem Default` id
+ where
+ i.name = id.parent and i.name = %s and id.company = %s
+ ''', (item, company), as_dict=1)[0]
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py
index 3f0d7fa..1c915ee 100644
--- a/erpnext/stock/doctype/item/test_item.py
+++ b/erpnext/stock/doctype/item/test_item.py
@@ -35,8 +35,9 @@
item.update(properties)
- if item.is_stock_item and not item.default_warehouse:
- item.default_warehouse = "_Test Warehouse - _TC"
+ if item.is_stock_item:
+ for item_default in [doc for doc in item.item_defaults if not doc.default_warehouse]:
+ item_default.default_warehouse = "_Test Warehouse - _TC"
item.insert()
@@ -199,7 +200,12 @@
"increment": 0.5
}
],
- "default_warehouse": "_Test Warehouse - _TC",
+ "item_defaults": [
+ {
+ "default_warehouse": "_Test Warehouse - _TC",
+ "company": "_Test Company"
+ }
+ ],
"has_variants": 1
})
@@ -305,5 +311,8 @@
item.item_group = "All Item Groups"
item.is_stock_item = is_stock_item or 1
item.valuation_rate = valuation_rate or 0.0
- item.default_warehouse = warehouse or '_Test Warehouse - _TC'
+ item.append("item_defaults", {
+ "default_warehouse": warehouse or '_Test Warehouse - _TC',
+ "company": "_Test Company"
+ })
item.save()
diff --git a/erpnext/stock/doctype/item_attribute/item_attribute.json b/erpnext/stock/doctype/item_attribute/item_attribute.json
index 8c02928..4b23cf0 100644
--- a/erpnext/stock/doctype/item_attribute/item_attribute.json
+++ b/erpnext/stock/doctype/item_attribute/item_attribute.json
@@ -226,7 +226,7 @@
"hide_toolbar": 0,
"icon": "fa fa-edit",
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/stock/doctype/item_attribute_value/item_attribute_value.json b/erpnext/stock/doctype/item_attribute_value/item_attribute_value.json
index 68edfc9..2807600 100644
--- a/erpnext/stock/doctype/item_attribute_value/item_attribute_value.json
+++ b/erpnext/stock/doctype/item_attribute_value/item_attribute_value.json
@@ -69,7 +69,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/item_default/__init__.py b/erpnext/stock/doctype/item_default/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/stock/doctype/item_default/__init__.py
diff --git a/erpnext/stock/doctype/item_default/item_default.json b/erpnext/stock/doctype/item_default/item_default.json
new file mode 100644
index 0000000..72d7880
--- /dev/null
+++ b/erpnext/stock/doctype/item_default/item_default.json
@@ -0,0 +1,449 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-05-03 02:29:24.444341",
+ "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": "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": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "default_warehouse",
+ "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": "Default 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,
+ "translatable": 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "default_price_list",
+ "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": "Default Price List",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Price List",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "purchase_defaults",
+ "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 Defaults",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "buying_cost_center",
+ "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 Buying Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Cost Center",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "default_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": "Default 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,
+ "translatable": 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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "expense_account",
+ "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 Expense Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "selling_defaults",
+ "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 Defaults",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "selling_cost_center",
+ "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 Selling Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Cost Center",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "income_account",
+ "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 Income Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "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,
+ "translatable": 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": 1,
+ "max_attachments": 0,
+ "modified": "2018-05-03 02:44:24.097373",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Default",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "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/stock/doctype/item_default/item_default.py b/erpnext/stock/doctype/item_default/item_default.py
new file mode 100644
index 0000000..935f0ff
--- /dev/null
+++ b/erpnext/stock/doctype/item_default/item_default.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, 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 ItemDefault(Document):
+ pass
diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json
index 6147db9..f1e1fd3 100644
--- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json
+++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json
@@ -70,7 +70,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.json b/erpnext/stock/doctype/item_reorder/item_reorder.json
index 43eb98d..fb4c558 100644
--- a/erpnext/stock/doctype/item_reorder/item_reorder.json
+++ b/erpnext/stock/doctype/item_reorder/item_reorder.json
@@ -142,7 +142,7 @@
"idx": 1,
"image_view": 0,
"in_create": 1,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.json b/erpnext/stock/doctype/item_supplier/item_supplier.json
index 163b427..6cff8e0 100644
--- a/erpnext/stock/doctype/item_supplier/item_supplier.json
+++ b/erpnext/stock/doctype/item_supplier/item_supplier.json
@@ -75,7 +75,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/item_tax/item_tax.json b/erpnext/stock/doctype/item_tax/item_tax.json
index e9c9d62..6c1bd09 100644
--- a/erpnext/stock/doctype/item_tax/item_tax.json
+++ b/erpnext/stock/doctype/item_tax/item_tax.json
@@ -68,7 +68,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/item_variant/item_variant.json b/erpnext/stock/doctype/item_variant/item_variant.json
index 9da66a2..93005c0 100644
--- a/erpnext/stock/doctype/item_variant/item_variant.json
+++ b/erpnext/stock/doctype/item_variant/item_variant.json
@@ -70,7 +70,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.json b/erpnext/stock/doctype/item_website_specification/item_website_specification.json
index 3c32adb..618c9f0 100644
--- a/erpnext/stock/doctype/item_website_specification/item_website_specification.json
+++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.json
@@ -68,7 +68,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.json b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.json
index d65da88..f49c147 100644
--- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.json
+++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.json
@@ -168,7 +168,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/packed_item/packed_item.json b/erpnext/stock/doctype/packed_item/packed_item.json
index f9c1635..6c8b2b1 100644
--- a/erpnext/stock/doctype/packed_item/packed_item.json
+++ b/erpnext/stock/doctype/packed_item/packed_item.json
@@ -665,7 +665,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py
index 74dfa05..7ca5ead 100644
--- a/erpnext/stock/doctype/packed_item/packed_item.py
+++ b/erpnext/stock/doctype/packed_item/packed_item.py
@@ -18,9 +18,10 @@
from `tabProduct Bundle Item` t1, `tabProduct Bundle` t2
where t2.new_item_code=%s and t1.parent = t2.name order by t1.idx""", item_code, as_dict=1)
-def get_packing_item_details(item):
- return frappe.db.sql("""select item_name, description, stock_uom, default_warehouse from `tabItem`
- where name = %s""", item, as_dict = 1)[0]
+def get_packing_item_details(item, company):
+ return frappe.db.sql("""select i.item_name, i.description, i.stock_uom, id.default_warehouse
+ from `tabItem` i, `tabItem Default` id where id.parent=i.name and i.name = %s and id.company""",
+ (item, company), as_dict = 1)[0]
def get_bin_qty(item, warehouse):
det = frappe.db.sql("""select actual_qty, projected_qty from `tabBin`
@@ -28,12 +29,13 @@
return det and det[0] or frappe._dict()
def update_packing_list_item(doc, packing_item_code, qty, main_item_row, description):
- item = get_packing_item_details(packing_item_code)
+ item = get_packing_item_details(packing_item_code, doc.company)
# check if exists
exists = 0
for d in doc.get("packed_items"):
- if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code and d.parent_detail_docname == main_item_row.name and d.description == description:
+ if d.parent_item == main_item_row.item_code and d.item_code == packing_item_code and\
+ d.parent_detail_docname == main_item_row.name and d.description == description:
pi, exists = d, 1
break
diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json
index 009244c..1b22f13 100644
--- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json
+++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json
@@ -430,7 +430,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/price_list_country/price_list_country.json b/erpnext/stock/doctype/price_list_country/price_list_country.json
index a7cef6f6..a0020c5 100644
--- a/erpnext/stock/doctype/price_list_country/price_list_country.json
+++ b/erpnext/stock/doctype/price_list_country/price_list_country.json
@@ -42,7 +42,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.json b/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.json
index a3b43e9..94aecfe 100644
--- a/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.json
+++ b/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.json
@@ -395,7 +395,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 233138f..5a6384a 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -10,6 +10,7 @@
from erpnext.stock.stock_ledger import get_previous_sle, NegativeStockError, get_valuation_rate
from erpnext.stock.get_item_details import get_bin_details, get_default_cost_center, get_conversion_factor
from erpnext.stock.doctype.batch.batch import get_batch_no, set_batch_nos, get_batch_qty
+from erpnext.stock.doctype.item.item import get_item_defaults
from erpnext.manufacturing.doctype.bom.bom import validate_bom_no
from erpnext.stock.utils import get_bin
import json
@@ -562,14 +563,14 @@
pro_doc.run_method("update_planned_qty")
def get_item_details(self, args=None, for_update=False):
- item = frappe.db.sql("""select stock_uom, description, image, item_name,
- expense_account, buying_cost_center, item_group, has_serial_no,
- has_batch_no, sample_quantity
- from `tabItem`
- where name = %s
- and disabled=0
- and (end_of_life is null or end_of_life='0000-00-00' or end_of_life > %s)""",
- (args.get('item_code'), nowdate()), as_dict = 1)
+ item = frappe.db.sql("""select i.stock_uom, i.description, i.image, i.item_name, i.item_group,
+ i.has_batch_no, i.sample_quantity, i.has_serial_no,
+ id.expense_account, id.buying_cost_center
+ from `tabItem`, `tabItem Default` id
+ where i.name=%s and i.name=id.parent and id.company=%s
+ and i.disabled=0
+ and (i.end_of_life is null or i.end_of_life='0000-00-00' or i.end_of_life > %s)""",
+ (args.get('item_code'), self.company, nowdate()), as_dict = 1)
if not item:
frappe.throw(_("Item {0} is not active or end of life has been reached").format(args.get("item_code")))
@@ -716,8 +717,7 @@
item_code = frappe.db.get_value("BOM", self.bom_no, "item")
to_warehouse = self.to_warehouse
- item = frappe.db.get_value("Item", item_code, ["item_name",
- "description", "stock_uom", "expense_account", "buying_cost_center", "name", "default_warehouse"], as_dict=1)
+ item = get_item_defaults(item_code, self.company)
if not self.work_order and not to_warehouse:
# in case of BOM
@@ -782,8 +782,8 @@
for item in wo_items:
qty = item.required_qty
- item_account_details = frappe.db.get_value("Item", item.item_code, ["item_name",
- "description", "stock_uom", "expense_account", "buying_cost_center", "name", "default_warehouse"], as_dict=1)
+
+ item_account_details = get_item_defaults(item.item_code, self.company)
# Take into account consumption if there are any.
if self.purpose == 'Manufacture':
req_qty_each = flt(item.required_qty / wo.qty)
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
index 8bf2610..8647d0f 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
@@ -12,6 +12,7 @@
:item_code: Item to be moved
:qty: Qty to be moved
+ :company: Company Name (optional)
:from_warehouse: Optional
:to_warehouse: Optional
:rate: Optional
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
index 8275c84..b6892f1 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
@@ -689,7 +689,7 @@
"idx": 1,
"image_view": 0,
"in_create": 1,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index 3342768..ce32e01 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -49,7 +49,8 @@
args: {
warehouse: data.warehouse,
posting_date: frm.doc.posting_date,
- posting_time: frm.doc.posting_time
+ posting_time: frm.doc.posting_time,
+ company:frm.doc.company
},
callback: function(r) {
var items = [];
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 938173d..e434233 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -268,12 +268,12 @@
self._cancel()
@frappe.whitelist()
-def get_items(warehouse, posting_date, posting_time):
+def get_items(warehouse, posting_date, posting_time, company):
items = frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse}, as_list=1)
- items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0,
- "has_batch_no": 0, "has_variants": 0, "disabled": 0, "default_warehouse": warehouse},
- as_list=1)
+ items += frappe.db.sql_list('''select i.name from `tabItem` i, `tabItem Default` id where i.name = id.parent
+ and i.is_stock_item=1 and i.has_serial_no=0 and i.has_batch_no=0 and i.has_variants=0 and i.disabled=0
+ and id.default_warehouse=%s and id.company=%s''', (warehouse, company))
res = []
for item in set(items):
diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json
index a17cc2d..6f28651 100644
--- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json
+++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json
@@ -69,7 +69,7 @@
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 1,
diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py
index b90ee32..9c47f98 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.py
+++ b/erpnext/stock/doctype/warehouse/warehouse.py
@@ -144,19 +144,17 @@
if is_root:
parent = ""
- fields = ['name as value', 'is_group as expandable']
- filters = [
- ['docstatus', '<', '2'],
- ['parent_warehouse', '=', parent],
- ['company', 'in', (company, None,'')]
- ]
-
- warehouses = frappe.get_list(doctype, fields=fields, filters=filters, order_by='name')
+ warehouses = frappe.db.sql("""select name as value,
+ is_group as expandable
+ from `tabWarehouse`
+ where docstatus < 2
+ and ifnull(`parent_warehouse`,'') = %s
+ and (`company` = %s or company is null or company = '')
+ order by name""", (parent, company), as_dict=1)
# return warehouses
for wh in warehouses:
wh["balance"] = get_stock_value_on(warehouse=wh.value)
-
return warehouses
@frappe.whitelist()
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index b336565..fd145d2 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -11,6 +11,8 @@
from frappe.model.meta import get_field_precision
from erpnext.stock.doctype.batch.batch import get_batch_no
from erpnext import get_company_currency
+from erpnext.stock.doctype.item.item import get_item_defaults
+
from six import string_types, iteritems
@@ -52,7 +54,7 @@
for bundle_item in bundled_items.items:
valuation_rate += \
- flt(get_valuation_rate(bundle_item.item_code, out.get("warehouse")).get("valuation_rate") \
+ flt(get_valuation_rate(bundle_item.item_code, args.company, out.get("warehouse")).get("valuation_rate") \
* bundle_item.qty)
out.update({
@@ -60,7 +62,7 @@
})
else:
- out.update(get_valuation_rate(args.item_code, out.get("warehouse")))
+ out.update(get_valuation_rate(args.item_code, args.company, out.get("warehouse")))
get_price_list_rate(args, item_doc, out)
@@ -204,7 +206,8 @@
user_default_warehouse = user_default_warehouse_list[0] \
if len(user_default_warehouse_list) == 1 else ""
- warehouse = user_default_warehouse or item.default_warehouse or args.warehouse
+ item_defaults = get_item_defaults(item.name, args.company)
+ warehouse = user_default_warehouse or item_defaults.default_warehouse or args.warehouse
material_request_type = ''
if args.get('doctype') == "Material Request":
@@ -227,9 +230,9 @@
"description": cstr(item.description).strip(),
"image": cstr(item.image).strip(),
"warehouse": warehouse,
- "income_account": get_default_income_account(args, item),
- "expense_account": get_default_expense_account(args, item),
- "cost_center": get_default_cost_center(args, item),
+ "income_account": get_default_income_account(args, item_defaults),
+ "expense_account": get_default_expense_account(args, item_defaults),
+ "cost_center": get_default_cost_center(args, item_defaults),
'has_serial_no': item.has_serial_no,
'has_batch_no': item.has_batch_no,
"batch_no": None,
@@ -677,8 +680,9 @@
if bom:
return bom
-def get_valuation_rate(item_code, warehouse=None):
- item = frappe.get_doc("Item", item_code)
+def get_valuation_rate(item_code, company, warehouse=None):
+ item = get_item_defaults(item_code, company)
+ # item = frappe.get_doc("Item", item_code)
if item.is_stock_item:
if not warehouse:
warehouse = item.default_warehouse
diff --git a/erpnext/support/doctype/support_settings/support_settings.json b/erpnext/support/doctype/support_settings/support_settings.json
index 1ca03c7..7adfd4d 100644
--- a/erpnext/support/doctype/support_settings/support_settings.json
+++ b/erpnext/support/doctype/support_settings/support_settings.json
@@ -48,7 +48,7 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 1,
"istable": 0,
diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.json b/erpnext/utilities/doctype/rename_tool/rename_tool.json
index f9aac1c..617354d 100644
--- a/erpnext/utilities/doctype/rename_tool/rename_tool.json
+++ b/erpnext/utilities/doctype/rename_tool/rename_tool.json
@@ -78,7 +78,7 @@
"icon": "fa fa-magic",
"idx": 1,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 1,
"istable": 0,
diff --git a/erpnext/utilities/doctype/sms_log/sms_log.json b/erpnext/utilities/doctype/sms_log/sms_log.json
index ffd9a7f..d8f3146 100644
--- a/erpnext/utilities/doctype/sms_log/sms_log.json
+++ b/erpnext/utilities/doctype/sms_log/sms_log.json
@@ -256,7 +256,7 @@
"icon": "fa fa-mobile-phone",
"idx": 1,
"in_create": 0,
- "in_dialog": 0,
+
"is_submittable": 0,
"issingle": 0,
"istable": 0,
diff --git a/erpnext/utilities/user_progress_utils.py b/erpnext/utilities/user_progress_utils.py
index 20e533e..0377a0a 100644
--- a/erpnext/utilities/user_progress_utils.py
+++ b/erpnext/utilities/user_progress_utils.py
@@ -110,7 +110,10 @@
"is_stock_item": 1,
"item_group": _("Products"),
"stock_uom": _(args.get("item_uom_" + str(i))),
- "default_warehouse": default_warehouse
+ "item_defaults": [{
+ "default_warehouse": default_warehouse,
+ "company": defaults.get("company_name")
+ }]
}).insert()
except frappe.NameError: