Merge branch 'develop' into payment-terms
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 8535365..42f538d 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -4,7 +4,7 @@
import frappe
from erpnext.hooks import regional_overrides
-__version__ = '9.1.2'
+__version__ = '9.1.6'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json
index 42cd44a..002562f 100644
--- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json
+++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json
@@ -417,6 +417,46 @@
"share": 1,
"submit": 0,
"write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Sales User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Purchase User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
+ "write": 0
}
],
"quick_entry": 1,
@@ -426,4 +466,4 @@
"sort_order": "ASC",
"track_changes": 1,
"track_seen": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/doctype/asset/asset.js b/erpnext/accounts/doctype/asset/asset.js
index 7c4eeae..e3afc35 100644
--- a/erpnext/accounts/doctype/asset/asset.js
+++ b/erpnext/accounts/doctype/asset/asset.js
@@ -55,13 +55,13 @@
});
}
- frm.trigger("show_graph");
+ frm.trigger("setup_chart");
}
},
- show_graph: function(frm) {
- var x_intervals = ["x", frm.doc.purchase_date];
- var asset_values = ["Asset Value", frm.doc.gross_purchase_amount];
+ setup_chart: function(frm) {
+ var x_intervals = [frm.doc.purchase_date];
+ var asset_values = [frm.doc.gross_purchase_amount];
var last_depreciation_date = frm.doc.purchase_date;
if(frm.doc.opening_accumulated_depreciation) {
@@ -94,32 +94,21 @@
last_depreciation_date = frm.doc.disposal_date;
}
- frm.dashboard.setup_chart({
+ frm.dashboard.render_graph({
+ title: "Asset Value",
data: {
- x: 'x',
- columns: [x_intervals, asset_values],
- regions: {
- 'Asset Value': [{'start': last_depreciation_date, 'style':'dashed'}]
- }
+ labels: x_intervals,
+ datasets: [{
+ color: 'green',
+ values: asset_values,
+ formatted: asset_values.map(d => d.toFixed(2))
+ }]
},
- legend: {
- show: false
- },
- axis: {
- x: {
- type: 'timeseries',
- tick: {
- format: "%d-%m-%Y"
- }
- },
- y: {
- min: 0,
- padding: {bottom: 10}
- }
- }
+ type: 'line'
});
},
+
item_code: function(frm) {
if(frm.doc.item_code) {
frappe.call({
diff --git a/erpnext/accounts/doctype/asset/test_asset.py b/erpnext/accounts/doctype/asset/test_asset.py
index 21596f1..831373a 100644
--- a/erpnext/accounts/doctype/asset/test_asset.py
+++ b/erpnext/accounts/doctype/asset/test_asset.py
@@ -13,6 +13,7 @@
def setUp(self):
set_depreciation_settings_in_company()
create_asset()
+ frappe.db.sql("delete from `tabTax Rule`")
def test_purchase_asset(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1")
diff --git a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json
index da17bb3..03341da 100644
--- a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json
+++ b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json
@@ -296,7 +296,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-09-04 17:37:01.192312",
+ "modified": "2017-10-16 17:37:01.192312",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",
@@ -311,4 +311,4 @@
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 57f9f83..83045ea 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -348,6 +348,8 @@
return filtered_rules or pricing_rules
def set_transaction_type(args):
+ if args.transaction_type:
+ return
if args.doctype in ("Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"):
args.transaction_type = "selling"
elif args.doctype in ("Material Request", "Supplier Quotation", "Purchase Order",
@@ -356,4 +358,4 @@
elif args.customer:
args.transaction_type = "selling"
else:
- args.transaction_type = "buying"
\ No newline at end of file
+ args.transaction_type = "buying"
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index ccf8a84..04f7e1b 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -486,17 +486,21 @@
if frappe.message_log: frappe.message_log.pop()
frappe.db.rollback()
frappe.log_error(frappe.get_traceback())
- name_list = save_invoice(e, si_doc, name, name_list)
+ name_list = save_invoice(doc, name, name_list)
return name_list
-def save_invoice(e, si_doc, name, name_list):
+def save_invoice(doc, name, name_list):
try:
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
- si_doc.docstatus = 0
- si_doc.flags.ignore_mandatory = True
- si_doc.due_date = si_doc.posting_date
- si_doc.insert()
+ si = frappe.new_doc('Sales Invoice')
+ si.update(doc)
+ si.set_posting_time = 1
+ si.customer = get_customer_id(doc)
+ si.due_date = doc.get('posting_date')
+ si.flags.ignore_mandatory = True
+ si.insert(ignore_permissions=True)
+ frappe.db.commit()
name_list.append(name)
except Exception:
frappe.log_error(frappe.get_traceback())
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index 3163f10..60f61e5 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -3,8 +3,9 @@
from __future__ import unicode_literals
import frappe
-import unittest, copy
-from frappe.utils import nowdate, add_days, flt, getdate
+
+import unittest, copy, time
+from frappe.utils import nowdate, add_days, flt, getdate, cint
from frappe.model.dynamic_links import get_dynamic_link_map
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry, get_qty_after_transaction
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import unlink_payment_on_cancel_of_invoice
@@ -674,6 +675,47 @@
self.pos_gl_entry(si, pos, 330)
+ def test_make_pos_invoice_in_draft(self):
+ from erpnext.accounts.doctype.sales_invoice.pos import make_invoice
+ from erpnext.stock.doctype.item.test_item import make_item
+
+ set_perpetual_inventory()
+
+ allow_negative_stock = frappe.db.get_single_value('Stock Settings', 'allow_negative_stock')
+ if allow_negative_stock:
+ frappe.db.set_value('Stock Settings', None, 'allow_negative_stock', 0)
+
+ make_pos_profile()
+ timestamp = cint(time.time())
+
+ item = make_item("_Test POS Item")
+ pos = copy.deepcopy(test_records[1])
+ pos['items'][0]['item_code'] = item.name
+ pos["is_pos"] = 1
+ pos["offline_pos_name"] = timestamp
+ pos["update_stock"] = 1
+ pos["payments"] = [{'mode_of_payment': 'Bank Draft', 'account': '_Test Bank - _TC', 'amount': 300},
+ {'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 330}]
+
+ invoice_data = [{timestamp: pos}]
+ si = make_invoice(invoice_data).get('invoice')
+ self.assertEquals(si[0], timestamp)
+
+ sales_invoice = frappe.get_all('Sales Invoice', fields =["*"], filters = {'offline_pos_name': timestamp})
+ self.assertEquals(sales_invoice[0].docstatus, 0)
+
+ timestamp = cint(time.time())
+ pos["offline_pos_name"] = timestamp
+ invoice_data = [{timestamp: pos}]
+ si1 = make_invoice(invoice_data).get('invoice')
+ self.assertEquals(si1[0], timestamp)
+
+ sales_invoice1 = frappe.get_all('Sales Invoice', fields =["*"], filters = {'offline_pos_name': timestamp})
+ self.assertEquals(sales_invoice1[0].docstatus, 0)
+
+ if allow_negative_stock:
+ frappe.db.set_value('Stock Settings', None, 'allow_negative_stock', 1)
+
def pos_gl_entry(self, si, pos, cash_amount):
# check stock ledger entries
sle = frappe.db.sql("""select * from `tabStock Ledger Entry`
diff --git a/erpnext/accounts/doctype/subscription/subscription.json b/erpnext/accounts/doctype/subscription/subscription.json
index dfdcbec..167a92f 100644
--- a/erpnext/accounts/doctype/subscription/subscription.json
+++ b/erpnext/accounts/doctype/subscription/subscription.json
@@ -844,7 +844,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-03 17:20:26.919630",
+ "modified": "2017-10-10 17:28:10.105561",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription",
diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py
index b40169a..20cf031 100644
--- a/erpnext/accounts/doctype/subscription/subscription.py
+++ b/erpnext/accounts/doctype/subscription/subscription.py
@@ -205,6 +205,17 @@
if new_document.meta.get_field('subscription'):
new_document.set('subscription', args.name)
+ for fieldname in ['naming_series', 'ignore_pricing_rule', 'posting_time'
+ 'select_print_heading', 'remarks', 'owner']:
+ if new_document.meta.get_field(fieldname):
+ new_document.set(fieldname, reference_doc.get(fieldname))
+
+ # copy item fields
+ if new_document.meta.get_field('items'):
+ for i, item in enumerate(new_document.items):
+ for fieldname in ("page_break",):
+ item.set(fieldname, reference_doc.items[i].get(fieldname))
+
if args.from_date and args.to_date:
from_date = get_next_date(args.from_date, mcount)
diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py
index b74163c..4ccf483 100644
--- a/erpnext/accounts/doctype/subscription/test_subscription.py
+++ b/erpnext/accounts/doctype/subscription/test_subscription.py
@@ -30,7 +30,7 @@
new_quotation = frappe.get_doc('Quotation', new_quotation)
- for fieldname in ['customer', 'company', 'order_type', 'total', 'grand_total']:
+ for fieldname in ['customer', 'company', 'order_type', 'total', 'net_total']:
self.assertEquals(quotation.get(fieldname), new_quotation.get(fieldname))
for fieldname in ['item_code', 'qty', 'rate', 'amount']:
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
index 5ad7970..ee5b3c9 100644
--- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -11,7 +11,10 @@
class TestTaxRule(unittest.TestCase):
def setUp(self):
- frappe.db.sql("delete from `tabTax Rule` where use_for_shopping_cart <> 1")
+ frappe.db.sql("delete from `tabTax Rule`")
+
+ def tearDown(self):
+ frappe.db.sql("delete from `tabTax Rule`")
def test_conflict(self):
tax_rule1 = make_tax_rule(customer= "_Test Customer",
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index b72a669..06b1a61 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -44,7 +44,7 @@
})
columns += [_("Age (Days)") + ":Int:80"]
-
+
self.ageing_col_idx_start = len(columns)
if not "range1" in self.filters:
@@ -53,7 +53,7 @@
self.filters["range2"] = "60"
if not "range3" in self.filters:
self.filters["range3"] = "90"
-
+
for label in ("0-{range1}".format(range1=self.filters["range1"]),
"{range1}-{range2}".format(range1=cint(self.filters["range1"])+ 1, range2=self.filters["range2"]),
"{range2}-{range3}".format(range2=cint(self.filters["range2"])+ 1, range3=self.filters["range3"]),
@@ -74,14 +74,14 @@
})
if args.get("party_type") == "Customer":
columns += [
- _("Territory") + ":Link/Territory:80",
+ _("Territory") + ":Link/Territory:80",
_("Customer Group") + ":Link/Customer Group:120"
]
if args.get("party_type") == "Supplier":
columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
-
+
columns.append(_("Remarks") + "::200")
-
+
return columns
def get_data(self, party_naming_by, args):
@@ -97,13 +97,13 @@
self.filters["company"] = frappe.db.get_single_value('Global Defaults', 'default_company')
company_currency = frappe.db.get_value("Company", self.filters.get("company"), "default_currency")
-
+
return_entries = self.get_return_entries(args.get("party_type"))
data = []
for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")):
if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers):
- outstanding_amount, credit_note_amount = self.get_outstanding_amount(gle,
+ outstanding_amount, credit_note_amount = self.get_outstanding_amount(gle,
self.filters.report_date, dr_or_cr, return_entries, currency_precision)
if abs(outstanding_amount) > 0.1/10**currency_precision:
row = [gle.posting_date, gle.party]
@@ -178,15 +178,15 @@
# entries adjusted with future vouchers
((gle.against_voucher_type, gle.against_voucher) in future_vouchers)
)
-
+
def get_return_entries(self, party_type):
doctype = "Sales Invoice" if party_type=="Customer" else "Purchase Invoice"
- return [d.name for d in frappe.get_all(doctype, filters={"is_return": 1, "docstatus": 1})]
+ return [d.name for d in frappe.get_all(doctype, filters={"is_return": 1, "docstatus": 1})]
def get_outstanding_amount(self, gle, report_date, dr_or_cr, return_entries, currency_precision):
payment_amount, credit_note_amount = 0.0, 0.0
reverse_dr_or_cr = "credit" if dr_or_cr=="debit" else "debit"
-
+
for e in self.get_gl_entries_for(gle.party, gle.party_type, gle.voucher_type, gle.voucher_no):
if getdate(e.posting_date) <= report_date and e.name!=gle.name \
and (not gle.due_date or getdate(e.due_date) == getdate(gle.due_date)):
@@ -195,11 +195,11 @@
payment_amount += amount
else:
credit_note_amount += amount
-
+
outstanding_amount = flt((flt(gle.get(dr_or_cr)) - flt(gle.get(reverse_dr_or_cr)) \
- payment_amount - credit_note_amount), currency_precision)
credit_note_amount = flt(credit_note_amount, currency_precision)
-
+
return outstanding_amount, credit_note_amount
def get_party_name(self, party_type, party_name):
@@ -207,7 +207,7 @@
def get_territory(self, party_name):
return self.get_party_map("Customer").get(party_name, {}).get("territory") or ""
-
+
def get_customer_group(self, party_name):
return self.get_party_map("Customer").get(party_name, {}).get("customer_group") or ""
@@ -220,7 +220,7 @@
select_fields = "name, customer_name, territory, customer_group"
elif party_type == "Supplier":
select_fields = "name, supplier_name, supplier_type"
-
+
self.party_map = dict(((r.name, r) for r in frappe.db.sql("select {0} from `tab{1}`"
.format(select_fields, party_type), as_dict=True)))
@@ -277,13 +277,13 @@
if party_type_field=="customer":
if self.filters.get("customer_group"):
- lft, rgt = frappe.db.get_value("Customer Group",
+ lft, rgt = frappe.db.get_value("Customer Group",
self.filters.get("customer_group"), ["lft", "rgt"])
-
- conditions.append("""party in (select name from tabCustomer
- where exists(select name from `tabCustomer Group` where lft >= {0} and rgt <= {1}
+
+ conditions.append("""party in (select name from tabCustomer
+ where exists(select name from `tabCustomer Group` where lft >= {0} and rgt <= {1}
and name=tabCustomer.customer_group))""".format(lft, rgt))
-
+
if self.filters.get("credit_days_based_on"):
conditions.append("party in (select name from tabCustomer where credit_days_based_on=%s)")
values.append(self.filters.get("credit_days_based_on"))
@@ -303,22 +303,22 @@
return self.gl_entries_map.get(party, {})\
.get(against_voucher_type, {})\
.get(against_voucher, [])
-
+
def get_chart_data(self, columns, data):
ageing_columns = columns[self.ageing_col_idx_start : self.ageing_col_idx_start+4]
-
+
rows = []
for d in data:
rows.append(d[self.ageing_col_idx_start : self.ageing_col_idx_start+4])
if rows:
rows.insert(0, [[d.get("label")] for d in ageing_columns])
-
+
return {
"data": {
- 'rows': rows
+ 'labels': rows
},
- "chart_type": 'pie'
+ "type": 'percentage'
}
def execute(filters=None):
diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py
index 2db4ef8..18b07ea 100644
--- a/erpnext/accounts/report/balance_sheet/balance_sheet.py
+++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py
@@ -8,18 +8,18 @@
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
def execute(filters=None):
- period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
+ period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
filters.periodicity, company=filters.company)
- asset = get_data(filters.company, "Asset", "Debit", period_list,
+ asset = get_data(filters.company, "Asset", "Debit", period_list,
only_current_fiscal_year=False, filters=filters,
accumulated_values=filters.accumulated_values)
-
- liability = get_data(filters.company, "Liability", "Credit", period_list,
+
+ liability = get_data(filters.company, "Liability", "Credit", period_list,
only_current_fiscal_year=False, filters=filters,
accumulated_values=filters.accumulated_values)
-
- equity = get_data(filters.company, "Equity", "Credit", period_list,
+
+ equity = get_data(filters.company, "Equity", "Credit", period_list,
only_current_fiscal_year=False, filters=filters,
accumulated_values=filters.accumulated_values)
@@ -43,17 +43,17 @@
unclosed[period.key] = opening_balance
if provisional_profit_loss:
provisional_profit_loss[period.key] = provisional_profit_loss[period.key] - opening_balance
-
+
unclosed["total"]=opening_balance
data.append(unclosed)
-
+
if provisional_profit_loss:
data.append(provisional_profit_loss)
if total_credit:
- data.append(total_credit)
+ data.append(total_credit)
columns = get_columns(filters.periodicity, period_list, filters.accumulated_values, company=filters.company)
-
+
chart = get_chart_data(filters, columns, asset, liability, equity)
return columns, data, message, chart
@@ -87,7 +87,7 @@
total += flt(provisional_profit_loss[period.key])
provisional_profit_loss["total"] = total
-
+
total_row_total += flt(total_row[period.key])
total_row["total"] = total_row_total
@@ -98,7 +98,7 @@
"warn_if_negative": True,
"currency": currency
})
-
+
return provisional_profit_loss, total_row
def check_opening_balance(asset, liability, equity):
@@ -111,17 +111,17 @@
opening_balance -= flt(liability[0].get("opening_balance", 0), float_precision)
if equity:
opening_balance -= flt(equity[0].get("opening_balance", 0), float_precision)
-
+
opening_balance = flt(opening_balance, float_precision)
if opening_balance:
return _("Previous Financial Year is not closed"),opening_balance
return None,None
-
+
def get_chart_data(filters, columns, asset, liability, equity):
- x_intervals = ['x'] + [d.get("label") for d in columns[2:]]
-
+ labels = [d.get("label") for d in columns[2:]]
+
asset_data, liability_data, equity_data = [], [], []
-
+
for p in columns[2:]:
if asset:
asset_data.append(asset[-2].get(p.get("fieldname")))
@@ -129,23 +129,25 @@
liability_data.append(liability[-2].get(p.get("fieldname")))
if equity:
equity_data.append(equity[-2].get(p.get("fieldname")))
-
- columns = [x_intervals]
+
+ datasets = []
if asset_data:
- columns.append(["Assets"] + asset_data)
+ datasets.append({'title':'Assets', 'values': asset_data})
if liability_data:
- columns.append(["Liabilities"] + liability_data)
+ datasets.append({'title':'Liabilities', 'values': liability_data})
if equity_data:
- columns.append(["Equity"] + equity_data)
+ datasets.append({'title':'Equity', 'values': equity_data})
chart = {
"data": {
- 'x': 'x',
- 'columns': columns
+ 'labels': labels,
+ 'datasets': datasets
}
}
if not filters.accumulated_values:
- chart["chart_type"] = "bar"
+ chart["type"] = "bar"
+ else:
+ chart["type"] = "line"
return chart
\ No newline at end of file
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py
index 07f6979..78e3faa 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.py
+++ b/erpnext/accounts/report/gross_profit/gross_profit.py
@@ -107,6 +107,8 @@
def process(self):
self.grouped = {}
+ self.grouped_data = []
+
for row in self.si_list:
if self.skip_row(row, self.product_bundles):
continue
@@ -150,7 +152,6 @@
def get_average_rate_based_on_group_by(self):
# sum buying / selling totals for group
- self.grouped_data = []
for key in self.grouped.keys():
if self.filters.get("group_by") != "Invoice":
for i, row in enumerate(self.grouped[key]):
diff --git a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
index 6729d67..89ee63a 100644
--- a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
+++ b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
@@ -8,15 +8,15 @@
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
def execute(filters=None):
- period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
+ period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
filters.periodicity, filters.accumulated_values, filters.company)
income = get_data(filters.company, "Income", "Credit", period_list, filters = filters,
- accumulated_values=filters.accumulated_values,
+ accumulated_values=filters.accumulated_values,
ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
-
+
expense = get_data(filters.company, "Expense", "Debit", period_list, filters=filters,
- accumulated_values=filters.accumulated_values,
+ accumulated_values=filters.accumulated_values,
ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
net_profit_loss = get_net_profit_loss(income, expense, period_list, filters.company)
@@ -61,7 +61,7 @@
def get_chart_data(filters, columns, income, expense, net_profit_loss):
- x_intervals = ['x'] + [d.get("label") for d in columns[2:]]
+ labels = [d.get("label") for d in columns[2:]]
income_data, expense_data, net_profit = [], [], []
@@ -73,27 +73,24 @@
if net_profit_loss:
net_profit.append(net_profit_loss.get(p.get("fieldname")))
- columns = [x_intervals]
+ datasets = []
if income_data:
- columns.append(["Income"] + income_data)
+ datasets.append({'title': 'Income', 'values': income_data})
if expense_data:
- columns.append(["Expense"] + expense_data)
+ datasets.append({'title': 'Expense', 'values': expense_data})
if net_profit:
- columns.append(["Net Profit/Loss"] + net_profit)
+ datasets.append({'title': 'Net Profit/Loss', 'values': net_profit})
chart = {
"data": {
- 'x': 'x',
- 'columns': columns,
- 'colors': {
- 'Income': '#5E64FF',
- 'Expense': '#b8c2cc',
- 'Net Profit/Loss': '#ff5858'
- }
+ 'labels': labels,
+ 'datasets': datasets
}
}
if not filters.accumulated_values:
- chart["chart_type"] = "bar"
+ chart["type"] = "bar"
+ else:
+ chart["type"] = "line"
return chart
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index e3e5b80..864a96b 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -3551,7 +3551,7 @@
"istable": 0,
"max_attachments": 0,
"modified": "2017-10-05 14:19:04.102534",
- "modified_by": "Administrator",
+ "modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
"owner": "Administrator",
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
index 44068ce..50d6abd 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
@@ -816,7 +816,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-07-21 14:06:46.309322",
+ "modified": "2017-10-17 17:27:06.281494",
"modified_by": "Administrator",
"module": "Buying",
"name": "Request for Quotation",
@@ -909,26 +909,6 @@
"cancel": 0,
"create": 0,
"delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Supplier",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index 6548591..ce6c0c3 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -1,3 +1,5 @@
+# coding=utf-8
+
from __future__ import unicode_literals
from frappe import _
@@ -284,4 +286,12 @@
"link": "data-import-tool",
"label": _("Data Import Tool")
},
+ {
+ "module_name": "Restaurant",
+ "color": "#EA81E8",
+ "icon": "🍔",
+ "_doctype": "Restaurant",
+ "link": "List/Restaurant",
+ "label": _("Restaurant")
+ }
]
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index c538f79..e463b46 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -109,6 +109,9 @@
self.set(fieldname, today())
break
+ # set taxes table if missing from `taxes_and_charges`
+ self.set_taxes()
+
def calculate_taxes_and_totals(self):
from erpnext.controllers.taxes_and_totals import calculate_taxes_and_totals
calculate_taxes_and_totals(self)
@@ -285,9 +288,9 @@
if not account_currency:
account_currency = get_account_currency(gl_dict.account)
- if gl_dict.account and self.doctype not in ["Journal Entry",
+ if gl_dict.account and self.doctype not in ["Journal Entry",
"Period Closing Voucher", "Payment Entry"]:
-
+
self.validate_account_currency(gl_dict.account, account_currency)
set_balance_in_account_currency(gl_dict, account_currency, self.get("conversion_rate"), self.company_currency)
diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index 513b97f..8ca4f70 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -205,9 +205,10 @@
if item.variant_based_on=='Item Attribute':
if variant.attributes:
- variant.description += "\n"
- for d in variant.attributes:
- variant.description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
+ if not variant.description:
+ variant.description += "\n"
+ for d in variant.attributes:
+ variant.description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
def make_variant_item_code(template_item_code, template_item_name, variant):
"""Uses template's item code and abbreviations to make variant's item code"""
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 7ada8cc..b1618d5 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -165,6 +165,7 @@
and (tabItem.`{key}` LIKE %(txt)s
or tabItem.item_group LIKE %(txt)s
or tabItem.item_name LIKE %(txt)s
+ or tabItem.barcode LIKE %(txt)s
or tabItem.description LIKE %(txt)s)
{fcond} {mcond}
order by
@@ -172,7 +173,8 @@
if(locate(%(_txt)s, item_name), locate(%(_txt)s, item_name), 99999),
idx desc,
name, item_name
- limit %(start)s, %(page_len)s """.format(key=searchfield,
+ limit %(start)s, %(page_len)s """.format(
+ key=searchfield,
fcond=get_filters_cond(doctype, filters, conditions).replace('%', '%%'),
mcond=get_match_cond(doctype).replace('%', '%%')),
{
diff --git a/erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.js b/erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.js
index d9c4c8b..cdfdad1 100644
--- a/erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.js
+++ b/erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.js
@@ -21,23 +21,13 @@
get_chart_data: function (columns, result) {
return {
data: {
- x: 'Date',
- columns: [
- ['Date'].concat($.map(result, function (d) { return d[0]; })),
- ['Mins to first response'].concat($.map(result, function (d) { return d[1]; }))
- ]
- // rows: [['Date', 'Mins to first response']].concat(result)
+ labels: result.map(d => d[0]),
+ datasets: [{
+ title: 'Mins to first response',
+ values: result.map(d => d[1])
+ }]
},
- axis: {
- x: {
- type: 'timeseries',
- tick: {
- format: frappe.ui.py_date_format
- }
- }
- },
- chart_type: 'line',
-
+ type: 'line',
}
}
}
diff --git a/erpnext/docs/assets/img/restaurant/order-entry-bill.png b/erpnext/docs/assets/img/restaurant/order-entry-bill.png
new file mode 100644
index 0000000..ba96bb3
--- /dev/null
+++ b/erpnext/docs/assets/img/restaurant/order-entry-bill.png
Binary files differ
diff --git a/erpnext/docs/assets/img/restaurant/order-entry.png b/erpnext/docs/assets/img/restaurant/order-entry.png
new file mode 100644
index 0000000..2fc3e78
--- /dev/null
+++ b/erpnext/docs/assets/img/restaurant/order-entry.png
Binary files differ
diff --git a/erpnext/docs/assets/img/restaurant/reservation-kanban.png b/erpnext/docs/assets/img/restaurant/reservation-kanban.png
new file mode 100644
index 0000000..df9517d
--- /dev/null
+++ b/erpnext/docs/assets/img/restaurant/reservation-kanban.png
Binary files differ
diff --git a/erpnext/docs/assets/img/restaurant/restaurant-invoice.png b/erpnext/docs/assets/img/restaurant/restaurant-invoice.png
new file mode 100644
index 0000000..9f01dfc
--- /dev/null
+++ b/erpnext/docs/assets/img/restaurant/restaurant-invoice.png
Binary files differ
diff --git a/erpnext/docs/assets/img/restaurant/restaurant-menu.png b/erpnext/docs/assets/img/restaurant/restaurant-menu.png
new file mode 100644
index 0000000..e1d85a9
--- /dev/null
+++ b/erpnext/docs/assets/img/restaurant/restaurant-menu.png
Binary files differ
diff --git a/erpnext/docs/assets/img/restaurant/restaurant-reservation.png b/erpnext/docs/assets/img/restaurant/restaurant-reservation.png
new file mode 100644
index 0000000..3467bc0
--- /dev/null
+++ b/erpnext/docs/assets/img/restaurant/restaurant-reservation.png
Binary files differ
diff --git a/erpnext/docs/assets/img/restaurant/restaurant-table.png b/erpnext/docs/assets/img/restaurant/restaurant-table.png
new file mode 100644
index 0000000..b7ec1d0
--- /dev/null
+++ b/erpnext/docs/assets/img/restaurant/restaurant-table.png
Binary files differ
diff --git a/erpnext/docs/assets/img/restaurant/restaurant.png b/erpnext/docs/assets/img/restaurant/restaurant.png
new file mode 100644
index 0000000..1e4e47a
--- /dev/null
+++ b/erpnext/docs/assets/img/restaurant/restaurant.png
Binary files differ
diff --git a/erpnext/docs/user/manual/en/accounts/credit-limit.md b/erpnext/docs/user/manual/en/accounts/credit-limit.md
index 8f92f90..b48ae56 100644
--- a/erpnext/docs/user/manual/en/accounts/credit-limit.md
+++ b/erpnext/docs/user/manual/en/accounts/credit-limit.md
@@ -16,7 +16,9 @@
<img class="screenshot" alt="Credit Limit" src="/docs/assets/img/accounts/credit-limit-1.png">
-Go to the 'More Info section' and enter the amount in the field Credit Limit.
+Go to the 'CREDIT LIMIT' section and enter the amount in the field Credit Limit.
+
+If you leave CREDIT LIMIT as 0.00, it has no effect.
In case a need arises to allow more credit to the customer as a good-will, the
Credit Controller has access to submit order even if credit limit is crossed.
@@ -26,6 +28,25 @@
In the field Credit Controller, select the role who would be authorized to
accept orders or raise credit limits of customers.
+
+To set credit limit at Customer Group Level go to Selling -> Customers -> Customer Group
+
+Go to the 'CREDIT LIMIT' field and enter the amount.
+If you leave CREDIT LIMIT as 0.00, it has no effect.
+
+
+To set credit limit at Company level go to Account -> Company
+
+Go to the 'ACCOUNT SETTINGS' section and enter the amount in the CREDIT LIMIT field.
+If you leave CREDIT LIMIT as 0.00, it has no effect.
+
+For 'CREDIT LIMIT' check functionality, Priority (High to Low) is as below
+1) Customer
+2) Customer Group
+3) Company
+
+
+
#### Figure 2: Credit Controller
diff --git a/erpnext/docs/user/manual/en/hospitality/index.md b/erpnext/docs/user/manual/en/hospitality/index.md
new file mode 100644
index 0000000..efd7377
--- /dev/null
+++ b/erpnext/docs/user/manual/en/hospitality/index.md
@@ -0,0 +1,9 @@
+# Hospitality
+
+ERPNext Hospitality module is designed to handle workflows for Hotels and Restaurants. This is still in early development stage.
+
+### Manage Restaurants
+
+The Restaurant module in ERPNext will help you manage a chain of restaurants. You can create Restaurants, Menus, Tables, Reservations and a manage Order Entry and Billing.
+
+{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/hospitality/index.txt b/erpnext/docs/user/manual/en/hospitality/index.txt
new file mode 100644
index 0000000..cbe6da0
--- /dev/null
+++ b/erpnext/docs/user/manual/en/hospitality/index.txt
@@ -0,0 +1,4 @@
+restaurant
+restaurant-menu
+reservations
+order-entry
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/hospitality/order-entry.md b/erpnext/docs/user/manual/en/hospitality/order-entry.md
new file mode 100644
index 0000000..929cfd8
--- /dev/null
+++ b/erpnext/docs/user/manual/en/hospitality/order-entry.md
@@ -0,0 +1,26 @@
+# Restaurant Order Entry
+
+The Restaurant Order Entry is the screen where the waiters will punch in orders related to a particular table.
+
+This screen makes it easy for the waiters in your restaurant to punch in orders from various tables.
+
+When the guest places an order, the waiter will select the table number and add the items in the Order Entry. This can be changed until it is time for the bill. Unless you bill a table, you can change the items and they will automatically appear when you select the table ID.
+
+To place an order you can select an item and click the enter key so that the item will be updated in the items table.
+
+<img class="screenshot" alt="Order Entry" src="/docs/assets/img/restaurant/order-entry.png">
+
+You can also choose items with the POS style item selector.
+
+### Billing
+
+When it is time for billing, you just choose the bill and you can select the customer and mode of payment. On saving, a Sales Invoice is generated and the order section becomes empty.
+
+<img class="screenshot" alt="Order Entry" src="/docs/assets/img/restaurant/order-entry-bill.png">
+
+### Sales Invoice
+
+To print the invoice, you can click on the Invoice Link and print the invoice
+
+<img class="screenshot" alt="Sales Invoice" src="/docs/assets/img/restaurant/restaurant-invoice.png">
+
diff --git a/erpnext/docs/user/manual/en/hospitality/reservations.md b/erpnext/docs/user/manual/en/hospitality/reservations.md
new file mode 100644
index 0000000..0d4a8ab
--- /dev/null
+++ b/erpnext/docs/user/manual/en/hospitality/reservations.md
@@ -0,0 +1,13 @@
+# Restaurant Reservations
+
+Once you have setup the restaurant and tables, you can start taking in reservations for your restaurant.
+
+To take a reservation, just make a new Restaurant Reservation from the Restaurant Page and set the time, number of people and name of the guest.
+
+<img class="screenshot" alt="Reservation" src="/docs/assets/img/restaurant/reservation.png">
+
+### Kanban
+
+As your guests walk in, You can also manage the reservations by making a simple Kanban board for the same.
+
+<img class="screenshot" alt="Reservation Kanban Board" src="/docs/assets/img/restaurant/reservation-kanban.png">
diff --git a/erpnext/docs/user/manual/en/hospitality/restaurant-menu.md b/erpnext/docs/user/manual/en/hospitality/restaurant-menu.md
new file mode 100644
index 0000000..dfbf4ce
--- /dev/null
+++ b/erpnext/docs/user/manual/en/hospitality/restaurant-menu.md
@@ -0,0 +1,7 @@
+# Restaurant Menu
+
+For every restaurant you must set an active Restaurant Menu from which orders can be placed. You can also set the rates for each of the item for the day.
+
+When you save the Restaurant Menu, a Price List is created for that Menu and all pricing is linked to that price list. This way you can easily control the items on offer and pricing from the menu.
+
+<img class="screenshot" alt="Restaurant Menu" src="/docs/assets/img/restaurant/restaurant-menu.png">
diff --git a/erpnext/docs/user/manual/en/hospitality/restaurant.md b/erpnext/docs/user/manual/en/hospitality/restaurant.md
new file mode 100644
index 0000000..7b72318
--- /dev/null
+++ b/erpnext/docs/user/manual/en/hospitality/restaurant.md
@@ -0,0 +1,19 @@
+# Restaurant
+
+The Restaurant record represents one restaurant in your organization. To create a new Restaurant, just set the name, Company and Default Customer.
+
+You can set a unique numbering prefix for each of your restaurants. All invoices for that restuarant will follow that numbering prefix.
+
+If you have a default Sales Taxes and Charges Template, you can add it so that the same charge + tax will be applicable for all invoices in the restaurant.
+
+<img class="screenshot" alt="Restaurant" src="/docs/assets/img/restaurant/restaurant.png">
+
+After your restaurant is created, you can add Tables and Menus for that restaurant
+
+### Adding Tables
+
+You can add a Restaurant Table by creating a new Restaurant Table from the dashboard.
+
+<img class="screenshot" alt="Restaurant Table" src="/docs/assets/img/restaurant/restaurant-table.png">
+
+
diff --git a/erpnext/docs/user/manual/en/introduction/concepts-and-terms.md b/erpnext/docs/user/manual/en/introduction/concepts-and-terms.md
index 3a51286..c53bef9 100644
--- a/erpnext/docs/user/manual/en/introduction/concepts-and-terms.md
+++ b/erpnext/docs/user/manual/en/introduction/concepts-and-terms.md
@@ -97,8 +97,8 @@
A Cost Center is like an Account, but the only difference is that its
structure represents your business more closely than Accounts.
-For example, in your Chart of Accounts, you can separate your expenses by its type
-(i.e., travel, marketing, etc.). In your Chart of Cost Centers, you can separate
+For example, in your Chart of Accounts, you can separate your expenses by its type
+(i.e., travel, marketing, etc.). In your Chart of Cost Centers, you can separate
them by product line or business group (e.g., online sales, retail sales, etc.).
> Accounts > Chart of Cost Centers
@@ -316,7 +316,7 @@
#### Salary Structure
-A template identifying all the components of an Employees' salary (earnings),
+A template identifying all the components of an Employees' salary (earnings),
tax and other social security deductions.
> Human Resource > Salary and Payroll > Salary Structure
diff --git a/erpnext/docs/user/manual/en/introduction/getting-started-with-erpnext.md b/erpnext/docs/user/manual/en/introduction/getting-started-with-erpnext.md
index 4aae00e..634bb43 100644
--- a/erpnext/docs/user/manual/en/introduction/getting-started-with-erpnext.md
+++ b/erpnext/docs/user/manual/en/introduction/getting-started-with-erpnext.md
@@ -1,7 +1,3 @@
-# Getting Started With Erpnext
-
-<!-- Getting Started with ERPNext-->
-
# Getting Started with ERPNext
There are many ways to get started with ERPNext.
diff --git a/erpnext/docs/user/manual/en/introduction/the-champion.md b/erpnext/docs/user/manual/en/introduction/the-champion.md
index 57086cb..fca349e 100644
--- a/erpnext/docs/user/manual/en/introduction/the-champion.md
+++ b/erpnext/docs/user/manual/en/introduction/the-champion.md
@@ -1,9 +1,5 @@
# The Champion
-<!-- no-heading -->
-
-<h1 class="white">The Champion</h1>
-
<img alt="Champion" class="screenshot" src="/docs/assets/img/setup/implementation-image.png">
We have seen dozens of ERP implementations over the past few years and we
diff --git a/erpnext/docs/user/manual/en/subscription/index.md b/erpnext/docs/user/manual/en/subscription/index.md
deleted file mode 100644
index 24d75ed..0000000
--- a/erpnext/docs/user/manual/en/subscription/index.md
+++ /dev/null
@@ -1,22 +0,0 @@
-If you have a contract with the Customer where your organization gives bill to the Customer on a monthly, quarterly, half-yearly or annual basis, you can use subscription feature to make auto invoicing.
-
-<img class="screenshot" alt="Subscription" src="{{docs_base_url}}/assets/img/subscription/subscription.png">
-
-#### Scenario
-
-Subscription for your hosted ERPNext account requires yearly renewal. We use Sales Invoice for generating proforma invoices. To automate proforma invoicing for renewal, we set original Sales Invoice on the subscription form. Recurring proforma invoice is created automatically just before customer's account is about to expire, and requires renewal. This recurring Proforma Invoice is also emailed automatically to the customer.
-
-To set the subscription for the sales invoice
-Goto Subscription > select base doctype "Sales Invoice" > select base docname "Invoice No" > Save
-
-<img class="screenshot" alt="Subscription" src="{{docs_base_url}}/assets/img/subscription/subscription.gif">
-
-**From Date and To Date**: This defines contract period with the customer.
-
-**Repeat on Day**: If frequency is set as Monthly, then it will be day of the month on which recurring invoice will be generated.
-
-**Notify By Email**: If you want to notify the user about auto recurring invoice.
-
-**Print Format**: Select a print format to define document view which should be emailed to customer.
-
-**Disabled**: It will stop to make auto recurring documents against the subscription
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/subscription/index.txt b/erpnext/docs/user/manual/en/subscription/index.txt
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/docs/user/manual/en/subscription/index.txt
+++ /dev/null
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/domains/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/subscription/__init__.py
rename to erpnext/domains/__init__.py
diff --git a/erpnext/domains/distribution.py b/erpnext/domains/distribution.py
new file mode 100644
index 0000000..020ab3b
--- /dev/null
+++ b/erpnext/domains/distribution.py
@@ -0,0 +1,18 @@
+data = {
+ 'desktop_icons': [
+ 'Item',
+ 'Customer',
+ 'Supplier',
+ 'Lead',
+ 'Sales Order',
+ 'Purchase Order',
+ 'Task',
+ 'Sales Invoice',
+ 'CRM',
+ 'ToDo'
+ ],
+ 'set_value': [
+ ['Stock Settings', None, 'show_barcode_field', 1]
+ ],
+ 'default_portal_role': 'Customer'
+}
diff --git a/erpnext/domains/education.py b/erpnext/domains/education.py
new file mode 100644
index 0000000..7a86c76
--- /dev/null
+++ b/erpnext/domains/education.py
@@ -0,0 +1,37 @@
+data = {
+ 'desktop_icons': [
+ 'Student',
+ 'Program',
+ 'Course',
+ 'Student Group',
+ 'Instructor',
+ 'Fees',
+ 'Task',
+ 'ToDo',
+ 'Schools'
+ ],
+ 'default_portal_role': 'Student',
+ 'restricted_roles': [
+ 'Student',
+ 'Instructor',
+ 'Academics User'
+ ],
+ 'modules': [
+ 'Schools'
+ ],
+ 'fixtures': [
+ dict(doctype='Academic Year', academic_year_name='2013-14'),
+ dict(doctype='Academic Year', academic_year_name='2014-15'),
+ dict(doctype='Academic Year', academic_year_name='2015-16'),
+ dict(doctype='Academic Year', academic_year_name='2016-17'),
+ dict(doctype='Academic Year', academic_year_name='2017-18'),
+ dict(doctype='Academic Year', academic_year_name='2018-19'),
+ dict(doctype='Academic Year', academic_year_name='2019-20'),
+ dict(doctype='Academic Term', academic_year='2016-17', term_name='Semester 1'),
+ dict(doctype='Academic Term', academic_year='2016-17', term_name='Semester 2'),
+ dict(doctype='Academic Term', academic_year='2016-17', term_name='Semester 3'),
+ dict(doctype='Academic Term', academic_year='2017-18', term_name='Semester 1'),
+ dict(doctype='Academic Term', academic_year='2017-18', term_name='Semester 2'),
+ dict(doctype='Academic Term', academic_year='2017-18', term_name='Semester 3')
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/domains/healthcare.py b/erpnext/domains/healthcare.py
new file mode 100644
index 0000000..3c54b01
--- /dev/null
+++ b/erpnext/domains/healthcare.py
@@ -0,0 +1,29 @@
+data = {
+ 'desktop_icons': [
+ 'Patient',
+ 'Patient Appointment',
+ 'Consultation',
+ 'Lab Test',
+ 'Healthcare',
+ 'Accounts',
+ 'Buying',
+ 'Stock',
+ 'HR',
+ 'ToDo'
+ ],
+ 'default_portal_role': 'Patient',
+ 'restricted_roles': [
+ 'Healthcare Administrator',
+ 'LabTest Approver',
+ 'Laboratory User',
+ 'Nursing User',
+ 'Physician',
+ 'Patient'
+ ],
+ 'custom_fields': {
+ 'Sales Invoice': dict(fieldname='appointment', label='Patient Appointment',
+ fieldtype='Link', options='Patient Appointment',
+ insert_after='customer')
+ },
+ 'on_setup': 'erpnext.healthcare.setup.setup_healthcare'
+}
\ No newline at end of file
diff --git a/erpnext/domains/hospitality.py b/erpnext/domains/hospitality.py
new file mode 100644
index 0000000..bc55d9c
--- /dev/null
+++ b/erpnext/domains/hospitality.py
@@ -0,0 +1,32 @@
+data = {
+ 'desktop_icons': [
+ 'Restaurant',
+ 'Accounts',
+ 'Buying',
+ 'Stock',
+ 'HR',
+ 'Project',
+ 'ToDo'
+ ],
+ 'restricted_roles': [
+ 'Restaurant Manager'
+ ],
+ 'custom_fields': {
+ 'Sales Invoice': [
+ {
+ 'fieldname': 'restaurant', 'fieldtype': 'Link', 'options': 'Restaurant',
+ 'insert_after': 'customer_name', 'label': 'Restaurant',
+ },
+ {
+ 'fieldname': 'restaurant_table', 'fieldtype': 'Link', 'options': 'Restaurant Table',
+ 'insert_after': 'restaurant', 'label': 'Restaurant Table',
+ }
+ ],
+ 'Price List': [
+ {
+ 'fieldname':'restaurant_menu', 'fieldtype':'Link', 'options':'Restaurant Menu', 'label':'Restaurant Menu',
+ 'insert_after':'currency'
+ }
+ ]
+ }
+}
diff --git a/erpnext/domains/manufacturing.py b/erpnext/domains/manufacturing.py
new file mode 100644
index 0000000..b8bb7e0
--- /dev/null
+++ b/erpnext/domains/manufacturing.py
@@ -0,0 +1,25 @@
+data = {
+ 'desktop_icons': [
+ 'Item',
+ 'BOM',
+ 'Customer',
+ 'Supplier',
+ 'Sales Order',
+ 'Purchase Order',
+ 'Production Order',
+ 'Task',
+ 'Accounts',
+ 'HR',
+ 'ToDo'
+ ],
+ 'properties': [
+ {'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'collapsible_depends_on', 'value': 'is_stock_item'},
+ ],
+ 'set_value': [
+ ['Stock Settings', None, 'show_barcode_field', 1]
+ ],
+ 'restricted_roles': [
+ 'Manufacturing User'
+ ],
+ 'default_portal_role': 'Customer'
+}
\ No newline at end of file
diff --git a/erpnext/domains/retail.py b/erpnext/domains/retail.py
new file mode 100644
index 0000000..1bfd65f
--- /dev/null
+++ b/erpnext/domains/retail.py
@@ -0,0 +1,20 @@
+data = {
+ 'desktop_icons': [
+ 'POS',
+ 'Item',
+ 'Customer',
+ 'Sales Invoice',
+ 'Purchase Order',
+ 'Accounts',
+ 'Task',
+ 'ToDo'
+ ],
+ 'properties': [
+ {'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'hidden', 'value': 1},
+ {'doctype': 'Customer', 'fieldname': 'credit_limit_section', 'property': 'hidden', 'value': 1},
+ ],
+ 'set_value': [
+ ['Stock Settings', None, 'show_barcode_field', 1]
+ ],
+ 'default_portal_role': 'Customer'
+}
diff --git a/erpnext/domains/services.py b/erpnext/domains/services.py
new file mode 100644
index 0000000..1fb0e19
--- /dev/null
+++ b/erpnext/domains/services.py
@@ -0,0 +1,19 @@
+data = {
+ 'desktop_icons': [
+ 'Project',
+ 'Timesheet',
+ 'Customer',
+ 'Sales Order',
+ 'Sales Invoice',
+ 'CRM',
+ 'Task',
+ 'Expense Claim',
+ 'Employee',
+ 'HR',
+ 'ToDo'
+ ],
+ 'set_value': [
+ ['Stock Settings', None, 'show_barcode_field', 0]
+ ],
+ 'default_portal_role': 'Customer'
+}
\ No newline at end of file
diff --git a/erpnext/healthcare/doctype/appointment_type/appointment_type.json b/erpnext/healthcare/doctype/appointment_type/appointment_type.json
index 4b34892..9d331fa 100644
--- a/erpnext/healthcare/doctype/appointment_type/appointment_type.json
+++ b/erpnext/healthcare/doctype/appointment_type/appointment_type.json
@@ -22,7 +22,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -62,11 +62,11 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -83,7 +83,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:46:57.142289",
+ "modified": "2017-10-05 11:07:26.369657",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Appointment Type",
diff --git a/erpnext/healthcare/doctype/codification_table/codification_table.json b/erpnext/healthcare/doctype/codification_table/codification_table.json
index c411778..7818a42 100644
--- a/erpnext/healthcare/doctype/codification_table/codification_table.json
+++ b/erpnext/healthcare/doctype/codification_table/codification_table.json
@@ -21,7 +21,7 @@
"fieldname": "medical_code",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -53,7 +53,7 @@
"fieldtype": "Read Only",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -84,7 +84,7 @@
"fieldtype": "Read Only",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -116,7 +116,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 14:06:50.281545",
+ "modified": "2017-10-04 17:07:22.880451",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Codification Table",
diff --git a/erpnext/healthcare/doctype/complaint/complaint.json b/erpnext/healthcare/doctype/complaint/complaint.json
index 0899a39..f600838 100644
--- a/erpnext/healthcare/doctype/complaint/complaint.json
+++ b/erpnext/healthcare/doctype/complaint/complaint.json
@@ -23,7 +23,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -54,7 +54,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:44:31.848346",
+ "modified": "2017-10-05 11:18:42.017864",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Complaint",
diff --git a/erpnext/healthcare/doctype/consultation/consultation.json b/erpnext/healthcare/doctype/consultation/consultation.json
index 70482cb..400703a 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.json
+++ b/erpnext/healthcare/doctype/consultation/consultation.json
@@ -63,11 +63,11 @@
"options": "C-",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -83,7 +83,7 @@
"fieldname": "appointment",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -114,7 +114,7 @@
"fieldname": "type",
"fieldtype": "Link",
"hidden": 1,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -122,15 +122,15 @@
"in_standard_filter": 0,
"label": "Type",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Appointment Type",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -145,12 +145,12 @@
"fieldname": "patient",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Patient",
"length": 0,
"no_copy": 0,
@@ -188,11 +188,11 @@
"options": "",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -219,11 +219,11 @@
"options": "\nMale\nFemale",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -243,7 +243,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Doctor",
"length": 0,
"no_copy": 0,
@@ -329,12 +329,12 @@
"fieldname": "visit_department",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Department",
"length": 0,
"no_copy": 0,
@@ -347,7 +347,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -430,7 +430,7 @@
"in_standard_filter": 0,
"label": "Invoice",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Sales Invoice",
"permlevel": 0,
"precision": "",
@@ -493,11 +493,11 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -542,7 +542,7 @@
"fieldname": "symptoms_select",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -550,15 +550,15 @@
"in_standard_filter": 0,
"label": "Complaints",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Complaint",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -574,14 +574,14 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -612,14 +612,14 @@
"in_standard_filter": 0,
"label": "In print",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -665,7 +665,7 @@
"fieldname": "diagnosis_select",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -673,15 +673,15 @@
"in_standard_filter": 0,
"label": "Diagnosis",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Diagnosis",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -698,14 +698,14 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -737,14 +737,14 @@
"in_standard_filter": 0,
"label": "In print",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -943,14 +943,14 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Review Details",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -1004,7 +1004,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 14:24:59.935498",
+ "modified": "2017-10-05 12:13:52.596750",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Consultation",
diff --git a/erpnext/healthcare/doctype/consultation/consultation.py b/erpnext/healthcare/doctype/consultation/consultation.py
index b8155b9..e16c221 100755
--- a/erpnext/healthcare/doctype/consultation/consultation.py
+++ b/erpnext/healthcare/doctype/consultation/consultation.py
@@ -78,7 +78,7 @@
create_invoice_items(physician, sales_invoice, company)
sales_invoice.save(ignore_permissions=True)
- frappe.db.sql(_("""update tabConsultation set invoice='{0}' where name='{1}'""").format(sales_invoice.name, consultation_id))
+ frappe.db.sql("""update tabConsultation set invoice=%s where name=%s""", (sales_invoice.name, consultation_id))
appointment = frappe.db.get_value("Consultation", consultation_id, "appointment")
if appointment:
frappe.db.set_value("Patient Appointment", appointment, "sales_invoice", sales_invoice.name)
diff --git a/erpnext/healthcare/doctype/diagnosis/diagnosis.json b/erpnext/healthcare/doctype/diagnosis/diagnosis.json
index b14ce94..936c2c5 100644
--- a/erpnext/healthcare/doctype/diagnosis/diagnosis.json
+++ b/erpnext/healthcare/doctype/diagnosis/diagnosis.json
@@ -23,7 +23,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -54,7 +54,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:40:09.731904",
+ "modified": "2017-10-05 11:25:46.107435",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Diagnosis",
diff --git a/erpnext/healthcare/doctype/dosage_form/dosage_form.json b/erpnext/healthcare/doctype/dosage_form/dosage_form.json
index 1de0e93..350aaed 100644
--- a/erpnext/healthcare/doctype/dosage_form/dosage_form.json
+++ b/erpnext/healthcare/doctype/dosage_form/dosage_form.json
@@ -23,7 +23,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -54,7 +54,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:40:19.973532",
+ "modified": "2017-10-05 11:24:57.888091",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Dosage Form",
diff --git a/erpnext/healthcare/doctype/drug_prescription/drug_prescription.json b/erpnext/healthcare/doctype/drug_prescription/drug_prescription.json
index c96df22..5647d3c 100644
--- a/erpnext/healthcare/doctype/drug_prescription/drug_prescription.json
+++ b/erpnext/healthcare/doctype/drug_prescription/drug_prescription.json
@@ -21,7 +21,7 @@
"fieldname": "drug_code",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -83,7 +83,7 @@
"fieldname": "dosage",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -114,7 +114,7 @@
"fieldname": "period",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -145,7 +145,7 @@
"fieldname": "dosage_form",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -206,7 +206,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -341,11 +341,11 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -362,7 +362,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 13:59:48.222282",
+ "modified": "2017-10-04 17:09:54.998517",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Drug Prescription",
diff --git a/erpnext/healthcare/doctype/fee_validity/fee_validity.json b/erpnext/healthcare/doctype/fee_validity/fee_validity.json
index 4bbd20b..595539c 100644
--- a/erpnext/healthcare/doctype/fee_validity/fee_validity.json
+++ b/erpnext/healthcare/doctype/fee_validity/fee_validity.json
@@ -39,7 +39,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -70,7 +70,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -206,7 +206,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:36:52.108407",
+ "modified": "2017-10-05 11:26:35.292841",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Fee Validity",
diff --git a/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.json b/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.json
index 8681641..7d9f2c7 100644
--- a/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.json
+++ b/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.json
@@ -359,7 +359,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -421,7 +421,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -544,7 +544,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -942,7 +942,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1002,7 +1002,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1033,7 +1033,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:25:48.193218",
+ "modified": "2017-10-05 11:36:44.087182",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Healthcare Settings",
diff --git a/erpnext/healthcare/doctype/healthcare_settings/test_healthcare_settings.py b/erpnext/healthcare/doctype/healthcare_settings/test_healthcare_settings.py
new file mode 100644
index 0000000..1b620d5
--- /dev/null
+++ b/erpnext/healthcare/doctype/healthcare_settings/test_healthcare_settings.py
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+import unittest
+
+class TestHealthcareSettings(unittest.TestCase):
+ pass
diff --git a/erpnext/healthcare/doctype/lab_prescription/lab_prescription.json b/erpnext/healthcare/doctype/lab_prescription/lab_prescription.json
index 2d1a8d6..cd9943b 100644
--- a/erpnext/healthcare/doctype/lab_prescription/lab_prescription.json
+++ b/erpnext/healthcare/doctype/lab_prescription/lab_prescription.json
@@ -20,7 +20,7 @@
"fieldname": "test_code",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -143,7 +143,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -180,14 +180,14 @@
"in_standard_filter": 0,
"label": "Test Created",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -204,7 +204,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 13:47:22.789095",
+ "modified": "2017-10-04 17:42:32.976165",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Lab Prescription",
diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.json b/erpnext/healthcare/doctype/lab_test/lab_test.json
index 93e40cc..8677c82 100644
--- a/erpnext/healthcare/doctype/lab_test/lab_test.json
+++ b/erpnext/healthcare/doctype/lab_test/lab_test.json
@@ -38,7 +38,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
@@ -61,7 +61,7 @@
"in_standard_filter": 0,
"label": "Invoice",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Sales Invoice",
"permlevel": 0,
"precision": "",
@@ -84,12 +84,12 @@
"fieldname": "patient",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Patient",
"length": 0,
"no_copy": 0,
@@ -131,7 +131,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -161,7 +161,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -192,7 +192,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
@@ -207,7 +207,7 @@
"fieldname": "physician",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -225,7 +225,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -253,7 +253,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -283,9 +283,9 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -314,7 +314,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -358,7 +358,7 @@
"fieldname": "department",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -376,7 +376,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -405,9 +405,9 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -435,7 +435,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -465,7 +465,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -480,7 +480,7 @@
"fieldname": "sample",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -496,7 +496,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -551,7 +551,7 @@
"in_standard_filter": 0,
"label": "Lab Technician",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Employee",
"permlevel": 0,
"precision": "",
@@ -559,7 +559,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -582,7 +582,7 @@
"in_standard_filter": 0,
"label": "Technician Name",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "employee.employee_name",
"permlevel": 0,
"precision": "",
@@ -590,7 +590,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -613,7 +613,7 @@
"in_standard_filter": 0,
"label": "Designation",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "employee.designation",
"permlevel": 0,
"precision": "",
@@ -621,7 +621,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -644,7 +644,7 @@
"in_standard_filter": 0,
"label": "User",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "User",
"permlevel": 0,
"precision": "",
@@ -652,7 +652,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -682,7 +682,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -731,7 +731,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Test Name",
"length": 0,
"no_copy": 1,
@@ -741,9 +741,9 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -785,7 +785,7 @@
"fieldname": "template",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -801,7 +801,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
@@ -832,7 +832,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -950,7 +950,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1009,7 +1009,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1054,7 +1054,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1114,7 +1114,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1158,7 +1158,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1189,7 +1189,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1219,7 +1219,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1249,7 +1249,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1279,7 +1279,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1309,7 +1309,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1339,7 +1339,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1362,7 +1362,7 @@
"in_standard_filter": 0,
"label": "Prescription",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Lab Prescription",
"permlevel": 0,
"precision": "",
@@ -1370,7 +1370,7 @@
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -1388,7 +1388,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:52:14.180774",
+ "modified": "2017-10-05 12:14:57.078823",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Lab Test",
diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.py b/erpnext/healthcare/doctype/lab_test/lab_test.py
index 0daf9cb..6fd9535 100644
--- a/erpnext/healthcare/doctype/lab_test/lab_test.py
+++ b/erpnext/healthcare/doctype/lab_test/lab_test.py
@@ -291,5 +291,5 @@
@frappe.whitelist()
def get_lab_test_prescribed(patient):
- return frappe.db.sql(_("""select cp.name, cp.test_code, cp.parent, cp.invoice, ct.physician, ct.consultation_date from tabConsultation ct,
- `tabLab Prescription` cp where ct.patient='{0}' and cp.parent=ct.name and cp.test_created=0""").format(patient))
+ return frappe.db.sql("""select cp.name, cp.test_code, cp.parent, cp.invoice, ct.physician, ct.consultation_date from tabConsultation ct,
+ `tabLab Prescription` cp where ct.patient=%s and cp.parent=ct.name and cp.test_created=0""", (patient))
diff --git a/erpnext/healthcare/doctype/lab_test_groups/lab_test_groups.json b/erpnext/healthcare/doctype/lab_test_groups/lab_test_groups.json
index d5607f0..86be544 100644
--- a/erpnext/healthcare/doctype/lab_test_groups/lab_test_groups.json
+++ b/erpnext/healthcare/doctype/lab_test_groups/lab_test_groups.json
@@ -34,11 +34,11 @@
"options": "Add Test\nAdd new line",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -54,7 +54,7 @@
"fieldname": "test_template",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -97,11 +97,11 @@
"options": "test_template.test_rate",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -117,7 +117,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -149,7 +149,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -179,7 +179,7 @@
"fieldname": "group_test_uom",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -212,7 +212,7 @@
"fieldtype": "Long Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -272,7 +272,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 14:07:35.188661",
+ "modified": "2017-10-04 16:55:45.081003",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Lab Test Groups",
diff --git a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.json b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.json
index 9e692d5..091e2f9 100644
--- a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.json
+++ b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.json
@@ -26,7 +26,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Test Name",
"length": 0,
"no_copy": 1,
@@ -69,7 +69,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -113,12 +113,12 @@
"fieldname": "test_group",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Item Group",
"length": 0,
"no_copy": 0,
@@ -131,7 +131,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -144,12 +144,12 @@
"fieldname": "department",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Department",
"length": 0,
"no_copy": 0,
@@ -211,7 +211,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Result Format",
"length": 0,
"no_copy": 0,
@@ -257,7 +257,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -334,7 +334,7 @@
"fieldname": "test_uom",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -366,7 +366,7 @@
"fieldtype": "Long Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -670,7 +670,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -729,7 +729,7 @@
"fieldname": "sample",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -823,7 +823,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -861,14 +861,14 @@
"in_standard_filter": 0,
"label": "Change In Item",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -895,11 +895,11 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -916,7 +916,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:45:27.655822",
+ "modified": "2017-10-05 12:12:11.918652",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Lab Test Template",
diff --git a/erpnext/healthcare/doctype/lab_test_uom/lab_test_uom.json b/erpnext/healthcare/doctype/lab_test_uom/lab_test_uom.json
index daa533d..fab88e2 100644
--- a/erpnext/healthcare/doctype/lab_test_uom/lab_test_uom.json
+++ b/erpnext/healthcare/doctype/lab_test_uom/lab_test_uom.json
@@ -22,7 +22,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -52,7 +52,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -83,7 +83,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:41:40.186676",
+ "modified": "2017-10-05 11:24:15.687464",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Lab Test UOM",
diff --git a/erpnext/healthcare/doctype/medical_code/medical_code.json b/erpnext/healthcare/doctype/medical_code/medical_code.json
index 71a2278..a2e7247 100644
--- a/erpnext/healthcare/doctype/medical_code/medical_code.json
+++ b/erpnext/healthcare/doctype/medical_code/medical_code.json
@@ -21,7 +21,7 @@
"fieldname": "medical_code_standard",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -53,7 +53,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -83,7 +83,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -114,7 +114,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 14:01:18.817484",
+ "modified": "2017-10-04 17:08:11.053418",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Medical Code",
diff --git a/erpnext/healthcare/doctype/normal_test_items/normal_test_items.json b/erpnext/healthcare/doctype/normal_test_items/normal_test_items.json
index 9e754a7..f53f001 100644
--- a/erpnext/healthcare/doctype/normal_test_items/normal_test_items.json
+++ b/erpnext/healthcare/doctype/normal_test_items/normal_test_items.json
@@ -21,7 +21,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -51,7 +51,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -82,7 +82,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -142,7 +142,7 @@
"fieldtype": "Long Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -182,11 +182,11 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -217,7 +217,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -248,7 +248,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -265,7 +265,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 13:59:33.202695",
+ "modified": "2017-10-04 17:13:06.376928",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Normal Test Items",
diff --git a/erpnext/healthcare/doctype/normal_test_template/normal_test_template.json b/erpnext/healthcare/doctype/normal_test_template/normal_test_template.json
index ef5abd5..265c116 100644
--- a/erpnext/healthcare/doctype/normal_test_template/normal_test_template.json
+++ b/erpnext/healthcare/doctype/normal_test_template/normal_test_template.json
@@ -21,7 +21,7 @@
"fieldtype": "Heading",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -51,7 +51,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -80,7 +80,7 @@
"fieldname": "test_uom",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -112,7 +112,7 @@
"fieldtype": "Long Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -172,7 +172,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 14:07:11.277187",
+ "modified": "2017-10-04 16:58:43.990804",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Normal Test Template",
diff --git a/erpnext/healthcare/doctype/patient/patient.json b/erpnext/healthcare/doctype/patient/patient.json
index f5ce458..6f9f2fc 100644
--- a/erpnext/healthcare/doctype/patient/patient.json
+++ b/erpnext/healthcare/doctype/patient/patient.json
@@ -67,11 +67,11 @@
"options": "PID-",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -91,7 +91,7 @@
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Full Name",
"length": 0,
"no_copy": 1,
@@ -217,14 +217,14 @@
"in_standard_filter": 0,
"label": "Age",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -248,7 +248,7 @@
"in_standard_filter": 0,
"label": "Status",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Active\nDormant\nOpen",
"permlevel": 0,
"precision": "",
@@ -256,7 +256,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -279,14 +279,14 @@
"in_standard_filter": 0,
"label": "Image",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -331,7 +331,7 @@
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -374,11 +374,11 @@
"options": "Company",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -429,7 +429,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Mobile",
"length": 0,
"no_copy": 0,
@@ -459,7 +459,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Email",
"length": 0,
"no_copy": 0,
@@ -524,14 +524,14 @@
"in_standard_filter": 0,
"label": "Disabled",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
- "read_only": 1,
+ "read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -638,14 +638,14 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Allergies",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -668,7 +668,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -727,7 +727,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -757,7 +757,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -817,11 +817,11 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Occupation",
"length": 0,
"no_copy": 0,
@@ -937,7 +937,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -967,7 +967,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -997,7 +997,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1026,7 +1026,7 @@
"fieldname": "alcohol_current_use",
"fieldtype": "Data",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -1086,7 +1086,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1116,7 +1116,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1180,7 +1180,7 @@
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1240,7 +1240,7 @@
"fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -1251,7 +1251,7 @@
"options": "Currency",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -1274,7 +1274,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 50,
- "modified": "2017-08-31 13:50:25.474398",
+ "modified": "2017-10-04 17:41:03.219934",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient",
diff --git a/erpnext/healthcare/doctype/patient/patient.py b/erpnext/healthcare/doctype/patient/patient.py
index 98526cc..f4d9a43 100644
--- a/erpnext/healthcare/doctype/patient/patient.py
+++ b/erpnext/healthcare/doctype/patient/patient.py
@@ -111,10 +111,10 @@
@frappe.whitelist()
def get_patient_detail(patient, company=None):
- patient_dict = frappe.db.sql(_("""select * from tabPatient where name='{0}'""").format(patient), as_dict=1)
+ patient_dict = frappe.db.sql("""select * from tabPatient where name=%s""", (patient), as_dict=1)
if not patient_dict:
frappe.throw("Patient not found")
- vital_sign = frappe.db.sql(_("""select * from `tabVital Signs` where patient='{0}' order by signs_date desc limit 1""").format(patient), as_dict=1)
+ vital_sign = frappe.db.sql("""select * from `tabVital Signs` where patient=%s order by signs_date desc limit 1""", (patient), as_dict=1)
details = patient_dict[0]
if vital_sign:
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
index 9520e77..57e568b 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
@@ -22,12 +22,12 @@
"fieldname": "patient",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Patient",
"length": 0,
"no_copy": 0,
@@ -53,12 +53,12 @@
"fieldname": "physician",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Physician",
"length": 0,
"no_copy": 0,
@@ -89,7 +89,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Date",
"length": 0,
"no_copy": 0,
@@ -101,7 +101,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 1,
"unique": 0
},
@@ -206,7 +206,7 @@
"fieldname": "appointment_type",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -338,11 +338,11 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
@@ -386,12 +386,12 @@
"fieldname": "department",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Department",
"length": 0,
"no_copy": 0,
@@ -404,7 +404,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 1,
"unique": 0
},
@@ -435,7 +435,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -546,15 +546,15 @@
"in_standard_filter": 0,
"label": "Gender",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "patient.sex",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -608,15 +608,15 @@
"in_standard_filter": 0,
"label": "Company",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Company",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -662,7 +662,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -691,7 +691,7 @@
"fieldname": "referring_physician",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -734,11 +734,11 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -755,7 +755,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:27:39.208298",
+ "modified": "2017-10-05 12:13:03.204936",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient Appointment",
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
index eab2f2d..2647034 100755
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
@@ -125,7 +125,7 @@
create_invoice_items(appointment_id, physician, company, sales_invoice)
sales_invoice.save(ignore_permissions=True)
- frappe.db.sql(_("""update `tabPatient Appointment` set sales_invoice='{0}' where name='{1}'""").format(sales_invoice.name, appointment_id))
+ frappe.db.sql("""update `tabPatient Appointment` set sales_invoice=%s where name=%s""", (sales_invoice.name, appointment_id))
frappe.db.set_value("Fee Validity", fee_validity.name, "ref_invoice", sales_invoice.name)
consultation = frappe.db.exists({
"doctype": "Consultation",
diff --git a/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json b/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
index 0614923..9cbcf7b 100644
--- a/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
+++ b/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
@@ -33,11 +33,11 @@
"options": "PMR-",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -52,7 +52,7 @@
"fieldname": "patient",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -171,7 +171,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -212,7 +212,7 @@
"options": "Open\nClose",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -332,15 +332,15 @@
"in_standard_filter": 0,
"label": "Reference Owner",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "reference_name.owner",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -356,7 +356,7 @@
"fieldname": "user",
"fieldtype": "Link",
"hidden": 1,
- "ignore_user_permissions": 1,
+ "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -368,11 +368,11 @@
"options": "User",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -389,7 +389,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-04 14:29:48.679751",
+ "modified": "2017-10-04 16:09:55.597866",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient Medical Record",
diff --git a/erpnext/healthcare/doctype/patient_relation/patient_relation.json b/erpnext/healthcare/doctype/patient_relation/patient_relation.json
index e97e1b2..209a374 100644
--- a/erpnext/healthcare/doctype/patient_relation/patient_relation.json
+++ b/erpnext/healthcare/doctype/patient_relation/patient_relation.json
@@ -39,7 +39,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -52,7 +52,7 @@
"fieldname": "patient",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -84,7 +84,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -115,7 +115,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 14:13:37.497114",
+ "modified": "2017-10-04 16:12:45.485333",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient Relation",
diff --git a/erpnext/healthcare/doctype/physician/physician.json b/erpnext/healthcare/doctype/physician/physician.json
index 565653b..4348e90 100644
--- a/erpnext/healthcare/doctype/physician/physician.json
+++ b/erpnext/healthcare/doctype/physician/physician.json
@@ -26,7 +26,7 @@
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "First Name",
"length": 0,
"no_copy": 0,
@@ -119,14 +119,14 @@
"in_standard_filter": 0,
"label": "Image",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -203,12 +203,12 @@
"fieldname": "designation",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Designation",
"length": 0,
"no_copy": 0,
@@ -234,12 +234,12 @@
"fieldname": "department",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Department",
"length": 0,
"no_copy": 0,
@@ -444,7 +444,7 @@
"fieldname": "physician_schedule",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -633,14 +633,14 @@
"in_standard_filter": 0,
"label": "Address HTML",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -692,14 +692,14 @@
"in_standard_filter": 0,
"label": "Contact HTML",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -783,15 +783,15 @@
"in_standard_filter": 0,
"label": "Default Currency",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Currency",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -809,7 +809,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:51:28.975120",
+ "modified": "2017-10-04 17:35:44.363742",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Physician",
diff --git a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.json b/erpnext/healthcare/doctype/physician_schedule/physician_schedule.json
index bd8e539..b1b3129 100644
--- a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.json
+++ b/erpnext/healthcare/doctype/physician_schedule/physician_schedule.json
@@ -23,7 +23,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -94,11 +94,11 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -115,7 +115,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:42:26.713507",
+ "modified": "2017-10-05 11:21:54.488194",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Physician Schedule",
diff --git a/erpnext/healthcare/doctype/prescription_dosage/prescription_dosage.json b/erpnext/healthcare/doctype/prescription_dosage/prescription_dosage.json
index 9c09506..9fb0dbc 100644
--- a/erpnext/healthcare/doctype/prescription_dosage/prescription_dosage.json
+++ b/erpnext/healthcare/doctype/prescription_dosage/prescription_dosage.json
@@ -22,7 +22,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -83,7 +83,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:42:40.305284",
+ "modified": "2017-10-05 11:20:47.558464",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Prescription Dosage",
diff --git a/erpnext/healthcare/doctype/sample_collection/sample_collection.json b/erpnext/healthcare/doctype/sample_collection/sample_collection.json
index ee2f83f..39788fb 100644
--- a/erpnext/healthcare/doctype/sample_collection/sample_collection.json
+++ b/erpnext/healthcare/doctype/sample_collection/sample_collection.json
@@ -85,12 +85,12 @@
"fieldname": "patient",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Patient",
"length": 0,
"no_copy": 0,
@@ -103,7 +103,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -219,11 +219,11 @@
"options": "Company",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -267,12 +267,12 @@
"fieldname": "sample",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Sample",
"length": 0,
"no_copy": 0,
@@ -389,7 +389,7 @@
"fieldname": "collected_by",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -466,7 +466,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -541,7 +541,7 @@
"fieldtype": "Long Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -572,7 +572,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:30:29.303026",
+ "modified": "2017-10-05 11:58:46.016097",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Sample Collection",
diff --git a/erpnext/healthcare/doctype/sensitivity/sensitivity.json b/erpnext/healthcare/doctype/sensitivity/sensitivity.json
index 620f37a..eddfda9 100644
--- a/erpnext/healthcare/doctype/sensitivity/sensitivity.json
+++ b/erpnext/healthcare/doctype/sensitivity/sensitivity.json
@@ -22,7 +22,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -53,7 +53,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-08-31 13:44:07.147326",
+ "modified": "2017-10-05 11:19:12.110308",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Sensitivity",
diff --git a/erpnext/healthcare/doctype/sensitivity_test_items/sensitivity_test_items.json b/erpnext/healthcare/doctype/sensitivity_test_items/sensitivity_test_items.json
index e656b51..86f5e26 100644
--- a/erpnext/healthcare/doctype/sensitivity_test_items/sensitivity_test_items.json
+++ b/erpnext/healthcare/doctype/sensitivity_test_items/sensitivity_test_items.json
@@ -20,7 +20,7 @@
"fieldname": "antibiotic",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -51,7 +51,7 @@
"fieldname": "antibiotic_sensitivity",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
@@ -84,7 +84,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 13:46:40.609983",
+ "modified": "2017-10-05 11:08:06.327972",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Sensitivity Test Items",
diff --git a/erpnext/healthcare/doctype/special_test_items/special_test_items.json b/erpnext/healthcare/doctype/special_test_items/special_test_items.json
index 89545e9..4c97e41 100644
--- a/erpnext/healthcare/doctype/special_test_items/special_test_items.json
+++ b/erpnext/healthcare/doctype/special_test_items/special_test_items.json
@@ -22,7 +22,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -53,7 +53,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -99,7 +99,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -130,7 +130,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -147,7 +147,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 14:12:12.623714",
+ "modified": "2017-10-04 16:15:12.642699",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Special Test Items",
diff --git a/erpnext/healthcare/doctype/special_test_template/special_test_template.json b/erpnext/healthcare/doctype/special_test_template/special_test_template.json
index 83f3cb6..372af0a 100644
--- a/erpnext/healthcare/doctype/special_test_template/special_test_template.json
+++ b/erpnext/healthcare/doctype/special_test_template/special_test_template.json
@@ -21,7 +21,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -53,7 +53,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-08-31 14:08:18.833796",
+ "modified": "2017-10-04 16:20:09.565316",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Special Test Template",
diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.json b/erpnext/healthcare/doctype/vital_signs/vital_signs.json
index e44af28..bab80f5 100644
--- a/erpnext/healthcare/doctype/vital_signs/vital_signs.json
+++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.json
@@ -21,12 +21,12 @@
"fieldname": "patient",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
- "in_standard_filter": 0,
+ "in_standard_filter": 1,
"label": "Patient",
"length": 0,
"no_copy": 0,
@@ -54,21 +54,21 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
+ "in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Appointment",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Patient Appointment",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -85,21 +85,21 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
- "in_filter": 0,
+ "in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Consultation",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Consultation",
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
- "report_hide": 0,
+ "report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -266,7 +266,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -297,7 +297,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -328,7 +328,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -387,7 +387,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -418,7 +418,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
@@ -479,7 +479,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -659,7 +659,7 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
@@ -751,7 +751,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-09-04 14:31:57.851546",
+ "modified": "2017-10-04 16:08:36.340607",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Vital Signs",
diff --git a/erpnext/setup/setup_wizard/healthcare.py b/erpnext/healthcare/setup.py
similarity index 77%
rename from erpnext/setup/setup_wizard/healthcare.py
rename to erpnext/healthcare/setup.py
index 43a0237..69a92b3 100644
--- a/erpnext/setup/setup_wizard/healthcare.py
+++ b/erpnext/healthcare/setup.py
@@ -1,10 +1,12 @@
from __future__ import unicode_literals
import frappe
-from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
from frappe import _
def setup_healthcare():
+ if frappe.db.exists('Medical Department', 'Cardiology'):
+ # already setup
+ return
create_medical_departments()
create_antibiotics()
create_test_uom()
@@ -14,63 +16,55 @@
create_lab_test_items()
create_lab_test_template()
create_sensitivity()
- make_custom_fields()
-
-def make_custom_fields():
- custom_fields = {
- 'Sales Invoice': [
- dict(fieldname='appointment', label='Patient Appointment',
- fieldtype='Link', options='Patient Appointment',
- insert_after='customer')
- ]
- }
-
- create_custom_fields(custom_fields)
-
def create_medical_departments():
- depts = ["Accident and emergency care" ,"Anaesthetics", "Biochemistry", "Cardiology", "Dermatology",
- "Diagnostic imaging", "ENT", "Gastroenterology", "General Surgery", "Gynaecology",
- "Haematology", "Maternity", "Microbiology", "Nephrology", "Neurology", "Oncology",
- "Orthopaedics", "Pathology", "Physiotherapy", "Rheumatology", "Serology", "Urology"]
- for d in depts:
+ departments = [
+ "Accident And Emergency Care" ,"Anaesthetics", "Biochemistry", "Cardiology", "Dermatology",
+ "Diagnostic Imaging", "ENT", "Gastroenterology", "General Surgery", "Gynaecology",
+ "Haematology", "Maternity", "Microbiology", "Nephrology", "Neurology", "Oncology",
+ "Orthopaedics", "Pathology", "Physiotherapy", "Rheumatology", "Serology", "Urology"
+ ]
+ for department in departments:
mediacal_department = frappe.new_doc("Medical Department")
- mediacal_department.department = d
+ mediacal_department.department = _(department)
try:
mediacal_department.save()
except frappe.DuplicateEntryError:
pass
def create_antibiotics():
- abt = ["Amoxicillin", "Ampicillin", "Bacampicillin", "Carbenicillin", "Cloxacillin", "Dicloxacillin",
- "Flucloxacillin", "Mezlocillin", "Nafcillin", "Oxacillin", "Penicillin G", "Penicillin V",
- "Piperacillin", "Pivampicillin", "Pivmecillinam", "Ticarcillin", "Cefacetrile (cephacetrile)",
- "Cefadroxil (cefadroxyl)", "Cefalexin (cephalexin)", "Cefaloglycin (cephaloglycin)",
- "Cefalonium (cephalonium)", "Cefaloridine (cephaloradine)", "Cefalotin (cephalothin)",
- "Cefapirin (cephapirin)", "Cefatrizine", "Cefazaflur", "Cefazedone", "Cefazolin (cephazolin)",
- "Cefradine (cephradine)", "Cefroxadine", "Ceftezole", "Cefaclor", "Cefamandole", "Cefmetazole",
- "Cefonicid", "Cefotetan", "Cefoxitin", "Cefprozil (cefproxil)", "Cefuroxime", "Cefuzonam",
- "Cefcapene", "Cefdaloxime", "Cefdinir", "Cefditoren", "Cefetamet", "Cefixime", "Cefmenoxime",
- "Cefodizime", "Cefotaxime", "Cefpimizole", "Cefpodoxime", "Cefteram", "Ceftibuten", "Ceftiofur",
- "Ceftiolene", "Ceftizoxime", "Ceftriaxone", "Cefoperazone", "Ceftazidime", "Cefclidine", "Cefepime",
- "Cefluprenam", "Cefoselis", "Cefozopran", "Cefpirome", "Cefquinome", "Ceftobiprole", "Ceftaroline",
- "Cefaclomezine","Cefaloram", "Cefaparole", "Cefcanel", "Cefedrolor", "Cefempidone", "Cefetrizole",
- "Cefivitril", "Cefmatilen", "Cefmepidium", "Cefovecin", "Cefoxazole", "Cefrotil", "Cefsumide",
- "Cefuracetime", "Ceftioxide", "Ceftazidime/Avibactam", "Ceftolozane/Tazobactam", "Aztreonam",
- "Imipenem", "Imipenem/cilastatin", "Doripenem", "Meropenem", "Ertapenem", "Azithromycin",
- "Erythromycin", "Clarithromycin", "Dirithromycin", "Roxithromycin", "Telithromycin", "Clindamycin",
- "Lincomycin", "Pristinamycin", "Quinupristin/dalfopristin", "Amikacin", "Gentamicin", "Kanamycin",
- "Neomycin", "Netilmicin", "Paromomycin", "Streptomycin", "Tobramycin", "Flumequine", "Nalidixic acid",
- "Oxolinic acid", "Piromidic acid", "Pipemidic acid", "Rosoxacin", "Ciprofloxacin", "Enoxacin",
- "Lomefloxacin", "Nadifloxacin", "Norfloxacin", "Ofloxacin", "Pefloxacin", "Rufloxacin", "Balofloxacin",
- "Gatifloxacin", "Grepafloxacin", "Levofloxacin", "Moxifloxacin", "Pazufloxacin", "Sparfloxacin",
- "Temafloxacin", "Tosufloxacin", "Besifloxacin", "Clinafloxacin", "Gemifloxacin",
- "Sitafloxacin", "Trovafloxacin", "Prulifloxacin", "Sulfamethizole", "Sulfamethoxazole",
- "Sulfisoxazole", "Trimethoprim-Sulfamethoxazole", "Demeclocycline", "Doxycycline", "Minocycline",
- "Oxytetracycline", "Tetracycline", "Tigecycline", "Chloramphenicol", "Metronidazole",
- "Tinidazole", "Nitrofurantoin", "Vancomycin", "Teicoplanin", "Telavancin", "Linezolid",
- "Cycloserine 2", "Rifampin", "Rifabutin", "Rifapentine", "Rifalazil", "Bacitracin", "Polymyxin B",
- "Viomycin", "Capreomycin"]
+ abt = [
+ "Amoxicillin", "Ampicillin", "Bacampicillin", "Carbenicillin", "Cloxacillin", "Dicloxacillin",
+ "Flucloxacillin", "Mezlocillin", "Nafcillin", "Oxacillin", "Penicillin G", "Penicillin V",
+ "Piperacillin", "Pivampicillin", "Pivmecillinam", "Ticarcillin", "Cefacetrile (cephacetrile)",
+ "Cefadroxil (cefadroxyl)", "Cefalexin (cephalexin)", "Cefaloglycin (cephaloglycin)",
+ "Cefalonium (cephalonium)", "Cefaloridine (cephaloradine)", "Cefalotin (cephalothin)",
+ "Cefapirin (cephapirin)", "Cefatrizine", "Cefazaflur", "Cefazedone", "Cefazolin (cephazolin)",
+ "Cefradine (cephradine)", "Cefroxadine", "Ceftezole", "Cefaclor", "Cefamandole", "Cefmetazole",
+ "Cefonicid", "Cefotetan", "Cefoxitin", "Cefprozil (cefproxil)", "Cefuroxime", "Cefuzonam",
+ "Cefcapene", "Cefdaloxime", "Cefdinir", "Cefditoren", "Cefetamet", "Cefixime", "Cefmenoxime",
+ "Cefodizime", "Cefotaxime", "Cefpimizole", "Cefpodoxime", "Cefteram", "Ceftibuten", "Ceftiofur",
+ "Ceftiolene", "Ceftizoxime", "Ceftriaxone", "Cefoperazone", "Ceftazidime", "Cefclidine", "Cefepime",
+ "Cefluprenam", "Cefoselis", "Cefozopran", "Cefpirome", "Cefquinome", "Ceftobiprole", "Ceftaroline",
+ "Cefaclomezine","Cefaloram", "Cefaparole", "Cefcanel", "Cefedrolor", "Cefempidone", "Cefetrizole",
+ "Cefivitril", "Cefmatilen", "Cefmepidium", "Cefovecin", "Cefoxazole", "Cefrotil", "Cefsumide",
+ "Cefuracetime", "Ceftioxide", "Ceftazidime/Avibactam", "Ceftolozane/Tazobactam", "Aztreonam",
+ "Imipenem", "Imipenem/cilastatin", "Doripenem", "Meropenem", "Ertapenem", "Azithromycin",
+ "Erythromycin", "Clarithromycin", "Dirithromycin", "Roxithromycin", "Telithromycin", "Clindamycin",
+ "Lincomycin", "Pristinamycin", "Quinupristin/dalfopristin", "Amikacin", "Gentamicin", "Kanamycin",
+ "Neomycin", "Netilmicin", "Paromomycin", "Streptomycin", "Tobramycin", "Flumequine", "Nalidixic acid",
+ "Oxolinic acid", "Piromidic acid", "Pipemidic acid", "Rosoxacin", "Ciprofloxacin", "Enoxacin",
+ "Lomefloxacin", "Nadifloxacin", "Norfloxacin", "Ofloxacin", "Pefloxacin", "Rufloxacin", "Balofloxacin",
+ "Gatifloxacin", "Grepafloxacin", "Levofloxacin", "Moxifloxacin", "Pazufloxacin", "Sparfloxacin",
+ "Temafloxacin", "Tosufloxacin", "Besifloxacin", "Clinafloxacin", "Gemifloxacin",
+ "Sitafloxacin", "Trovafloxacin", "Prulifloxacin", "Sulfamethizole", "Sulfamethoxazole",
+ "Sulfisoxazole", "Trimethoprim-Sulfamethoxazole", "Demeclocycline", "Doxycycline", "Minocycline",
+ "Oxytetracycline", "Tetracycline", "Tigecycline", "Chloramphenicol", "Metronidazole",
+ "Tinidazole", "Nitrofurantoin", "Vancomycin", "Teicoplanin", "Telavancin", "Linezolid",
+ "Cycloserine 2", "Rifampin", "Rifabutin", "Rifapentine", "Rifalazil", "Bacitracin", "Polymyxin B",
+ "Viomycin", "Capreomycin"
+ ]
+
for a in abt:
antibiotic = frappe.new_doc("Antibiotic")
antibiotic.antibiotic_name = a
@@ -190,21 +184,21 @@
def create_lab_test_items():
records = [
- {"doctype": "Item", "item_code": "MCH", "item_name": "MCH", "item_group": "Laboratory",
+ {"doctype": "Item", "item_code": "MCH", "item_name": "MCH", "item_group": _("Laboratory"),
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
- {"doctype": "Item", "item_code": "LDL", "item_name": "LDL", "item_group": "Laboratory",
+ {"doctype": "Item", "item_code": "LDL", "item_name": "LDL", "item_group": _("Laboratory"),
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
- {"doctype": "Item", "item_code": "GTT", "item_name": "GTT", "item_group": "Laboratory",
+ {"doctype": "Item", "item_code": "GTT", "item_name": "GTT", "item_group": _("Laboratory"),
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
- {"doctype": "Item", "item_code": "HDL", "item_name": "HDL", "item_group": "Laboratory",
+ {"doctype": "Item", "item_code": "HDL", "item_name": "HDL", "item_group": _("Laboratory"),
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
- {"doctype": "Item", "item_code": "BILT", "item_name": "BILT", "item_group": "Laboratory",
+ {"doctype": "Item", "item_code": "BILT", "item_name": "BILT", "item_group": _("Laboratory"),
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
- {"doctype": "Item", "item_code": "BILD", "item_name": "BILD", "item_group": "Laboratory",
+ {"doctype": "Item", "item_code": "BILD", "item_name": "BILD", "item_group": _("Laboratory"),
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
- {"doctype": "Item", "item_code": "BP", "item_name": "BP", "item_group": "Laboratory",
+ {"doctype": "Item", "item_code": "BP", "item_name": "BP", "item_group": _("Laboratory"),
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
- {"doctype": "Item", "item_code": "BS", "item_name": "BS", "item_group": "Laboratory",
+ {"doctype": "Item", "item_code": "BS", "item_name": "BS", "item_group": _("Laboratory"),
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}
]
insert_record(records)
@@ -212,43 +206,43 @@
def create_lab_test_template():
records = [
{"doctype": "Lab Test Template", "name": "MCH","test_name": "MCH","test_code": "MCH",
- "test_group": "Laboratory","department": "Haematology","item": "MCH",
+ "test_group": _("Laboratory"),"department": _("Haematology"),"item": "MCH",
"test_template_type": "Single","is_billable": 1,"test_rate": 0.0,"test_uom": "Microgram",
"test_normal_range": "27 - 32 Microgram",
"sensitivity": 0,"test_description": "Mean Corpuscular Hemoglobin"},
{"doctype": "Lab Test Template", "name": "LDL","test_name": "LDL (Serum)","test_code": "LDL",
- "test_group": "Laboratory","department": "Biochemistry",
+ "test_group": _("Laboratory"),"department": _("Biochemistry"),
"item": "LDL","test_template_type": "Single",
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "70 - 160 mg/dlLow-density Lipoprotein (LDL)",
"sensitivity": 0,"test_description": "Low-density Lipoprotein (LDL)"},
{"doctype": "Lab Test Template", "name": "GTT","test_name": "GTT","test_code": "GTT",
- "test_group": "Laboratory","department": "Haematology",
+ "test_group": _("Laboratory"),"department": _("Haematology"),
"item": "GTT","test_template_type": "Single",
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "Less than 85 mg/dl",
"sensitivity": 0,"test_description": "Glucose Tolerance Test"},
{"doctype": "Lab Test Template", "name": "HDL","test_name": "HDL (Serum)","test_code": "HDL",
- "test_group": "Laboratory","department": "Biochemistry",
+ "test_group": _("Laboratory"),"department": _("Biochemistry"),
"item": "HDL","test_template_type": "Single",
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "35 - 65 mg/dl",
"sensitivity": 0,"test_description": "High-density Lipoprotein (HDL)"},
{"doctype": "Lab Test Template", "name": "BILT","test_name": "Bilirubin Total","test_code": "BILT",
- "test_group": "Laboratory","department": "Biochemistry",
+ "test_group": _("Laboratory"),"department": _("Biochemistry"),
"item": "BILT","test_template_type": "Single",
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "0.2 - 1.2 mg / dl",
"sensitivity": 0,"test_description": "Bilirubin Total"},
{"doctype": "Lab Test Template", "name": "BILD","test_name": "Bilirubin Direct","test_code": "BILD",
- "test_group": "Laboratory","department": "Biochemistry",
+ "test_group": _("Laboratory"),"department": _("Biochemistry"),
"item": "BILD","test_template_type": "Single",
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "0.4 mg / dl",
"sensitivity": 0,"test_description": "Bilirubin Direct"},
{"doctype": "Lab Test Template", "name": "BP","test_name": "Bile Pigment","test_code": "BP",
- "test_group": "Laboratory","department": "Pathology",
+ "test_group": _("Laboratory"),"department": _("Pathology"),
"item": "BP","test_template_type": "Single",
"is_billable": 1,"test_rate": 0.0,"test_uom": "","test_normal_range": "",
"sensitivity": 0,"test_description": "Bile Pigment"},
{"doctype": "Lab Test Template", "name": "BS","test_name": "Bile Salt","test_code": "BS",
- "test_group": "Laboratory","department": "Pathology",
+ "test_group": _("Laboratory"),"department": _("Pathology"),
"item": "BS","test_template_type": "Single",
"is_billable": 1,"test_rate": 0.0,"test_uom": "","test_normal_range": "",
"sensitivity": 0,"test_description": "Bile Salt"}
@@ -257,12 +251,12 @@
def create_sensitivity():
records = [
- {"doctype": "Sensitivity", "sensitivity": "Low Sensitivity"},
- {"doctype": "Sensitivity", "sensitivity": "High Sensitivity"},
- {"doctype": "Sensitivity", "sensitivity": "Moderate Sensitivity"},
- {"doctype": "Sensitivity", "sensitivity": "Susceptible"},
- {"doctype": "Sensitivity", "sensitivity": "Resistant"},
- {"doctype": "Sensitivity", "sensitivity": "Intermediate"}
+ {"doctype": "Sensitivity", "sensitivity": _("Low Sensitivity")},
+ {"doctype": "Sensitivity", "sensitivity": _("High Sensitivity")},
+ {"doctype": "Sensitivity", "sensitivity": _("Moderate Sensitivity")},
+ {"doctype": "Sensitivity", "sensitivity": _("Susceptible")},
+ {"doctype": "Sensitivity", "sensitivity": _("Resistant")},
+ {"doctype": "Sensitivity", "sensitivity": _("Intermediate")}
]
insert_record(records)
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index bf6f5aa..44a3b18 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -53,6 +53,16 @@
fixtures = ["Web Form"]
+domains = {
+ 'Distribution': 'erpnext.domains.distribution',
+ 'Education': 'erpnext.domains.education',
+ 'Healthcare': 'erpnext.domains.healthcare',
+ 'Hospitality': 'erpnext.domains.hospitality',
+ 'Manufacturing': 'erpnext.domains.manufacturing',
+ 'Retail': 'erpnext.domains.retail',
+ 'Services': 'erpnext.domains.services',
+}
+
website_generators = ["Item Group", "Item", "BOM", "Sales Partner",
"Job Opening", "Student Admission"]
diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.json b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.json
index bafee91..99e7994 100644
--- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.json
+++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
@@ -10,16 +11,20 @@
"editable_grid": 1,
"fields": [
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "expense_date",
"fieldtype": "Date",
"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 Date",
"length": 0,
"no_copy": 0,
@@ -30,6 +35,7 @@
"print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -38,16 +44,20 @@
"width": "150px"
},
{
+ "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,
@@ -55,6 +65,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -62,16 +73,20 @@
"unique": 0
},
{
+ "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 Claim Type",
"length": 0,
"no_copy": 0,
@@ -83,6 +98,7 @@
"print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -91,9 +107,11 @@
"width": "150px"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"depends_on": "expense_type",
"fieldname": "default_account",
"fieldtype": "Link",
@@ -101,7 +119,9 @@
"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 Account",
"length": 0,
"no_copy": 0,
@@ -111,6 +131,7 @@
"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,
@@ -118,16 +139,20 @@
"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,
@@ -135,6 +160,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -142,26 +168,32 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
+ "options": "expense_type.description",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -170,16 +202,20 @@
"width": "300px"
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "section_break_6",
"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,
@@ -187,6 +223,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -194,16 +231,20 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "claim_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": "Claim Amount",
"length": 0,
"no_copy": 0,
@@ -215,6 +256,7 @@
"print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -223,16 +265,20 @@
"width": "150px"
},
{
+ "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,
@@ -240,6 +286,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -247,16 +294,20 @@
"unique": 0
},
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "sanctioned_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": "Sanctioned Amount",
"length": 0,
"no_copy": 1,
@@ -268,6 +319,7 @@
"print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -276,17 +328,17 @@
"width": "150px"
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-07-11 03:28:00.406154",
+ "modified": "2017-10-11 12:50:48.606727",
"modified_by": "Administrator",
"module": "HR",
"name": "Expense Claim Detail",
@@ -295,7 +347,9 @@
"quick_entry": 0,
"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/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index f769d6f..7581624 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -70,6 +70,7 @@
'default_amount': amount,
'depends_on_lwp' : struct_row.depends_on_lwp,
'salary_component' : struct_row.salary_component,
+ 'abbr' : struct_row.abbr,
'do_not_include_in_total' : struct_row.do_not_include_in_total
})
else:
diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.js b/erpnext/hr/doctype/salary_structure/test_salary_structure.js
index 8276a82..5e028cf 100644
--- a/erpnext/hr/doctype/salary_structure/test_salary_structure.js
+++ b/erpnext/hr/doctype/salary_structure/test_salary_structure.js
@@ -13,6 +13,7 @@
(r) => {
// Creating Salary Structure for employees);
return frappe.tests.make('Salary Structure', [
+ { __newname: 'Test Salary Structure'},
{ company: 'For Testing'},
{ payroll_frequency: 'Monthly'},
{ employees: [
@@ -47,11 +48,7 @@
]);
}
),
- () => frappe.timeout(18),
- () => cur_dialog.set_value('value','Test Salary Structure'),
- () => frappe.timeout(1),
- () => frappe.click_button('Create'),
- () => frappe.timeout(1),
+ () => frappe.timeout(3),
() => {
// To check if all the fields are correctly set
assert.ok(cur_frm.doc.employees[0].employee_name.includes('Test Employee 1') &&
diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.js b/erpnext/hr/doctype/upload_attendance/upload_attendance.js
index f639898..776fd3c 100644
--- a/erpnext/hr/doctype/upload_attendance/upload_attendance.js
+++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.js
@@ -39,6 +39,7 @@
args: {
method: 'erpnext.hr.doctype.upload_attendance.upload_attendance.upload'
},
+ no_socketio: true,
sample_url: "e.g. http://example.com/somefile.csv",
callback: function(attachment, r) {
var $log_wrapper = $(cur_frm.fields_dict.import_log.wrapper).empty();
diff --git a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
index 63e5f3c..93ea11c 100644
--- a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
+++ b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
@@ -29,26 +29,26 @@
def get_log_data(filters):
fy = frappe.db.get_value('Fiscal Year', filters.get('fiscal_year'), ['year_start_date', 'year_end_date'], as_dict=True)
- data = frappe.db.sql("""select
+ data = frappe.db.sql("""select
vhcl.license_plate as "License", vhcl.make as "Make", vhcl.model as "Model",
- vhcl.location as "Location", log.name as "Log", log.odometer as "Odometer",
+ vhcl.location as "Location", log.name as "Log", log.odometer as "Odometer",
log.date as "Date", log.fuel_qty as "Fuel Qty", log.price as "Fuel Price"
- from
+ from
`tabVehicle` vhcl,`tabVehicle Log` log
- where
+ where
vhcl.license_plate = log.license_plate and log.docstatus = 1 and date between %s and %s
order by date""" ,(fy.year_start_date, fy.year_end_date), as_dict=1)
dl=list(data)
for row in dl:
row["Service Expense"]= get_service_expense(row["Log"])
return dl
-
+
def get_service_expense(logname):
- expense_amount = frappe.db.sql("""select sum(expense_amount)
- from `tabVehicle Log` log,`tabVehicle Service` ser
+ expense_amount = frappe.db.sql("""select sum(expense_amount)
+ from `tabVehicle Log` log,`tabVehicle Service` ser
where ser.parent=log.name and log.name=%s""",logname)
return flt(expense_amount[0][0]) if expense_amount else 0
-
+
def get_chart_data(data,period_list):
fuel_exp_data,service_exp_data,fueldata,servicedata = [],[],[],[]
service_exp_data = []
@@ -63,19 +63,25 @@
fueldata.append([period.key,total_fuel_exp])
servicedata.append([period.key,total_ser_exp])
- x_intervals = ['x'] + [period.key for period in period_list]
+ labels = [period.key for period in period_list]
fuel_exp_data= [row[1] for row in fueldata]
service_exp_data= [row[1] for row in servicedata]
- columns = [x_intervals]
+ datasets = []
if fuel_exp_data:
- columns.append(["Fuel Expenses"]+ fuel_exp_data)
+ datasets.append({
+ 'title': 'Fuel Expenses',
+ 'values': fuel_exp_data
+ })
if service_exp_data:
- columns.append(["Service Expenses"]+ service_exp_data)
+ datasets.append({
+ 'title': 'Service Expenses',
+ 'values': service_exp_data
+ })
chart = {
"data": {
- 'x': 'x',
- 'columns': columns
+ 'labels': labels,
+ 'datasets': datasets
}
}
- chart["chart_type"] = "line"
+ chart["type"] = "line"
return chart
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index ead5d33..b140bf5 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -147,22 +147,28 @@
if arg.get('scrap_items'):
rate = self.get_valuation_rate(arg)
elif arg:
- if self.rm_cost_as_per == 'Valuation Rate':
- rate = self.get_valuation_rate(arg)
- elif self.rm_cost_as_per == 'Last Purchase Rate':
- rate = arg['last_purchase_rate'] \
- or frappe.db.get_value("Item", arg['item_code'], "last_purchase_rate")
- elif self.rm_cost_as_per == "Price List":
- if not self.buying_price_list:
- frappe.throw(_("Please select Price List"))
- rate = frappe.db.get_value("Item Price",
- {"price_list": self.buying_price_list, "item_code": arg["item_code"]}, "price_list_rate")
- price_list_currency = frappe.db.get_value("Price List", self.buying_price_list, "currency")
- if price_list_currency != self.company_currency():
- rate = flt(rate * self.conversion_rate)
-
- if arg['bom_no'] and (not rate or self.set_rate_of_sub_assembly_item_based_on_bom):
+ if arg.get('bom_no') and self.set_rate_of_sub_assembly_item_based_on_bom:
rate = self.get_bom_unitcost(arg['bom_no'])
+ else:
+ if self.rm_cost_as_per == 'Valuation Rate':
+ rate = self.get_valuation_rate(arg)
+ elif self.rm_cost_as_per == 'Last Purchase Rate':
+ rate = arg.get('last_purchase_rate') \
+ or frappe.db.get_value("Item", arg['item_code'], "last_purchase_rate")
+ elif self.rm_cost_as_per == "Price List":
+ if not self.buying_price_list:
+ frappe.throw(_("Please select Price List"))
+ rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list,
+ "item_code": arg["item_code"]}, "price_list_rate")
+
+ price_list_currency = frappe.db.get_value("Price List",
+ self.buying_price_list, "currency")
+ if price_list_currency != self.company_currency():
+ rate = flt(rate * self.conversion_rate)
+
+ if not rate:
+ frappe.msgprint(_("{0} not found for Item {1}")
+ .format(self.rm_cost_as_per, arg["item_code"]))
return flt(rate)
diff --git a/erpnext/manufacturing/doctype/operation/test_operation.js b/erpnext/manufacturing/doctype/operation/test_operation.js
index 9fedaac..5aafe42 100644
--- a/erpnext/manufacturing/doctype/operation/test_operation.js
+++ b/erpnext/manufacturing/doctype/operation/test_operation.js
@@ -1,13 +1,6 @@
QUnit.test("test: operation", function (assert) {
assert.expect(2);
let done = assert.async();
- let set_op_name = (text) => {
- $(`input.input-with-feedback.form-control.bold:visible`).val(`${text}`);
- };
- let click_create = () => {
- $(`.btn-primary:contains("Create"):visible`).click();
- };
-
frappe.run_serially([
// test operation creation
() => frappe.set_route("List", "Operation"),
@@ -16,14 +9,11 @@
() => {
frappe.tests.make(
"Operation", [
+ {__newname: "Assemble Keyboard"},
{workstation: "Keyboard assembly workstation"}
]
);
},
- () => frappe.timeout(4),
- () => set_op_name("Assemble Keyboard"),
- () => frappe.timeout(0.5),
- () => click_create(),
() => frappe.timeout(1),
() => {
assert.ok(cur_frm.docname.includes('Assemble Keyboard'),
@@ -36,28 +26,22 @@
() => {
frappe.tests.make(
"Operation", [
+ {__newname: 'Assemble Screen'},
{workstation: "Screen assembly workstation"}
]
);
},
- () => frappe.timeout(4),
- () => set_op_name("Assemble Screen"),
- () => frappe.timeout(0.5),
- () => click_create(),
() => frappe.timeout(1),
// Create a CPU operation
() => {
frappe.tests.make(
"Operation", [
+ {__newname: 'Assemble CPU'},
{workstation: "CPU assembly workstation"}
]
);
},
- () => frappe.timeout(4),
- () => set_op_name("Assemble CPU"),
- () => frappe.timeout(0.5),
- () => click_create(),
() => frappe.timeout(1),
() => done()
diff --git a/erpnext/manufacturing/page/production_analytics/production_analytics.js b/erpnext/manufacturing/page/production_analytics/production_analytics.js
index 1fb1ef2..39168b7 100644
--- a/erpnext/manufacturing/page/production_analytics/production_analytics.js
+++ b/erpnext/manufacturing/page/production_analytics/production_analytics.js
@@ -53,7 +53,7 @@
this.show_zero_check()
this.setup_chart_check();
-
+
},
init_filter_values: function() {
this._super();
@@ -61,12 +61,13 @@
},
setup_chart: function() {
var me = this;
-
+
var chart_data = this.get_chart_data ? this.get_chart_data() : null;
- this.chart = new frappe.ui.Chart({
- wrapper: this.chart_area,
- data: chart_data
+ this.chart = new frappe.chart.FrappeChart({
+ parent: ".chart",
+ data: chart_data,
+ type: 'line'
});
},
set_default_values: function() {
@@ -95,7 +96,7 @@
var pending = {name:"Pending", "id":"pending-pos",
checked:true};
var completed = {name:"Completed", "id":"completed-pos",
- checked:true};
+ checked:true};
$.each(frappe.report_dump.data["Production Order"], function(i, d) {
var dateobj = frappe.datetime.str_to_obj(d.creation);
@@ -109,10 +110,10 @@
var planned_start_date = frappe.datetime.user_to_obj(frappe.datetime.str_to_user(d.planned_start_date));
var aend_date = frappe.datetime.user_to_obj(frappe.datetime.str_to_user(d.actual_end_date));
var modified = frappe.datetime.user_to_obj(frappe.datetime.str_to_user(d.modified));
-
+
if (dateobj <= start_period || dateobj <= end_period) {
all_open_orders[col.field] = flt(all_open_orders[col.field]) + 1;
-
+
if(d.status=="Completed") {
if(aend_date < start_period || modified < start_period) {
completed[col.field] = flt(completed[col.field]) + 1;
@@ -140,7 +141,7 @@
}else{
not_started[col.field] = flt(not_started[col.field]) + 1;
}
- }
+ }
}
}
});
@@ -151,6 +152,6 @@
this.chart_area.toggle(false);
}
this.data = [all_open_orders, not_started, overdue, pending, completed];
-
+
}
});
diff --git a/erpnext/modules.txt b/erpnext/modules.txt
index 6449a4a..5e9f6c7 100644
--- a/erpnext/modules.txt
+++ b/erpnext/modules.txt
@@ -16,3 +16,4 @@
Schools
Regional
Healthcare
+Restaurant
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 8aa7aa5..dfae595 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -452,6 +452,7 @@
erpnext.patches.v9_0.set_schedule_date_for_material_request_and_purchase_order
erpnext.patches.v9_0.student_admission_childtable_migrate
erpnext.patches.v9_0.add_healthcare_domain
+erpnext.patches.v9_0.set_variant_item_description
erpnext.patches.v8_10.add_due_date_to_gle
erpnext.patches.v8_10.update_gl_due_date_for_pi_and_si
erpnext.patches.v8_10.add_payment_terms_field_to_supplier
diff --git a/erpnext/patches/v7_0/set_portal_settings.py b/erpnext/patches/v7_0/set_portal_settings.py
index ddc86c6..9bae1c5 100644
--- a/erpnext/patches/v7_0/set_portal_settings.py
+++ b/erpnext/patches/v7_0/set_portal_settings.py
@@ -4,7 +4,6 @@
from __future__ import unicode_literals
import frappe
-from erpnext.setup.setup_wizard import domainify
def execute():
frappe.reload_doctype('Role')
@@ -19,6 +18,9 @@
frappe.get_doc('Portal Settings').sync_menu()
if 'schools' in frappe.get_installed_apps():
- domainify.setup_domain('Education')
+ domain = frappe.get_doc('Domain', 'Education')
+ domain.setup_domain()
else:
- domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))
+ domain = frappe.get_doc('Domain', 'Manufacturing')
+ domain.setup_data()
+ domain.setup_sidebar_items()
diff --git a/erpnext/patches/v8_0/merge_student_batch_and_student_group.py b/erpnext/patches/v8_0/merge_student_batch_and_student_group.py
index aacd97b..ca71d36 100644
--- a/erpnext/patches/v8_0/merge_student_batch_and_student_group.py
+++ b/erpnext/patches/v8_0/merge_student_batch_and_student_group.py
@@ -9,7 +9,7 @@
def execute():
# for converting student batch into student group
- for doctype in ["Student Group", "Student Group Student",
+ for doctype in ["Student Group", "Student Group Student", 'Program Enrollment',
"Student Group Instructor", "Student Attendance", "Student", "Student Batch Name"]:
frappe.reload_doc("schools", "doctype", frappe.scrub(doctype))
diff --git a/erpnext/patches/v8_3/set_restrict_to_domain_for_module_def.py b/erpnext/patches/v8_3/set_restrict_to_domain_for_module_def.py
index 2f97ccf..6c4c6d5 100644
--- a/erpnext/patches/v8_3/set_restrict_to_domain_for_module_def.py
+++ b/erpnext/patches/v8_3/set_restrict_to_domain_for_module_def.py
@@ -4,11 +4,6 @@
from __future__ import unicode_literals
import frappe
-from erpnext.setup.setup_wizard.domainify import update_module_def_restrict_to_domain
-
def execute():
""" set the restrict to domain in module def """
-
- frappe.reload_doc("core", "doctype", "module_def")
- if frappe.db.get_single_value('System Settings', 'setup_complete'):
- update_module_def_restrict_to_domain()
\ No newline at end of file
+ pass
\ No newline at end of file
diff --git a/erpnext/patches/v8_9/set_print_zero_amount_taxes.py b/erpnext/patches/v8_9/set_print_zero_amount_taxes.py
index 621b573..3c508ea 100644
--- a/erpnext/patches/v8_9/set_print_zero_amount_taxes.py
+++ b/erpnext/patches/v8_9/set_print_zero_amount_taxes.py
@@ -4,5 +4,6 @@
from erpnext.setup.install import create_print_zero_amount_taxes_custom_field
def execute():
- frappe.reload_doc("printing", "doctype", "print_style")
+ frappe.reload_doc('printing', 'doctype', 'print_style')
+ frappe.reload_doc('printing', 'doctype', 'print_settings')
create_print_zero_amount_taxes_custom_field()
\ No newline at end of file
diff --git a/erpnext/patches/v9_0/set_variant_item_description.py b/erpnext/patches/v9_0/set_variant_item_description.py
new file mode 100644
index 0000000..c844571
--- /dev/null
+++ b/erpnext/patches/v9_0/set_variant_item_description.py
@@ -0,0 +1,45 @@
+import frappe
+from frappe.utils import cstr
+
+def execute():
+ '''
+ Issue:
+ While copying data from template item to variant item,
+ the system appending description multiple times to the respective variant.
+
+ Purpose:
+ Check variant description,
+ if variant have user defined description remove all system appended descriptions
+ else replace multiple system generated descriptions with single description
+
+ Steps:
+ 1. Get all variant items
+ 2. Create system generated variant description
+ 3. If variant have user defined description, remove all system generated descriptions
+ 4. If variant description only contains system generated description,
+ replace multiple descriptions by new description.
+ '''
+ for item in frappe.db.sql(""" select name from tabItem
+ where ifnull(variant_of, '') != '' """,as_dict=1):
+ variant = frappe.get_doc("Item", item.name)
+ temp_variant_description = '\n'
+
+ if variant.attributes:
+ for d in variant.attributes:
+ temp_variant_description += "<div>" + d.attribute + ": " + cstr(d.attribute_value) + "</div>"
+
+ variant_description = variant.description.replace(temp_variant_description, '').rstrip()
+ if variant_description:
+ splitted_desc = variant.description.strip().split(temp_variant_description)
+
+ if len(splitted_desc) > 2:
+ if splitted_desc[0] == '':
+ variant_description = temp_variant_description + variant_description
+ elif splitted_desc[1] == '' or splitted_desc[1] == '\n':
+ variant_description += temp_variant_description
+ variant.db_set('description', variant_description, update_modified=False)
+ else:
+ variant.db_set('description', variant_description, update_modified=False)
+
+ else:
+ variant.db_set('description', temp_variant_description, update_modified=False)
\ No newline at end of file
diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js
index ba1414c..1ea5962 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.js
+++ b/erpnext/projects/doctype/timesheet/timesheet.js
@@ -159,9 +159,14 @@
});
var calculate_end_time = function(frm, cdt, cdn) {
- var child = locals[cdt][cdn];
+ let child = locals[cdt][cdn];
- var d = moment(child.from_time);
+ if(!child.from_time) {
+ // if from_time value is not available then set the current datetime
+ frappe.model.set_value(cdt, cdn, "from_time", frappe.datetime.get_datetime_as_string());
+ }
+
+ let d = moment(child.from_time);
if(child.hours) {
d.add(child.hours, "hours");
frm._setting_hours = true;
diff --git a/erpnext/public/js/templates/item_selector.html b/erpnext/public/js/templates/item_selector.html
index 89171f8..58fb26c 100644
--- a/erpnext/public/js/templates/item_selector.html
+++ b/erpnext/public/js/templates/item_selector.html
@@ -1,16 +1,37 @@
-<div class="row pos-item-area">
+<div class="app-listing item-list image-view-container item-selector">
{% for (var i=0; i < data.length; i++) { var item = data[i]; %}
-<div class="col-xs-3 pos-item-wrapper">
- <div class="pos-item" data-name="{{ item.name }}">
- <div class="pos-item-image"
- {% if(item.image) { %}style="background-image: url({{ item.image }});"{% }
- else { %}style="background-color: {{ item.color }};"{% } %}>
- {% if(!item.image) { %}{{ item.abbr }}{% } %}
+ {% if (i % 4 === 0) { %}<div class="image-view-row">{% } %}
+ <div class="image-view-item" data-name="{{ item.name }}">
+ <div class="image-view-header doclist-row">
+ <div class="list-value">
+ <a class="grey list-id" data-name="{{item.name}}"
+ title="{{ item.item_name || item.name}}">
+ {{item.item_name || item.name}}</a>
+ </div>
</div>
- <div class="pos-item-text">
- <h6 class="item-code ellipsis">{{ item.name }}</h6>
+ <div class="image-view-body">
+ <a data-item-code="{{ item.name }}"
+ title="{{ item.item_name || item.name }}"
+ >
+ <div class="image-field"
+ style="
+ {% if (!item.image) { %}
+ background-color: #fafbfc;
+ {% } %}
+ border: 0px;"
+ >
+ {% if (!item.image) { %}
+ <span class="placeholder-text">
+ {%= frappe.get_abbr(item.item_name || item.name) %}
+ </span>
+ {% } %}
+ {% if (item.image) { %}
+ <img src="{{ item.image }}" alt="{{item.item_name || item.name}}">
+ {% } %}
+ </div>
+ </a>
</div>
</div>
-</div>
-{% } %}
+ {% if ((i % 4 === 3) || (i===data.length - 1)) { %}</div>{% } %}
+{% endfor %}
</div>
\ No newline at end of file
diff --git a/erpnext/public/js/utils/item_selector.js b/erpnext/public/js/utils/item_selector.js
index 98a17f2..d04c488 100644
--- a/erpnext/public/js/utils/item_selector.js
+++ b/erpnext/public/js/utils/item_selector.js
@@ -2,6 +2,14 @@
init: function(opts) {
$.extend(this, opts);
+ if (!this.item_field) {
+ this.item_field = 'item_code';
+ }
+
+ if (!this.item_query) {
+ this.item_query = erpnext.queries.item().query;
+ }
+
this.grid = this.frm.get_field("items").grid;
this.setup();
},
@@ -32,8 +40,8 @@
this.dialog.results = body.find('.results');
var me = this;
- this.dialog.results.on('click', '.pos-item', function() {
- me.add_item($(this).attr('data-name'))
+ this.dialog.results.on('click', '.image-view-item', function() {
+ me.add_item($(this).attr('data-name'));
});
this.dialog.input.on('keyup', function() {
@@ -52,35 +60,42 @@
var added = false;
// find row with item if exists
- $.each(this.frm.doc.items || [], function(i, d) {
- if(d.item_code===item_code) {
+ $.each(this.frm.doc.items || [], (i, d) => {
+ if(d[this.item_field]===item_code) {
frappe.model.set_value(d.doctype, d.name, 'qty', d.qty + 1);
- frappe.show_alert(__("Added {0} ({1})", [item_code, d.qty]));
+ frappe.show_alert({message: __("Added {0} ({1})", [item_code, d.qty]), indicator: 'green'});
added = true;
return false;
}
});
if(!added) {
- var d = this.grid.add_new_row();
- frappe.model.set_value(d.doctype, d.name, 'item_code', item_code);
-
- // after item fetch
- frappe.after_ajax(function() {
- setTimeout(function() {
+ var d = null;
+ frappe.run_serially([
+ () => { d = this.grid.add_new_row(); },
+ () => frappe.model.set_value(d.doctype, d.name, this.item_field, item_code),
+ () => frappe.timeout(0.1),
+ () => {
frappe.model.set_value(d.doctype, d.name, 'qty', 1);
- frappe.show_alert(__("Added {0} ({1})", [item_code, 1]));
- }, 100);
- });
+ frappe.show_alert({message: __("Added {0} ({1})", [item_code, 1]), indicator: 'green'});
+ }
+ ]);
}
},
render_items: function() {
- var args = erpnext.queries.item();
+ let args = {
+ query: this.item_query,
+ filters: {}
+ };
args.txt = this.dialog.input.val();
args.as_dict = 1;
+ if (this.get_filters) {
+ $.extend(args.filters, this.get_filters() || {});
+ }
+
var me = this;
frappe.link_search("Item", args, function(r) {
$.each(r.values, function(i, d) {
@@ -92,4 +107,4 @@
me.dialog.results.html(frappe.render_template('item_selector', {'data':r.values}));
});
}
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/__init__.py
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/doctype/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/doctype/__init__.py
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/doctype/restaurant/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/doctype/restaurant/__init__.py
diff --git a/erpnext/restaurant/doctype/restaurant/restaurant.js b/erpnext/restaurant/doctype/restaurant/restaurant.js
new file mode 100644
index 0000000..13fda73
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant/restaurant.js
@@ -0,0 +1,10 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Restaurant', {
+ refresh: function(frm) {
+ frm.add_custom_button(__('Order Entry'), () => {
+ frappe.set_route('Form', 'Restaurant Order Entry');
+ });
+ }
+});
diff --git a/erpnext/restaurant/doctype/restaurant/restaurant.json b/erpnext/restaurant/doctype/restaurant/restaurant.json
new file mode 100644
index 0000000..f4ecba7
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant/restaurant.json
@@ -0,0 +1,309 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "prompt",
+ "beta": 0,
+ "creation": "2017-09-15 12:40:41.546933",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach Image",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company",
+ "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": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "default_customer",
+ "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 Customer",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "invoice_series_prefix",
+ "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": "Invoice Series Prefix",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_4",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "active_menu",
+ "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": "Active Menu",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Restaurant Menu",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "default_tax_template",
+ "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 Tax Template",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Sales Taxes and Charges Template",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "address",
+ "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": "Address",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_field": "image",
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-10-05 17:41:14.422242",
+ "modified_by": "Administrator",
+ "module": "Restaurant",
+ "name": "Restaurant",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Hospitality",
+ "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/restaurant/doctype/restaurant/restaurant.py b/erpnext/restaurant/doctype/restaurant/restaurant.py
new file mode 100644
index 0000000..0bb7b69
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant/restaurant.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, 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 Restaurant(Document):
+ pass
diff --git a/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py b/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py
new file mode 100644
index 0000000..1f84ccf
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py
@@ -0,0 +1,16 @@
+from frappe import _
+
+def get_data():
+ return {
+ 'fieldname': 'restaurant',
+ 'transactions': [
+ {
+ 'label': _('Setup'),
+ 'items': ['Restaurant Menu', 'Restaurant Table']
+ },
+ {
+ 'label': _('Operations'),
+ 'items': ['Restaurant Reservation', 'Sales Invoice']
+ }
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.js b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
new file mode 100644
index 0000000..1cc7c7f
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
@@ -0,0 +1,37 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Restaurant", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(2);
+
+ frappe.run_serially([
+ // insert a new Restaurant
+ () => {
+ return frappe.tests.make('Restaurant', [
+ // values to be set
+ {__newname: 'Test Restaurant 1'},
+ {company: 'Test Company'},
+ {invoice_series_prefix: 'Test-Rest-1-Inv-'}
+ ])
+ },
+ () => {
+ assert.equal(cur_frm.doc.company, 'Test Company');
+ },
+ () => {
+ return frappe.tests.make('Restaurant', [
+ // values to be set
+ {__newname: 'Test Restaurant 2'},
+ {company: 'Test Company'},
+ {invoice_series_prefix: 'Test-Rest-3-Inv-'}
+ ]);
+ },
+ () => {
+ assert.equal(cur_frm.doc.company, 'Test Company');
+ },
+ () => done()
+ ]);
+});
diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.py b/erpnext/restaurant/doctype/restaurant/test_restaurant.py
new file mode 100644
index 0000000..3ba7f57
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+test_records = [
+ dict(doctype='Restaurant', name='Test Restaurant 1', company='_Test Company 1',
+ invoice_series_prefix='Test-Rest-1-Inv-', default_customer='_Test Customer 1'),
+ dict(doctype='Restaurant', name='Test Restaurant 2', company='_Test Company 1',
+ invoice_series_prefix='Test-Rest-2-Inv-', default_customer='_Test Customer 1'),
+]
+
+class TestRestaurant(unittest.TestCase):
+ pass
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/doctype/restaurant_menu/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/doctype/restaurant_menu/__init__.py
diff --git a/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.js b/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.js
new file mode 100644
index 0000000..da7d43f
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Restaurant Menu', {
+ setup: function(frm) {
+ frm.add_fetch('item', 'standard_rate', 'rate');
+ },
+});
diff --git a/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.json b/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.json
new file mode 100644
index 0000000..264634b
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.json
@@ -0,0 +1,247 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "prompt",
+ "beta": 0,
+ "creation": "2017-09-15 12:48:29.818715",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "restaurant",
+ "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": "Restaurant",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Restaurant",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "enabled",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Enabled",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "price_list",
+ "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": "Price List (Auto created)",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Price List",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Items",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Restaurant Menu Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-09-21 11:04:20.671542",
+ "modified_by": "Administrator",
+ "module": "Restaurant",
+ "name": "Restaurant Menu",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Restaurant Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Hospitality",
+ "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/restaurant/doctype/restaurant_menu/restaurant_menu.py b/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.py
new file mode 100644
index 0000000..83020b6
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, 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 RestaurantMenu(Document):
+ def validate(self):
+ for d in self.items:
+ if not d.rate:
+ d.rate = frappe.db.get_value('Item', d.item, 'standard_rate')
+
+ def on_update(self):
+ '''Sync Price List'''
+ self.make_price_list()
+
+ def on_trash(self):
+ '''clear prices'''
+ self.clear_item_price()
+
+ def clear_item_price(self, price_list=None):
+ '''clear all item prices for this menu'''
+ if not price_list:
+ price_list = self.get_price_list().name
+ frappe.db.sql('delete from `tabItem Price` where price_list = %s', price_list)
+
+ def make_price_list(self):
+ # create price list for menu
+ price_list = self.get_price_list()
+ self.db_set('price_list', price_list.name)
+
+ # delete old items
+ self.clear_item_price(price_list.name)
+
+ for d in self.items:
+ frappe.get_doc(dict(
+ doctype = 'Item Price',
+ price_list = price_list.name,
+ item_code = d.item,
+ price_list_rate = d.rate
+ )).insert()
+
+ def get_price_list(self):
+ '''Create price list for menu if missing'''
+ price_list_name = frappe.db.get_value('Price List', dict(restaurant_menu=self.name))
+ if price_list_name:
+ price_list = frappe.get_doc('Price List', price_list_name)
+ else:
+ price_list = frappe.new_doc('Price List')
+ price_list.restaurant_menu = self.name
+ price_list.price_list_name = self.name
+
+ price_list.enabled = 1
+ price_list.selling = 1
+ price_list.save()
+
+ return price_list
+
+
diff --git a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
new file mode 100644
index 0000000..25057d8
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
@@ -0,0 +1,75 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Restaurant Menu", function (assert) {
+ let done = assert.async();
+
+ let items = {
+ "Food Item 1": [
+ {item_code: "Food Item 1"},
+ {item_group: "Products"},
+ {is_stock_item: 1},
+ ],
+ "Food Item 2": [
+ {item_code: "Food Item 2"},
+ {item_group: "Products"},
+ {is_stock_item: 1},
+ ],
+ "Test Product 3": [
+ {item_code: "Food Item 3"},
+ {item_group: "Products"},
+ {is_stock_item: 1},
+ ]
+ };
+
+
+ // number of asserts
+ assert.expect(0);
+
+ frappe.run_serially([
+ // insert a new Restaurant Menu
+ () => frappe.tests.setup_doctype('Item', items),
+ () => {
+ return frappe.tests.make("Restaurant Menu", [
+ {__newname: 'Restaurant Menu 1'},
+ {restaurant: "Test Restaurant 1"},
+ {items: [
+ [
+ {"item": "Food Item 1"},
+ {"rate": 100}
+ ],
+ [
+ {"item": "Food Item 2"},
+ {"rate": 90}
+ ],
+ [
+ {"item": "Food Item 3"},
+ {"rate": 80}
+ ]
+ ]}
+ ]);
+ },
+ () => {
+ return frappe.tests.make("Restaurant Menu", [
+ {__newname: 'Restaurant Menu 2'},
+ {restaurant: "Test Restaurant 2"},
+ {items: [
+ [
+ {"item": "Food Item 1"},
+ {"rate": 105}
+ ],
+ [
+ {"item": "Food Item 3"},
+ {"rate": 85}
+ ]
+ ]}
+ ]);
+ },
+ () => frappe.set_route('Form', 'Restaurant', 'Test Restaurant 1'),
+ () => cur_frm.set_value('active_menu', 'Restaurant Menu 1'),
+ () => cur_frm.save(),
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.py b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.py
new file mode 100644
index 0000000..99766f7
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+test_records = [
+ dict(doctype='Item', item_code='Food Item 1',
+ item_group='Products', is_stock_item=0),
+ dict(doctype='Item', item_code='Food Item 2',
+ item_group='Products', is_stock_item=0),
+ dict(doctype='Item', item_code='Food Item 3',
+ item_group='Products', is_stock_item=0),
+ dict(doctype='Item', item_code='Food Item 4',
+ item_group='Products', is_stock_item=0),
+ dict(doctype='Restaurant Menu', restaurant='Test Restaurant 1', name='Test Restaurant 1 Menu 1',
+ items = [
+ dict(item='Food Item 1', rate=400),
+ dict(item='Food Item 2', rate=300),
+ dict(item='Food Item 3', rate=200),
+ dict(item='Food Item 4', rate=100),
+ ]),
+ dict(doctype='Restaurant Menu', restaurant='Test Restaurant 1', name='Test Restaurant 1 Menu 2',
+ items = [
+ dict(item='Food Item 1', rate=450),
+ dict(item='Food Item 2', rate=350),
+ ])
+]
+
+class TestRestaurantMenu(unittest.TestCase):
+ def test_price_list_creation_and_editing(self):
+ menu1 = frappe.get_doc('Restaurant Menu', 'Test Restaurant 1 Menu 1')
+ menu1.save()
+
+ menu2 = frappe.get_doc('Restaurant Menu', 'Test Restaurant 1 Menu 2')
+ menu2.save()
+
+ self.assertTrue(frappe.db.get_value('Price List', 'Test Restaurant 1 Menu 1'))
+ self.assertEquals(frappe.db.get_value('Item Price',
+ dict(price_list = 'Test Restaurant 1 Menu 1', item_code='Food Item 1'), 'price_list_rate'), 400)
+ self.assertEquals(frappe.db.get_value('Item Price',
+ dict(price_list = 'Test Restaurant 1 Menu 2', item_code='Food Item 1'), 'price_list_rate'), 450)
+
+ menu1.items[0].rate = 401
+ menu1.save()
+
+ self.assertEquals(frappe.db.get_value('Item Price',
+ dict(price_list = 'Test Restaurant 1 Menu 1', item_code='Food Item 1'), 'price_list_rate'), 401)
+
+ menu1.items[0].rate = 400
+ menu1.save()
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/doctype/restaurant_menu_item/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/doctype/restaurant_menu_item/__init__.py
diff --git a/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.json b/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.json
new file mode 100644
index 0000000..87568bf
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.json
@@ -0,0 +1,105 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "",
+ "beta": 0,
+ "creation": "2017-09-15 12:49:36.072636",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "item",
+ "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": "Item",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "rate",
+ "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": "Rate",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "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": "2017-09-15 14:18:55.145088",
+ "modified_by": "Administrator",
+ "module": "Restaurant",
+ "name": "Restaurant Menu Item",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Hospitality",
+ "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/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py b/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py
new file mode 100644
index 0000000..cc86bb3
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, 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 RestaurantMenuItem(Document):
+ pass
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/doctype/restaurant_order_entry/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/doctype/restaurant_order_entry/__init__.py
diff --git a/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js b/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js
new file mode 100644
index 0000000..8867e7d
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js
@@ -0,0 +1,162 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Restaurant Order Entry', {
+ setup: function(frm) {
+ let get_item_query = () => {
+ return {
+ query: 'erpnext.restaurant.doctype.restaurant_order_entry.restaurant_order_entry.item_query_restaurant',
+ filters: {
+ 'table': frm.doc.restaurant_table
+ }
+ };
+ };
+ frm.set_query('item', 'items', get_item_query);
+ frm.set_query('add_item', get_item_query);
+ },
+ onload_post_render: function(frm) {
+ if(!this.item_selector) {
+ this.item_selector = new erpnext.ItemSelector({
+ frm: frm,
+ item_field: 'item',
+ item_query: 'erpnext.restaurant.doctype.restaurant_order_entry.restaurant_order_entry.item_query_restaurant',
+ get_filters: () => {
+ return {table: frm.doc.restaurant_table};
+ }
+ });
+ }
+
+ let $input = frm.get_field('add_item').$input;
+
+ $input.on('keyup', function(e) {
+ if (e.which===13) {
+ if (frm.clear_item_timeout) {
+ clearTimeout (frm.clear_item_timeout);
+ }
+
+ // clear the item input so user can enter a new item
+ frm.clear_item_timeout = setTimeout (() => {
+ frm.set_value('add_item', '');
+ }, 1000);
+
+ let item = $input.val();
+
+ if (!item) return;
+
+ var added = false;
+ (frm.doc.items || []).forEach((d) => {
+ if (d.item===item) {
+ d.qty += 1;
+ added = true;
+ }
+ });
+
+ return frappe.run_serially([
+ () => {
+ if (!added) {
+ return frm.add_child('items', {item: item, qty: 1});
+ }
+ },
+ () => frm.get_field("items").refresh()
+ ]);
+ }
+ });
+ },
+ refresh: function(frm) {
+ frm.disable_save();
+ frm.add_custom_button(__('Update'), () => {
+ return frm.trigger('sync');
+ });
+ frm.add_custom_button(__('Clear'), () => {
+ return frm.trigger('clear');
+ });
+ frm.add_custom_button(__('Bill'), () => {
+ return frm.trigger('make_invoice');
+ });
+ },
+ clear: function(frm) {
+ frm.doc.add_item = '';
+ frm.doc.grand_total = 0;
+ frm.doc.items = [];
+ frm.refresh();
+ frm.get_field('add_item').$input.focus();
+ },
+ restaurant_table: function(frm) {
+ // select the open sales order items for this table
+ if (!frm.doc.restaurant_table) {
+ return;
+ }
+ return frappe.call({
+ method: 'erpnext.restaurant.doctype.restaurant_order_entry.restaurant_order_entry.get_invoice',
+ args: {
+ table: frm.doc.restaurant_table
+ },
+ callback: (r) => {
+ frm.events.set_invoice_items(frm, r);
+ }
+ });
+ },
+ sync: function(frm) {
+ return frappe.call({
+ method: 'erpnext.restaurant.doctype.restaurant_order_entry.restaurant_order_entry.sync',
+ args: {
+ table: frm.doc.restaurant_table,
+ items: frm.doc.items
+ },
+ callback: (r) => {
+ frm.events.set_invoice_items(frm, r);
+ frappe.show_alert({message: __('Saved'), indicator: 'green'});
+ }
+ });
+
+ },
+ make_invoice: function(frm) {
+ frm.trigger('sync').then(() => {
+ frappe.prompt([
+ {
+ fieldname: 'customer',
+ label: __('Customer'),
+ fieldtype: 'Link',
+ reqd: 1,
+ options: 'Customer',
+ 'default': frm.invoice.customer
+ },
+ {
+ fieldname: 'mode_of_payment',
+ label: __('Mode of Payment'),
+ fieldtype: 'Link',
+ reqd: 1,
+ options: 'Mode of Payment',
+ 'default': frm.mode_of_payment || ''
+ }
+ ], (data) => {
+ // cache this for next entry
+ frm.mode_of_payment = data.mode_of_payment;
+ return frappe.call({
+ method: 'erpnext.restaurant.doctype.restaurant_order_entry.restaurant_order_entry.make_invoice',
+ args: {
+ table: frm.doc.restaurant_table,
+ customer: data.customer,
+ mode_of_payment: data.mode_of_payment
+ },
+ callback: (r) => {
+ frm.set_value('last_sales_invoice', r.message);
+ frm.trigger('clear');
+ }
+ });
+ },
+ __("Select Customer"));
+ });
+ },
+ set_invoice_items: function(frm, r) {
+ let invoice = r.message;
+ frm.doc.items = [];
+ (invoice.items || []).forEach((d) => {
+ frm.add_child('items', {item: d.item_code, qty: d.qty, rate: d.rate});
+ });
+ frm.set_value('grand_total', invoice.grand_total);
+ frm.set_value('last_sales_invoice', invoice.name);
+ frm.invoice = invoice;
+ frm.refresh();
+ }
+});
diff --git a/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.json b/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.json
new file mode 100644
index 0000000..3e4d593
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.json
@@ -0,0 +1,280 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 1,
+ "creation": "2017-09-15 15:10:24.530365",
+ "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": "restaurant_table",
+ "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": "Restaurant Table",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Restaurant Table",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "restaurant_table",
+ "description": "Click Enter To Add",
+ "fieldname": "add_item",
+ "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": "Add Item",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "grand_total",
+ "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": "Grand Total",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "last_sales_invoice",
+ "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": "Last Sales Invoice",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "restaurant_table",
+ "fieldname": "current_order",
+ "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": "Current Order",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "restaurant_table",
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Restaurant Order Entry Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 1,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-10-04 17:06:20.926999",
+ "modified_by": "Administrator",
+ "module": "Restaurant",
+ "name": "Restaurant Order Entry",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Restaurant Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Hospitality",
+ "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/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.py b/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.py
new file mode 100644
index 0000000..a748f9a
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.py
@@ -0,0 +1,87 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe, json
+from frappe.model.document import Document
+from frappe import _
+from erpnext.controllers.queries import item_query
+
+class RestaurantOrderEntry(Document):
+ pass
+
+@frappe.whitelist()
+def get_invoice(table):
+ '''returns the active invoice linked to the given table'''
+ invoice_name = frappe.get_value('Sales Invoice', dict(restaurant_table = table, docstatus=0))
+ restaurant, menu_name = get_restaurant_and_menu_name(table)
+ if invoice_name:
+ invoice = frappe.get_doc('Sales Invoice', invoice_name)
+ else:
+ invoice = frappe.new_doc('Sales Invoice')
+ invoice.naming_series = frappe.db.get_value('Restaurant', restaurant, 'invoice_series_prefix')
+ invoice.is_pos = 1
+ default_customer = frappe.db.get_value('Restaurant', restaurant, 'default_customer')
+ if not default_customer:
+ frappe.throw(_('Please set default customer in Restaurant Settings'))
+ invoice.customer = default_customer
+
+ invoice.taxes_and_charges = frappe.db.get_value('Restaurant', restaurant, 'default_tax_template')
+ invoice.selling_price_list = frappe.db.get_value('Price List', dict(restaurant_menu=menu_name, enabled=1))
+
+ return invoice
+
+@frappe.whitelist()
+def sync(table, items):
+ '''Sync the sales order related to the table'''
+ invoice = get_invoice(table)
+ items = json.loads(items)
+
+ invoice.items = []
+ invoice.restaurant_table = table
+ for d in items:
+ invoice.append('items', dict(
+ item_code = d.get('item'),
+ qty = d.get('qty')
+ ))
+
+ invoice.save()
+ return invoice.as_dict()
+
+@frappe.whitelist()
+def make_invoice(table, customer, mode_of_payment):
+ '''Make table based on Sales Order'''
+ restaurant, menu = get_restaurant_and_menu_name(table)
+ invoice = get_invoice(table)
+ invoice.customer = customer
+ invoice.restaurant = restaurant
+ invoice.calculate_taxes_and_totals()
+ invoice.append('payments', dict(mode_of_payment=mode_of_payment, amount=invoice.grand_total))
+ invoice.save()
+ invoice.submit()
+
+ frappe.msgprint(_('Invoice Created'), indicator='green', alert=True)
+
+ return invoice.name
+
+def item_query_restaurant(doctype='Item', txt='', searchfield='name', start=0, page_len=20, filters=None, as_dict=False):
+ '''Return items that are selected in active menu of the restaurant'''
+ restaurant, menu = get_restaurant_and_menu_name(filters['table'])
+ items = frappe.db.get_all('Restaurant Menu Item', ['item'], dict(parent = menu))
+ del filters['table']
+ filters['name'] = ('in', [d.item for d in items])
+
+ return item_query('Item', txt, searchfield, start, page_len, filters, as_dict)
+
+def get_restaurant_and_menu_name(table):
+ if not table:
+ frappe.throw(_('Please select a table'))
+
+ restaurant = frappe.db.get_value('Restaurant Table', table, 'restaurant')
+ menu = frappe.db.get_value('Restaurant', restaurant, 'active_menu')
+
+ if not menu:
+ frappe.throw(_('Please set an active menu for Restaurant {0}').format(restaurant))
+
+ return restaurant, menu
\ No newline at end of file
diff --git a/erpnext/restaurant/doctype/restaurant_order_entry/test_restaurant_order_entry.js b/erpnext/restaurant/doctype/restaurant_order_entry/test_restaurant_order_entry.js
new file mode 100644
index 0000000..fec2a21
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_order_entry/test_restaurant_order_entry.js
@@ -0,0 +1,53 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Restaurant Order Entry", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(5);
+
+ frappe.run_serially([
+ // insert a new Restaurant Order Entry
+ () => frappe.set_route('Form', 'Restaurant Settings'),
+ () => cur_frm.set_value('default_customer', 'Test Customer 1'),
+ () => cur_frm.save(),
+ () => frappe.set_route('Form', 'Restaurant Order Entry'),
+ () => frappe.click_button('Clear'),
+ () => frappe.timeout(2),
+ () => cur_frm.set_value('restaurant_table', 'Test-Restaurant-1-01'),
+ () => cur_frm.set_value('add_item', 'Food Item 1'),
+ () => frappe.timeout(0.5),
+ () => {
+ var e = $.Event( "keyup", {which: 13} );
+ $('input[data-fieldname="add_item"]').trigger(e);
+ return frappe.timeout(0.5);
+ },
+ () => cur_frm.set_value('add_item', 'Food Item 1'),
+ () => {
+ var e = $.Event( "keyup", {which: 13} );
+ $('input[data-fieldname="add_item"]').trigger(e);
+ return frappe.timeout(0.5);
+ },
+ () => cur_frm.set_value('add_item', 'Food Item 2'),
+ () => {
+ var e = $.Event( "keyup", {which: 13} );
+ $('input[data-fieldname="add_item"]').trigger(e);
+ return frappe.timeout(0.5);
+ },
+ () => {
+ assert.equal(cur_frm.doc.items[0].item, 'Food Item 1');
+ assert.equal(cur_frm.doc.items[0].qty, 2);
+ assert.equal(cur_frm.doc.items[1].item, 'Food Item 2');
+ assert.equal(cur_frm.doc.items[1].qty, 1);
+ },
+ () => frappe.click_button('Update'),
+ () => frappe.timeout(2),
+ () => {
+ assert.equal(cur_frm.doc.grand_total, 290);
+ }
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/restaurant/doctype/restaurant_order_entry/test_restaurant_order_entry.py b/erpnext/restaurant/doctype/restaurant_order_entry/test_restaurant_order_entry.py
new file mode 100644
index 0000000..59605b1
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_order_entry/test_restaurant_order_entry.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe, json
+import unittest
+
+from erpnext.restaurant.doctype.restaurant_order_entry.restaurant_order_entry \
+ import (sync, make_invoice, item_query_restaurant)
+
+class TestRestaurantOrderEntry(unittest.TestCase):
+ def setUp(self):
+ # save the menus as Price List is deleted before tests...
+ frappe.get_doc('Restaurant Menu', 'Test Restaurant 1 Menu 1').save()
+ frappe.get_doc('Restaurant Menu', 'Test Restaurant 1 Menu 2').save()
+
+ if not frappe.db.get_value('Restaurant', 'Test Restaurant 1', 'active_menu'):
+ restaurant = frappe.get_doc('Restaurant', 'Test Restaurant 1')
+ restaurant.active_menu = 'Test Restaurant 1 Menu 1'
+ restaurant.save()
+
+ def test_update_order(self):
+ table = frappe.db.get_value('Restaurant Table', dict(restaurant = 'Test Restaurant 1'))
+ invoice = sync(table,
+ json.dumps([dict(item='Food Item 1', qty = 10), dict(item='Food Item 2', qty = 2)]))
+
+ self.assertEquals(invoice.get('restaurant_table'), table)
+ self.assertEquals(invoice.get('items')[0].get('item_code'), 'Food Item 1')
+ self.assertEquals(invoice.get('items')[1].get('item_code'), 'Food Item 2')
+ self.assertEquals(invoice.get('net_total'), 4600)
+
+ return table
+
+ def test_billing(self):
+ table = self.test_update_order()
+ invoice_name = make_invoice(table, '_Test Customer', 'Cash')
+
+ sales_invoice = frappe.get_doc('Sales Invoice', invoice_name)
+
+ self.assertEquals(sales_invoice.grand_total, 4600)
+ self.assertEquals(sales_invoice.items[0].item_code, 'Food Item 1')
+ self.assertEquals(sales_invoice.items[1].item_code, 'Food Item 2')
+ self.assertEquals(sales_invoice.payments[0].mode_of_payment, 'Cash')
+ self.assertEquals(sales_invoice.payments[0].amount, 4600)
+
+ def test_item_query(self):
+ table = frappe.db.get_value('Restaurant Table', dict(restaurant = 'Test Restaurant 1'))
+ result = item_query_restaurant(filters=dict(table=table))
+ items = [d[0] for d in result]
+ self.assertTrue('Food Item 1' in items)
+ self.assertTrue('_Test Item 1' not in items)
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/doctype/restaurant_order_entry_item/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/doctype/restaurant_order_entry_item/__init__.py
diff --git a/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.json b/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.json
new file mode 100644
index 0000000..0240013
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.json
@@ -0,0 +1,163 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-09-15 15:11:50.313241",
+ "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": "item",
+ "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": "Item",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "qty",
+ "fieldtype": "Int",
+ "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": "Qty",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "served",
+ "fieldtype": "Int",
+ "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": "Served",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "rate",
+ "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": "Rate",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "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": "2017-09-21 08:39:27.232175",
+ "modified_by": "Administrator",
+ "module": "Restaurant",
+ "name": "Restaurant Order Entry Item",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Hospitality",
+ "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/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py b/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py
new file mode 100644
index 0000000..e0c051b
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, 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 RestaurantOrderEntryItem(Document):
+ pass
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/doctype/restaurant_reservation/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/doctype/restaurant_reservation/__init__.py
diff --git a/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.js b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.js
new file mode 100644
index 0000000..9218338
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Restaurant Reservation', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.json b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.json
new file mode 100644
index 0000000..6a2ffa1
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.json
@@ -0,0 +1,337 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "REST.######",
+ "beta": 0,
+ "creation": "2017-09-15 13:05:51.063661",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Open\nWaitlisted\nCancelled\nNo Show\nSuccess",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "restaurant",
+ "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": "Restaurant",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Restaurant",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "no_of_people",
+ "fieldtype": "Int",
+ "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": "No of People",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "reservation_time",
+ "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": "Reservation Time",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "reservation_end_time",
+ "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": "Reservation End Time",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_4",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customer",
+ "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": "Customer",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 1,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Customer Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contact_number",
+ "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": "Contact Number",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-09-15 14:40:56.759315",
+ "modified_by": "Administrator",
+ "module": "Restaurant",
+ "name": "Restaurant Reservation",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Restaurant Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Hospitality",
+ "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/restaurant/doctype/restaurant_reservation/restaurant_reservation.py b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py
new file mode 100644
index 0000000..63a36f0
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, 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
+from datetime import timedelta
+from frappe.utils import get_datetime
+
+class RestaurantReservation(Document):
+ def validate(self):
+ if not self.reservation_end_time:
+ self.reservation_end_time = get_datetime(self.reservation_time) + timedelta(hours=1)
+
+@frappe.whitelist()
+def get_events(start, end, filters=None):
+ """Returns events for Gantt / Calendar view rendering.
+
+ :param start: Start date-time.
+ :param end: End date-time.
+ :param filters: Filters (JSON).
+ """
+ from frappe.desk.calendar import get_event_conditions
+ conditions = get_event_conditions("Restaurant Reservation", filters)
+
+ data = frappe.db.sql("""select name, reservation_time,
+ reservation_end_time, customer_name, status, no_of_people
+ from
+ `tabRestaurant Reservation`
+ where
+ ((ifnull(reservation_time, '0000-00-00')!= '0000-00-00') \
+ and (reservation_time <= %(end)s) \
+ or ((ifnull(reservation_end_time, '0000-00-00')!= '0000-00-00') \
+ and reservation_end_time >= %(start)s))
+ {conditions}""".format(conditions=conditions), {
+ "start": start,
+ "end": end
+ }, as_dict=True, update={"allDay": 0})
+
+ return data
diff --git a/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation_calendar.js b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation_calendar.js
new file mode 100644
index 0000000..09e8f8d
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation_calendar.js
@@ -0,0 +1,18 @@
+frappe.views.calendar["Restaurant Reservation"] = {
+ field_map: {
+ "start": "reservation_time",
+ "end": "reservation_end_time",
+ "id": "name",
+ "title": "customer_name",
+ "allDay": "allDay",
+ },
+ gantt: true,
+ filters: [
+ {
+ "fieldtype": "Data",
+ "fieldname": "customer_name",
+ "label": __("Customer Name")
+ }
+ ],
+ get_events_method: "erpnext.restaurant.doctype.restaurant_reservation.restaurant_reservation.get_events"
+};
diff --git a/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.js b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.js
new file mode 100644
index 0000000..eeea5a9
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.js
@@ -0,0 +1,27 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Restaurant Reservation", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Restaurant Reservation
+ () => frappe.tests.make('Restaurant Reservation', [
+ // values to be set
+ {restaurant: 'Gokul - JP Nagar'},
+ {customer_name: 'test customer'},
+ {reservation_time: frappe.datetime.now_date() + " 19:00:00"},
+ {no_of_people: 4},
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.reservation_end_time,
+ frappe.datetime.now_date() + ' 20:00:00');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py
new file mode 100644
index 0000000..71681b2
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestRestaurantReservation(unittest.TestCase):
+ pass
diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/restaurant/doctype/restaurant_table/__init__.py
similarity index 100%
copy from erpnext/docs/user/manual/en/subscription/__init__.py
copy to erpnext/restaurant/doctype/restaurant_table/__init__.py
diff --git a/erpnext/restaurant/doctype/restaurant_table/restaurant_table.js b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.js
new file mode 100644
index 0000000..a55605c
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Restaurant Table', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/restaurant/doctype/restaurant_table/restaurant_table.json b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.json
new file mode 100644
index 0000000..da1bcde
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.json
@@ -0,0 +1,156 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "",
+ "beta": 0,
+ "creation": "2017-09-15 12:45:24.717355",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "restaurant",
+ "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": "Restaurant",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Restaurant",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "no_of_seats",
+ "fieldtype": "Int",
+ "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": "No of Seats",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "minimum_seating",
+ "fieldtype": "Int",
+ "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": "Minimum Seating",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-09-15 13:18:05.254106",
+ "modified_by": "Administrator",
+ "module": "Restaurant",
+ "name": "Restaurant Table",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Restaurant Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Hospitality",
+ "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/restaurant/doctype/restaurant_table/restaurant_table.py b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py
new file mode 100644
index 0000000..d5ea9d5
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe, re
+from frappe.model.document import Document
+from frappe.model.naming import make_autoname
+
+class RestaurantTable(Document):
+ def autoname(self):
+ prefix = re.sub('-+', '-', self.restaurant.replace(' ', '-'))
+ self.name = make_autoname(prefix + '-.##')
diff --git a/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.js b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.js
new file mode 100644
index 0000000..16035f0
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.js
@@ -0,0 +1,41 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Restaurant Table", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(0);
+
+ frappe.run_serially([
+ // insert a new Restaurant Table
+ () => frappe.tests.make('Restaurant Table', [
+ // values to be set
+ {restaurant: 'Test Restaurant 1'},
+ {no_of_seats: 4},
+ ]),
+ () => frappe.tests.make('Restaurant Table', [
+ // values to be set
+ {restaurant: 'Test Restaurant 1'},
+ {no_of_seats: 5},
+ ]),
+ () => frappe.tests.make('Restaurant Table', [
+ // values to be set
+ {restaurant: 'Test Restaurant 1'},
+ {no_of_seats: 2},
+ ]),
+ () => frappe.tests.make('Restaurant Table', [
+ // values to be set
+ {restaurant: 'Test Restaurant 1'},
+ {no_of_seats: 2},
+ ]),
+ () => frappe.tests.make('Restaurant Table', [
+ // values to be set
+ {restaurant: 'Test Restaurant 1'},
+ {no_of_seats: 6},
+ ]),
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py
new file mode 100644
index 0000000..ffdb6f7
--- /dev/null
+++ b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+test_records = [
+ dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1),
+ dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1),
+ dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1),
+ dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1),
+]
+
+class TestRestaurantTable(unittest.TestCase):
+ pass
diff --git a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
index 2b407c7..9bdf621 100644
--- a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
+++ b/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
@@ -172,20 +172,19 @@
def get_chart_data(grades, assessment_criteria_list, kounter):
grades = sorted(grades)
- chart_data = []
- chart_data.append(["x"] + assessment_criteria_list)
+ datasets = []
for grade in grades:
- tmp = [grade]
+ tmp = []
for ac in assessment_criteria_list:
if grade in kounter[ac]:
tmp.append(kounter[ac][grade])
else:
tmp.append(0)
- chart_data.append(tmp)
+ datasets.append(tmp)
return {
"data": {
- "x": "x",
- "columns": chart_data
+ "labels": assessment_criteria_list,
+ "datasets": datasets
},
- "chart_type": 'bar',
+ "type": 'bar',
}
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js
index c042244..5feae9c 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.js
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.js
@@ -48,6 +48,7 @@
this.prepare_menu();
this.set_online_status();
},
+ () => this.setup_company(),
() => this.setup_pos_profile(),
() => this.make_new_invoice(),
() => {
@@ -101,16 +102,11 @@
if (!this.payment) {
this.make_payment_modal();
} else {
- const mop_field = this.payment.default_mop;
- let amount = 0.0;
this.frm.doc.payments.map(p => {
- if (p.mode_of_payment == mop_field) {
- amount = p.amount;
- return;
- }
+ this.payment.dialog.set_value(p.mode_of_payment, p.amount);
});
- this.payment.dialog.set_value(mop_field, flt(amount));
+ this.payment.set_title();
}
this.payment.open_modal();
}
@@ -286,21 +282,40 @@
}
setup_pos_profile() {
- return frappe.call({
- method: 'erpnext.stock.get_item_details.get_pos_profile',
- args: {
- company: frappe.sys_defaults.company
- }
- }).then(r => {
- this.pos_profile = r.message;
+ return new Promise(resolve => {
+ frappe.call({
+ method: 'erpnext.stock.get_item_details.get_pos_profile',
+ args: {
+ company: this.company
+ }
+ }).then(r => {
+ this.pos_profile = r.message;
- if (!this.pos_profile) {
- this.pos_profile = {
- currency: frappe.defaults.get_default('currency'),
- selling_price_list: frappe.defaults.get_default('selling_price_list')
- };
+ if (!this.pos_profile) {
+ this.pos_profile = {
+ company: this.company,
+ currency: frappe.defaults.get_default('currency'),
+ selling_price_list: frappe.defaults.get_default('selling_price_list')
+ };
+ }
+ resolve();
+ });
+ })
+ }
+
+ setup_company() {
+ this.company = frappe.sys_defaults.company;
+ return new Promise(resolve => {
+ if(!this.company) {
+ frappe.prompt({fieldname:"company", options: "Company", fieldtype:"Link",
+ label: __("Select Company"), reqd: 1}, (data) => {
+ this.company = data.company;
+ resolve(this.company);
+ }, __("Select Company"));
+ } else {
+ resolve(this.company);
}
- });
+ })
}
make_new_invoice() {
@@ -322,22 +337,25 @@
const doctype = 'Sales Invoice';
return new Promise(resolve => {
if (this.frm) {
- this.frm = get_frm(this.frm);
+ this.frm = get_frm(this.pos_profile, this.frm);
resolve();
} else {
frappe.model.with_doctype(doctype, () => {
- this.frm = get_frm();
+ this.frm = get_frm(this.pos_profile);
resolve();
});
}
});
- function get_frm(_frm) {
+ function get_frm(pos_profile, _frm) {
const page = $('<div>');
const frm = _frm || new _f.Frm(doctype, page, false);
const name = frappe.model.make_new_doc_and_get_name(doctype, true);
frm.refresh(name);
frm.doc.items = [];
+ if(!frm.doc.company) {
+ frm.set_value('company', pos_profile.company);
+ }
frm.set_value('is_pos', 1);
frm.meta.default_print_format = 'POS Invoice';
return frm;
@@ -918,7 +936,7 @@
const all_items = Object.values(_items).map(item => this.get_item_html(item));
let row_items = [];
- const row_container = '<div style="display: flex; border-bottom: 1px solid #ebeff2">';
+ const row_container = '<div class="image-view-row">';
let curr_row = row_container;
for (let i=0; i < all_items.length; i++) {
@@ -1185,16 +1203,13 @@
make() {
this.set_flag();
-
- let title = __('Total Amount {0}',
- [format_currency(this.frm.doc.grand_total, this.frm.doc.currency)]);
-
this.dialog = new frappe.ui.Dialog({
- title: title,
fields: this.get_fields(),
width: 800
});
+ this.set_title();
+
this.$body = this.dialog.body;
this.numpad = new NumberPad({
@@ -1213,6 +1228,13 @@
});
}
+ set_title() {
+ let title = __('Total Amount {0}',
+ [format_currency(this.frm.doc.grand_total, this.frm.doc.currency)]);
+
+ this.dialog.set_title(title);
+ }
+
bind_events() {
var me = this;
$(this.dialog.body).find('.input-with-feedback').focusin(function() {
@@ -1234,10 +1256,6 @@
const me = this;
let fields = this.frm.doc.payments.map(p => {
- if (p.default) {
- this.default_mop = p.mode_of_payment;
- }
-
return {
fieldtype: 'Currency',
label: __(p.mode_of_payment),
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py
index 5694ad9..b92c653 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.py
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.py
@@ -9,6 +9,8 @@
def get_items(start, page_length, price_list, item_group, search_value=""):
serial_no = ""
batch_no = ""
+ barcode = ""
+
item_code = search_value
if not frappe.db.exists('Item Group', item_group):
item_group = get_root_of('Item Group')
@@ -24,7 +26,12 @@
if batch_no_data:
batch_no, item_code = batch_no_data
- item_code, condition = get_conditions(item_code, serial_no, batch_no)
+ if not serial_no and not batch_no:
+ barcode_data = frappe.db.get_value('Item', {'barcode': search_value}, ['name', 'barcode'])
+ if barcode_data:
+ item_code, barcode = barcode_data
+
+ item_code, condition = get_conditions(item_code, serial_no, batch_no, barcode)
lft, rgt = frappe.db.get_value('Item Group', item_group, ['lft', 'rgt'])
# locate function is used to sort by closest match from the beginning of the value
@@ -62,12 +69,12 @@
return res
-def get_conditions(item_code, serial_no, batch_no):
- if serial_no or batch_no:
+def get_conditions(item_code, serial_no, batch_no, barcode):
+ if serial_no or batch_no or barcode:
return frappe.db.escape(item_code), "i.item_code = %(item_code)s"
condition = """(i.item_code like %(item_code)s
- or i.item_name like %(item_code)s or i.barcode like %(item_code)s)"""
+ or i.item_name like %(item_code)s)"""
return '%%%s%%'%(frappe.db.escape(item_code)), condition
diff --git a/erpnext/setup/setup_wizard/domainify.py b/erpnext/setup/setup_wizard/domainify.py
deleted file mode 100644
index ddb2a80..0000000
--- a/erpnext/setup/setup_wizard/domainify.py
+++ /dev/null
@@ -1,178 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe import _
-
-def get_domain(domain):
- '''Written as a function to prevent data mutation effects'''
- data = {
- 'Manufacturing': {
- 'desktop_icons': ['Item', 'BOM', 'Customer', 'Supplier', 'Sales Order',
- 'Production Order', 'Stock Entry', 'Purchase Order', 'Task', 'Buying', 'Selling',
- 'Accounts', 'HR', 'ToDo'],
- 'remove_roles': ['Academics User', 'Instructor', 'Physician', 'Nursing User',
- 'Laboratory user', 'LabTest Approver', 'Healthcare Administrator'],
- 'properties': [
- {'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'collapsible_depends_on', 'value': 'is_stock_item'},
- ],
- 'set_value': [
- ['Stock Settings', None, 'show_barcode_field', 1]
- ],
- 'default_portal_role': 'Customer'
- },
-
- 'Retail': {
- 'desktop_icons': ['POS', 'Item', 'Customer', 'Sales Invoice', 'Purchase Order',
- 'Warranty Claim', 'Accounts', 'Task', 'Buying', 'ToDo'],
- 'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User', 'Instructor',
- 'Physician', 'Nursing User', 'Laboratory user',
- 'LabTest Approver', 'Healthcare Administrator'],
- 'properties': [
- {'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'hidden', 'value': 1},
- {'doctype': 'Customer', 'fieldname': 'credit_limit_section', 'property': 'hidden', 'value': 1},
- ],
- 'set_value': [
- ['Stock Settings', None, 'show_barcode_field', 1]
- ],
- 'default_portal_role': 'Customer'
- },
-
- 'Distribution': {
- 'desktop_icons': ['Item', 'Customer', 'Supplier', 'Lead', 'Sales Order', 'Task',
- 'Sales Invoice', 'CRM', 'Selling', 'Buying', 'Stock', 'Accounts', 'HR', 'ToDo'],
- 'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User', 'Instructor',
- 'Physician', 'Nursing User', 'Laboratory user',
- 'LabTest Approver', 'Healthcare Administrator'],
- 'set_value': [
- ['Stock Settings', None, 'show_barcode_field', 1]
- ],
- 'default_portal_role': 'Customer'
- },
-
- 'Services': {
- 'desktop_icons': ['Project', 'Timesheet', 'Customer', 'Sales Order', 'Sales Invoice',
- 'Lead', 'Opportunity', 'Task', 'Expense Claim', 'Employee', 'HR', 'ToDo'],
- 'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User', 'Instructor',
- 'Physician', 'Nursing User', 'Laboratory user',
- 'LabTest Approver', 'Healthcare Administrator'],
- 'properties': [
- {'doctype': 'Item', 'fieldname': 'is_stock_item', 'property': 'default', 'value': 0},
- ],
- 'set_value': [
- ['Stock Settings', None, 'show_barcode_field', 0]
- ],
- 'default_portal_role': 'Customer'
- },
- 'Education': {
- 'desktop_icons': ['Student', 'Program', 'Course', 'Student Group', 'Instructor',
- 'Fees', 'Task', 'ToDo', 'Schools'],
- 'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Item Manager',
- 'Website Manager', 'HR User', 'HR Manager', 'Purchase User', 'Purchase Manager',
- 'Student', 'Projects User', 'Instructor'],
- 'default_portal_role': 'Student'
- },
- 'Healthcare': {
- 'desktop_icons': ['Patient', 'Patient Appointment', 'Consultation', 'Lab Test', 'Healthcare',
- 'Accounts', 'Buying', 'Stock', 'HR', 'ToDo'],
- 'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Projects User', 'Projects Manager',
- 'Academics User', 'Instructor'],
- 'default_portal_role': 'Patient'
- },
- }
- if not domain in data:
- raise 'Invalid Domain {0}'.format(domain)
- return frappe._dict(data[domain])
-
-def setup_domain(domain):
- '''Setup roles, desktop icons, properties, values, portal sidebar menu based on domain'''
- data = get_domain(domain)
- setup_roles(data)
- setup_desktop_icons(data)
- setup_properties(data)
- set_values(data)
- setup_sidebar_items(data)
- update_module_def_restrict_to_domain()
-
- if data.get('default_portal_role'):
- frappe.db.set_value('Portal Settings', None, 'default_role', data.get('default_portal_role'))
-
- frappe.clear_cache()
-
-def setup_desktop_icons(data):
- '''set desktop icons form `data.desktop_icons`'''
- from frappe.desk.doctype.desktop_icon.desktop_icon import set_desktop_icons
- if data.desktop_icons:
- set_desktop_icons(data.desktop_icons)
-
-def setup_properties(data):
- if data.properties:
- for args in data.properties:
- frappe.make_property_setter(args)
-
-def setup_roles(data):
- '''Add, remove roles from `data.allow_roles` or `data.remove_roles`'''
- def remove_role(role):
- frappe.db.sql('delete from `tabHas Role` where role=%s', role)
- frappe.set_value('Role', role, 'disabled', 1)
-
- if data.remove_roles:
- for role in data.remove_roles:
- remove_role(role)
-
- if data.allow_roles:
- # remove all roles other than allowed roles
- active_domains = frappe.get_active_domains()
- data.allow_roles += ['Administrator', 'Guest', 'System Manager', 'All']
- for role in frappe.get_all('Role', filters = {"restrict_to_domain": ("not in", active_domains)}):
- if not (role.name in data.allow_roles):
- remove_role(role.name)
-
-def set_values(data):
- '''set values based on `data.set_value`'''
- if data.set_value:
- for args in data.set_value:
- doc = frappe.get_doc(args[0], args[1] or args[0])
- doc.set(args[2], args[3])
- doc.save()
-
-def setup_sidebar_items(data):
- '''Enable / disable sidebar items'''
- if data.allow_sidebar_items:
- # disable all
- frappe.db.sql('update `tabPortal Menu Item` set enabled=0')
-
- # enable
- frappe.db.sql('''update `tabPortal Menu Item` set enabled=1
- where route in ({0})'''.format(', '.join(['"{0}"'.format(d) for d in data.allow_sidebar_items])))
-
- if data.remove_sidebar_items:
- # disable all
- frappe.db.sql('update `tabPortal Menu Item` set enabled=1')
-
- # enable
- frappe.db.sql('''update `tabPortal Menu Item` set enabled=0
- where route in ({0})'''.format(', '.join(['"{0}"'.format(d) for d in data.remove_sidebar_items])))
-
-def reset():
- from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
- add_all_roles_to('Administrator')
-
- frappe.db.sql('delete from `tabProperty Setter`')
-
-def update_module_def_restrict_to_domain():
- """ set the restrict to domain for the module def """
-
- module_def_restrict_to_domain_mapper = {
- "Schools": 'Education'
- }
-
- lang = frappe.db.get_single_value("System Settings", "language") or "en"
- for module, domain in module_def_restrict_to_domain_mapper.iteritems():
- if frappe.db.exists("Domain", _(domain, lang)):
- frappe.db.set_value("Module Def", module, "restrict_to_domain", _(domain, lang))
- elif frappe.db.exists("Domain", domain):
- frappe.db.set_value("Module Def", module, "restrict_to_domain", domain)
- else:
- pass
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index a80399d..f7b09d6 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -10,12 +10,10 @@
from frappe import _
from frappe.utils.file_manager import save_file
from .default_website import website_maker
-from .healthcare import setup_healthcare
import install_fixtures
from .sample_data import make_sample_data
from erpnext.accounts.doctype.account.account import RootNotEditable
from frappe.core.doctype.communication.comment import add_info_comment
-from erpnext.setup.setup_wizard.domainify import setup_domain
from erpnext.setup.doctype.company.company import install_country_fixtures
def setup_complete(args=None):
@@ -35,20 +33,14 @@
create_letter_head(args)
set_no_copy_fields_in_variant_settings()
- if args.get('domain').lower() == 'education':
- create_academic_year()
- create_academic_term()
-
- if args.domain.lower() == 'healthcare':
- setup_healthcare()
-
if args.get('setup_website'):
website_maker(args)
create_logo(args)
frappe.local.message_log = []
- setup_domain(args.get('domain'))
+ domain_settings = frappe.get_single('Domain Settings')
+ domain_settings.set_active_domains([args.get('domain')])
frappe.db.commit()
login_as_first_user(args)
@@ -400,27 +392,3 @@
emp.flags.ignore_mandatory = True
emp.insert(ignore_permissions = True)
-# Schools
-def create_academic_term():
- at = ["Semester 1", "Semester 2", "Semester 3"]
- ay = ["2013-14", "2014-15", "2015-16", "2016-17", "2017-18"]
- for y in ay:
- for t in at:
- academic_term = frappe.new_doc("Academic Term")
- academic_term.academic_year = y
- academic_term.term_name = t
- try:
- academic_term.save()
- except frappe.DuplicateEntryError:
- pass
-
-def create_academic_year():
- ac = ["2013-14", "2014-15", "2015-16", "2016-17", "2017-18"]
- for d in ac:
- academic_year = frappe.new_doc("Academic Year")
- academic_year.academic_year_name = d
- try:
- academic_year.save()
- except frappe.DuplicateEntryError:
- pass
-
diff --git a/erpnext/setup/setup_wizard/test_setup_wizard.py b/erpnext/setup/setup_wizard/test_setup_wizard.py
index 57eeeff..97650f2 100644
--- a/erpnext/setup/setup_wizard/test_setup_wizard.py
+++ b/erpnext/setup/setup_wizard/test_setup_wizard.py
@@ -16,44 +16,50 @@
# Language slide
driver.wait_for_ajax(True)
- time.sleep(2)
+ time.sleep(1)
+
driver.set_select("language", "English (United States)")
driver.wait_for_ajax(True)
- driver.wait_till_clickable(".next-btn").click()
+ time.sleep(1)
+ driver.click(".next-btn")
# Region slide
driver.wait_for_ajax(True)
driver.set_select("country", "India")
driver.wait_for_ajax(True)
- driver.wait_till_clickable(".next-btn").click()
+ time.sleep(1)
+ driver.click(".next-btn")
# Profile slide
driver.set_field("full_name", "Great Tester")
driver.set_field("email", "great@example.com")
driver.set_field("password", "test")
- driver.wait_till_clickable(".next-btn").click()
+ driver.wait_for_ajax(True)
+ time.sleep(1)
+ driver.click(".next-btn")
+ time.sleep(1)
- # Brand slide
+ # domain slide
driver.set_select("domain", "Manufacturing")
- time.sleep(5)
- driver.wait_till_clickable(".next-btn").click()
+ time.sleep(1)
+ driver.click(".next-btn")
# Org slide
driver.set_field("company_name", "For Testing")
- driver.wait_till_clickable(".next-btn").click()
+ time.sleep(1)
+ driver.print_console()
+ driver.click(".next-btn")
+
driver.set_field("company_tagline", "Just for GST")
driver.set_field("bank_account", "HDFC")
- driver.wait_till_clickable(".complete-btn").click()
+ time.sleep(3)
+ driver.click(".complete-btn")
# Wait for desktop
driver.wait_for('#page-desktop', timeout=600)
- console = driver.get_console()
- if frappe.flags.tests_verbose:
- for line in console:
- print(line)
- print('-' * 40)
- time.sleep(1)
+ driver.print_console()
+ time.sleep(3)
frappe.db.set_default('in_selenium', None)
frappe.db.set_value("Company", "For Testing", "write_off_account", "Write Off - FT")
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index 49c439b..003a57c 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -111,27 +111,12 @@
def enable_all_roles_and_domains():
""" enable all roles and domain for testing """
- roles = frappe.get_list("Role", filters={"disabled": 1})
- for role in roles:
- _role = frappe.get_doc("Role", role.get("name"))
- _role.disabled = 0
- _role.flags.ignore_mandatory = True
- _role.flags.ignore_permissions = True
- _role.save()
-
# add all roles to users
- if roles:
- user = frappe.get_doc("User", "Administrator")
- user.add_roles(*[role.get("name") for role in roles])
-
- domains = frappe.get_list("Domain")
+ domains = frappe.get_all("Domain")
if not domains:
return
- domain_settings = frappe.get_doc("Domain Settings", "Domain Settings")
- domain_settings.set("active_domains", [])
- for domain in domains:
- row = domain_settings.append("active_domains", {})
- row.domain=domain.get("name")
-
- domain_settings.save()
+ from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
+ frappe.get_single('Domain Settings').set_active_domains(\
+ [d.name for d in domains])
+ add_all_roles_to('Administrator')
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index 390bc27..75899e1 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -39,3 +39,4 @@
frappe.db.sql("update `tabTax Rule` set use_for_shopping_cart = 1")
+test_dependencies = ["Tax Rule"]
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py
index c3f399a..5cf98a1 100644
--- a/erpnext/stock/doctype/item/test_item.py
+++ b/erpnext/stock/doctype/item/test_item.py
@@ -190,7 +190,8 @@
"increment": 0.5
}
],
- "default_warehouse": "_Test Warehouse - _TC"
+ "default_warehouse": "_Test Warehouse - _TC",
+ "has_variants": 1
})
variant = create_variant("_Test Numeric Template Item",
diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py
index 709b8c7..a24957e 100644
--- a/erpnext/stock/doctype/material_request/test_material_request.py
+++ b/erpnext/stock/doctype/material_request/test_material_request.py
@@ -558,5 +558,5 @@
item_code= %s and warehouse= %s """, (mr.items[0].item_code, mr.items[0].warehouse))[0][0]
self.assertEquals(requested_qty, new_requested_qty)
-test_dependencies = ["Currency Exchange"]
+test_dependencies = ["Currency Exchange", "BOM"]
test_records = frappe.get_test_records('Material Request')
diff --git a/erpnext/stock/doctype/material_request/tests/test_material_request.js b/erpnext/stock/doctype/material_request/tests/test_material_request.js
index 1ae41f5..bf26cd1 100644
--- a/erpnext/stock/doctype/material_request/tests/test_material_request.js
+++ b/erpnext/stock/doctype/material_request/tests/test_material_request.js
@@ -1,7 +1,7 @@
QUnit.module('Stock');
QUnit.test("test material request", function(assert) {
- assert.expect(1);
+ assert.expect(5);
let done = assert.async();
frappe.run_serially([
() => {
diff --git a/erpnext/support/report/minutes_to_first_response_for_issues/minutes_to_first_response_for_issues.js b/erpnext/support/report/minutes_to_first_response_for_issues/minutes_to_first_response_for_issues.js
index e84b13c..4cf07fa 100644
--- a/erpnext/support/report/minutes_to_first_response_for_issues/minutes_to_first_response_for_issues.js
+++ b/erpnext/support/report/minutes_to_first_response_for_issues/minutes_to_first_response_for_issues.js
@@ -18,23 +18,13 @@
get_chart_data: function(columns, result) {
return {
data: {
- x: 'Date',
- columns: [
- ['Date'].concat($.map(result, function(d) { return d[0]; })),
- ['Mins to first response'].concat($.map(result, function(d) { return d[1]; }))
- ]
- // rows: [['Date', 'Mins to first response']].concat(result)
+ labels: result.map(d => d[0]),
+ datasets: [{
+ title: 'Mins to first response',
+ values: result.map(d => d[1])
+ }]
},
- axis: {
- x: {
- type: 'timeseries',
- tick: {
- format: frappe.ui.py_date_format
- }
- }
- },
- chart_type: 'line',
-
+ type: 'line',
}
}
}
diff --git a/erpnext/support/report/support_hour_distribution/support_hour_distribution.py b/erpnext/support/report/support_hour_distribution/support_hour_distribution.py
index e96b7b2..905ea6a 100644
--- a/erpnext/support/report/support_hour_distribution/support_hour_distribution.py
+++ b/erpnext/support/report/support_hour_distribution/support_hour_distribution.py
@@ -24,7 +24,7 @@
columns = get_columns()
data, timeslot_wise_count = get_data(filters)
- chart = get_chartdata(timeslot_wise_count)
+ chart = get_chart_data(timeslot_wise_count)
return columns, data, None, chart
def get_data(filters):
@@ -75,23 +75,21 @@
return columns
-def get_chartdata(timeslot_wise_count):
- x_interval = ['x']
- total_count = ['Total']
+def get_chart_data(timeslot_wise_count):
+ total_count = []
timeslots = ['12AM - 3AM', '3AM - 6AM', '6AM - 9AM',
'9AM - 12PM', '12PM - 3PM', '3PM - 6PM', '6PM - 9PM', '9PM - 12AM']
- x_interval.extend(timeslots)
- columns = [x_interval]
+ datasets = []
for data in timeslots:
total_count.append(timeslot_wise_count.get(data, 0))
- columns.append(total_count)
+ datasets.append({'values': total_count})
chart = {
"data": {
- 'x': 'x',
- 'columns': columns
+ 'labels': timeslots,
+ 'datasets': datasets
}
}
- chart["chart_type"] = "line"
+ chart["type"] = "line"
return chart
diff --git a/erpnext/tests/ui/make_fixtures.js b/erpnext/tests/ui/make_fixtures.js
index 78ec8f1..8c9e508 100644
--- a/erpnext/tests/ui/make_fixtures.js
+++ b/erpnext/tests/ui/make_fixtures.js
@@ -250,7 +250,9 @@
let done = assert.async();
let tasks = [];
Object.keys(frappe.test_data).forEach(function(doctype) {
- tasks.push(function() { return frappe.tests.setup_doctype(doctype); });
+ tasks.push(function() {
+ return frappe.tests.setup_doctype(doctype, frappe.test_data[doctype]);
+ });
});
frappe.run_serially(tasks).then(() => done());
});
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
index f35f6d7..4b3c2c5 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -129,4 +129,8 @@
erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_repack.js
erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_serialize_item.js
erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
\ No newline at end of file
+erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
+erpnext/restaurant/doctype/restaurant/test_restaurant.js
+erpnext/restaurant/doctype/test_restaurant_table/test_restaurant_table.js
+erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
+erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js