diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 32dde37df02..e822fda512a 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from erpnext.hooks import regional_overrides -__version__ = '9.1.3' +__version__ = '9.2.0' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/fr_plan_comptable_general.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/fr_plan_comptable_general.json index f6015f37442..018d368de44 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/fr_plan_comptable_general.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/fr_plan_comptable_general.json @@ -851,7 +851,7 @@ "4457-Taxes sur le chiffre d'affaires collect\u00e9es par l'entreprise": { "44571-TVA collect\u00e9e": { "account_type": "Tax", - "tax_rate": 20.0 + "is_group": 1 }, "44578-Taxes assimil\u00e9es \u00e0 la TVA": {} }, diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json index 42cd44aeabe..002562f5b99 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 7c4eeae93a4..e3afc359b65 100644 --- a/erpnext/accounts/doctype/asset/asset.js +++ b/erpnext/accounts/doctype/asset/asset.js @@ -55,13 +55,13 @@ frappe.ui.form.on('Asset', { }); } - 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 @@ frappe.ui.form.on('Asset', { 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 21596f11327..831373a9c99 100644 --- a/erpnext/accounts/doctype/asset/test_asset.py +++ b/erpnext/accounts/doctype/asset/test_asset.py @@ -13,6 +13,7 @@ class TestAsset(unittest.TestCase): 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/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index face5ede256..790003c3010 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -54,7 +54,7 @@ class JournalEntry(AccountsController): def update_advance_paid(self): advance_paid = frappe._dict() for d in self.get("accounts"): - if d.is_advance: + if d.is_advance == "Yes": if d.reference_type in ("Sales Order", "Purchase Order"): advance_paid.setdefault(d.reference_type, []).append(d.reference_name) @@ -76,7 +76,7 @@ class JournalEntry(AccountsController): def unlink_advance_entry_reference(self): for d in self.get("accounts"): - if d.is_advance and d.reference_type in ("Sales Invoice", "Purchase Invoice"): + if d.is_advance == "Yes" and d.reference_type in ("Sales Invoice", "Purchase Invoice"): doc = frappe.get_doc(d.reference_type, d.reference_name) doc.delink_advance_entries(self.name) d.reference_type = '' diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 04db9e28ae6..17ac1f70567 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -405,11 +405,7 @@ frappe.ui.form.on('Payment Entry', { } // Make read only if Accounts Settings doesn't allow stale rates - frappe.model.get_value("Accounts Settings", null, "allow_stale", - function(d){ - frm.set_df_property("source_exchange_rate", "read_only", cint(d.allow_stale) ? 0 : 1); - } - ); + frm.set_df_property("source_exchange_rate", "read_only", erpnext.stale_rate_allowed()); }, target_exchange_rate: function(frm) { @@ -430,11 +426,7 @@ frappe.ui.form.on('Payment Entry', { frm.set_paid_amount_based_on_received_amount = false; // Make read only if Accounts Settings doesn't allow stale rates - frappe.model.get_value("Accounts Settings", null, "allow_stale", - function(d){ - frm.set_df_property("target_exchange_rate", "read_only", cint(d.allow_stale) ? 0 : 1); - } - ); + frm.set_df_property("target_exchange_rate", "read_only", erpnext.stale_rate_allowed()); }, paid_amount: function(frm) { @@ -660,8 +652,15 @@ frappe.ui.form.on('Payment Entry', { var party_amount = frm.doc.payment_type=="Receive" ? frm.doc.paid_amount : frm.doc.received_amount; + var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [], + function(d) { return flt(d.amount) })); + if(frm.doc.total_allocated_amount < party_amount) { - unallocated_amount = party_amount - frm.doc.total_allocated_amount; + if(frm.doc.payment_type == "Receive") { + unallocated_amount = party_amount - (frm.doc.total_allocated_amount - total_deductions); + } else { + unallocated_amount = party_amount - (frm.doc.total_allocated_amount + total_deductions); + } } } frm.set_value("unallocated_amount", unallocated_amount); @@ -680,9 +679,6 @@ frappe.ui.form.on('Payment Entry', { difference_amount = flt(frm.doc.base_paid_amount) - flt(frm.doc.base_received_amount); } - var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [], - function(d) { return flt(d.amount) })); - frm.set_value("difference_amount", difference_amount - total_deductions); frm.events.hide_unhide_fields(frm); diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 9d24261038b..56bdfbaf4b6 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -285,8 +285,13 @@ class PaymentEntry(AccountsController): if self.party: party_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount + total_deductions = sum([flt(d.amount) for d in self.get("deductions")]) + if self.total_allocated_amount < party_amount: - self.unallocated_amount = party_amount - self.total_allocated_amount + if self.payment_type == "Receive": + self.unallocated_amount = party_amount - (self.total_allocated_amount - total_deductions) + else: + self.unallocated_amount = party_amount - (self.total_allocated_amount + total_deductions) def set_difference_amount(self): base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate) diff --git a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json index da17bb3fc85..03341da6586 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 57f9f832d03..83045eae4e3 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -348,6 +348,8 @@ def apply_internal_priority(pricing_rules, field_set, args): 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 @@ def set_transaction_type(args): 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/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index e3c5fb49424..3d70b3b0b98 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -3440,139 +3440,13 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "subscription", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Subscription", - "length": 0, - "no_copy": 1, - "options": "Subscription", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": "is_recurring", - "columns": 0, - "depends_on": "eval:doc.docstatus<2 && !doc.__islocal", - "fieldname": "recurring_invoice", - "fieldtype": "Section Break", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Recurring Invoice", - "length": 0, - "no_copy": 0, - "options": "fa fa-time", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 1, "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.docstatus<2", - "description": "", - "fieldname": "is_recurring", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Recurring", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring==1", - "description": "Select the period when the invoice will be generated automatically", - "fieldname": "recurring_type", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Recurring Type", - "length": 0, - "no_copy": 1, - "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring==1", + "depends_on": "", "description": "Start date of current invoice's period", "fieldname": "from_date", "fieldtype": "Date", @@ -3603,7 +3477,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.is_recurring==1", + "depends_on": "", "description": "End date of current invoice's period", "fieldname": "to_date", "fieldtype": "Date", @@ -3628,138 +3502,13 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "fieldname": "submit_on_creation", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Submit on creation", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "notify_by_email", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Notify by email", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring==1", - "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc", - "fieldname": "repeat_on_day_of_month", - "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Repeat on Day of Month", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring==1", - "description": "The date on which recurring invoice will be stop", - "fieldname": "end_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "End Date", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "column_break_82", + "fieldname": "column_break_114", "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, @@ -3771,101 +3520,8 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, - "width": "50%" - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring==1", - "description": "The date on which next invoice will be generated. It is generated on submit.", - "fieldname": "next_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Next Date", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring==1", - "description": "The unique id for tracking all recurring invoices. It is generated on submit.", - "fieldname": "recurring_id", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Recurring Id", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring==1", - "description": "Enter Email Address separated by commas, invoice will be mailed automatically on particular date", - "fieldname": "notification_email_address", - "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Notification Email Address", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -3881,8 +3537,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.is_recurring==1", - "fieldname": "recurring_print_format", + "fieldname": "subscription", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, @@ -3891,15 +3546,15 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Recurring Print Format", + "label": "Subscription", "length": 0, - "no_copy": 0, - "options": "Print Format", + "no_copy": 1, + "options": "Subscription", "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, - "read_only": 0, + "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, @@ -3920,7 +3575,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-09-19 11:22:47.074420", + "modified": "2017-10-24 12:51:51.199594", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index ccf8a840218..6856f62d0c6 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -88,7 +88,7 @@ def update_pos_profile_data(doc, pos_profile, company_data): doc.naming_series = pos_profile.get('naming_series') or 'SINV-' doc.letter_head = pos_profile.get('letter_head') or company_data.default_letter_head doc.ignore_pricing_rule = pos_profile.get('ignore_pricing_rule') or 0 - doc.apply_discount_on = pos_profile.get('apply_discount_on') or '' + doc.apply_discount_on = pos_profile.get('apply_discount_on') or 'Grand Total' doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group') doc.territory = pos_profile.get('territory') or get_root('Territory') doc.terms = frappe.db.get_value('Terms and Conditions', pos_profile.get('tc_name'), 'terms') or doc.terms or '' @@ -486,17 +486,21 @@ def submit_invoice(si_doc, name, doc, name_list): 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/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 9aa0e6b6a2b..ecd7cf90690 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -4273,414 +4273,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "subscription", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Subscription", - "length": 0, - "no_copy": 1, - "options": "Subscription", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": "is_recurring", - "columns": 0, - "depends_on": "eval:doc.docstatus<2 && !doc.__islocal", - "fieldname": "recurring_invoice", - "fieldtype": "Section Break", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Recurring Invoice", - "length": 0, - "no_copy": 0, - "options": "fa fa-time", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break11", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, - "width": "50%" - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.docstatus<2", - "description": "", - "fieldname": "is_recurring", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Recurring", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "is_recurring", - "description": "", - "fieldname": "recurring_id", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Reference Document", - "length": 0, - "no_copy": 1, - "options": "Sales Invoice", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "recurring_type", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Frequency", - "length": 0, - "no_copy": 1, - "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "repeat_on_day_of_month", - "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Repeat on Day of Month", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "end_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "End Date", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "fieldname": "submit_on_creation", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Submit on creation", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "notify_by_email", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Notify by email", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name", - "description": "", - "fieldname": "notification_email_address", - "fieldtype": "Code", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Notification Email Address", - "length": 0, - "no_copy": 1, - "options": "Email", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name", - "fieldname": "recurring_print_format", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Recurring Print Format", - "length": 0, - "no_copy": 0, - "options": "Print Format", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break12", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "This Document", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0, - "width": "50%" - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "is_recurring", + "depends_on": "", "description": "", "fieldname": "from_date", "fieldtype": "Date", @@ -4711,7 +4304,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "is_recurring", + "depends_on": "", "description": "", "fieldname": "to_date", "fieldtype": "Date", @@ -4742,10 +4335,8 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "is_recurring", - "description": "", - "fieldname": "next_date", - "fieldtype": "Date", + "fieldname": "column_break_140", + "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -4753,11 +4344,11 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Next Date", "length": 0, - "no_copy": 1, + "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -4767,6 +4358,37 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription", + "length": 0, + "no_copy": 1, + "options": "Subscription", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -4811,7 +4433,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-09-19 11:23:08.675028", + "modified": "2017-10-24 12:46:48.331723", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 6ab614863b8..1c4fe3d0846 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -70,6 +70,7 @@ class SalesInvoice(SellingController): self.clear_unallocated_advances("Sales Invoice Advance", "advances") self.add_remarks() self.validate_write_off_account() + self.validate_duplicate_offline_pos_entry() self.validate_account_for_change_amount() self.validate_fixed_asset() self.set_income_account_for_fixed_assets() @@ -462,6 +463,12 @@ class SalesInvoice(SellingController): if flt(self.write_off_amount) and not self.write_off_account: msgprint(_("Please enter Write Off Account"), raise_exception=1) + def validate_duplicate_offline_pos_entry(self): + if self.is_pos and self.offline_pos_name \ + and frappe.db.get_value('Sales Invoice', + {'offline_pos_name': self.offline_pos_name, 'docstatus': 1}): + frappe.throw(_("Duplicate offline pos sales invoice {0}").format(self.offline_pos_name)) + def validate_account_for_change_amount(self): if flt(self.change_amount) and not self.account_for_change_amount: msgprint(_("Please enter Account for Change Amount"), raise_exception=1) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 900a6e9d956..264f027486f 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -3,8 +3,8 @@ from __future__ import unicode_literals import frappe -import unittest, copy -from frappe.utils import nowdate, add_days, flt +import unittest, copy, time +from frappe.utils import nowdate, add_days, flt, 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 @@ -665,6 +665,47 @@ class TestSalesInvoice(unittest.TestCase): 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.js b/erpnext/accounts/doctype/subscription/subscription.js index 15927d59618..8db5be87721 100644 --- a/erpnext/accounts/doctype/subscription/subscription.js +++ b/erpnext/accounts/doctype/subscription/subscription.js @@ -12,7 +12,8 @@ frappe.ui.form.on('Subscription', { frm.fields_dict['reference_document'].get_query = function() { return { filters: { - "docstatus": 1 + "docstatus": 1, + "subscription": '' } }; }; diff --git a/erpnext/accounts/doctype/subscription/subscription.json b/erpnext/accounts/doctype/subscription/subscription.json index dfdcbecb43b..7ff2e4b632f 100644 --- a/erpnext/accounts/doctype/subscription/subscription.json +++ b/erpnext/accounts/doctype/subscription/subscription.json @@ -315,22 +315,23 @@ }, { "allow_bulk_edit": 0, - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "from_date", - "fieldtype": "Date", + "fieldname": "frequency", + "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, - "label": "From Date", + "label": "Frequency", "length": 0, "no_copy": 0, + "options": "\nDaily\nWeekly\nMonthly\nQuarterly\nHalf-yearly\nYearly", "permlevel": 0, "precision": "", "print_hide": 0, @@ -338,37 +339,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "to_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "To Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -402,37 +373,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "frequency", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Frequency", - "length": 0, - "no_copy": 0, - "options": "\nDaily\nWeekly\nMonthly\nQuarterly\nHalf-yearly\nYearly", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 1, @@ -844,7 +784,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-10-03 17:20:26.919630", + "modified": "2017-10-23 18:28:08.966403", "modified_by": "Administrator", "module": "Accounts", "name": "Subscription", diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py index b40169a36c1..fb01efe13b6 100644 --- a/erpnext/accounts/doctype/subscription/subscription.py +++ b/erpnext/accounts/doctype/subscription/subscription.py @@ -17,6 +17,7 @@ month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} class Subscription(Document): def validate(self): self.update_status() + self.validate_reference_doctype() self.validate_dates() self.validate_next_schedule_date() self.validate_email_id() @@ -25,25 +26,28 @@ class Subscription(Document): validate_template(self.message or "") def before_submit(self): - self.set_next_schedule_date() + if not self.next_schedule_date: + self.next_schedule_date = get_next_schedule_date(self.start_date, + self.frequency, self.repeat_on_day) def on_submit(self): - # self.update_subscription_id() - self.update_subscription_data() + self.update_subscription_id() def on_update_after_submit(self): - self.update_subscription_data() self.validate_dates() self.set_next_schedule_date() def before_cancel(self): self.unlink_subscription_id() + self.next_schedule_date = None def unlink_subscription_id(self): - doc = frappe.get_doc(self.reference_doctype, self.reference_document) - if doc.meta.get_field('subscription'): - doc.subscription = None - doc.db_update() + frappe.db.sql("update `tab{0}` set subscription = null where subscription=%s" + .format(self.reference_doctype), self.name) + + def validate_reference_doctype(self): + if not frappe.get_meta(self.reference_doctype).has_field('subscription'): + frappe.throw(_("Add custom field Subscription in the doctype {0}").format(self.reference_doctype)) def validate_dates(self): if self.end_date and getdate(self.start_date) > getdate(self.end_date): @@ -76,30 +80,11 @@ class Subscription(Document): frappe.throw(_("'Recipients' not specified")) def set_next_schedule_date(self): - self.next_schedule_date = get_next_schedule_date(self.start_date, - self.frequency, self.repeat_on_day) - - def update_subscription_data(self): - update_doc = False - doc = frappe.get_doc(self.reference_doctype, self.reference_document) - if frappe.get_meta(self.reference_doctype).get_field("from_date"): - doc.from_date = self.from_date - doc.to_date = self.to_date - update_doc = True - - if not doc.subscription: - doc.subscription = self.name - update_doc = True - - if update_doc: - doc.db_update() + if self.repeat_on_day: + self.next_schedule_date = get_next_date(self.next_schedule_date, 0, self.repeat_on_day) def update_subscription_id(self): - doc = frappe.get_doc(self.reference_doctype, self.reference_document) - if not doc.meta.get_field('subscription'): - frappe.throw(_("Add custom field Subscription Id in the doctype {0}").format(self.reference_doctype)) - - doc.db_set('subscription', self.name) + frappe.db.set_value(self.reference_doctype, self.reference_document, "subscription", self.name) def update_status(self, status=None): self.status = { @@ -142,9 +127,6 @@ def get_subscription_entries(date): def create_documents(data, schedule_date): try: doc = make_new_document(data, schedule_date) - if getattr(doc, "from_date", None): - update_subscription_period(data, doc) - if data.notify_by_email and data.recipients: print_format = data.print_format or "Standard" send_notification(doc, data, print_format=print_format) @@ -159,13 +141,6 @@ def create_documents(data, schedule_date): if data.reference_document and not frappe.flags.in_test: notify_error_to_user(data) -def update_subscription_period(data, doc): - from_date = doc.from_date - to_date = doc.to_date - - frappe.db.set_value('Subscription', data.name, 'from_date', from_date) - frappe.db.set_value('Subscription', data.name, 'to_date', to_date) - def disable_subscription(data): subscription = frappe.get_doc('Subscription', data.name) subscription.db_set('disabled', 1) @@ -205,24 +180,49 @@ def update_doc(new_document, reference_doc, args, schedule_date): if new_document.meta.get_field('subscription'): new_document.set('subscription', args.name) - if args.from_date and args.to_date: - from_date = get_next_date(args.from_date, mcount) + 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)) - if (cstr(get_first_day(args.from_date)) == cstr(args.from_date)) and \ - (cstr(get_last_day(args.to_date)) == cstr(args.to_date)): - to_date = get_last_day(get_next_date(args.to_date, mcount)) - else: - to_date = get_next_date(args.to_date, mcount) + # 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 new_document.meta.get_field('from_date'): - new_document.set('from_date', from_date) - new_document.set('to_date', to_date) - - new_document.run_method("on_recurring", reference_doc=reference_doc, subscription_doc=args) for data in new_document.meta.fields: if data.fieldtype == 'Date' and data.reqd: new_document.set(data.fieldname, schedule_date) + set_subscription_period(args, mcount, new_document) + + new_document.run_method("on_recurring", reference_doc=reference_doc, subscription_doc=args) + +def set_subscription_period(args, mcount, new_document): + if new_document.meta.get_field('from_date') and new_document.meta.get_field('to_date'): + last_ref_doc = frappe.db.sql(""" + select name, from_date, to_date + from `tab{0}` + where subscription=%s and docstatus < 2 + order by creation desc + limit 1 + """.format(args.reference_doctype), args.name, as_dict=1) + + if not last_ref_doc: + return + + from_date = get_next_date(last_ref_doc[0].from_date, mcount) + + if (cstr(get_first_day(last_ref_doc[0].from_date)) == cstr(last_ref_doc[0].from_date)) and \ + (cstr(get_last_day(last_ref_doc[0].to_date)) == cstr(last_ref_doc[0].to_date)): + to_date = get_last_day(get_next_date(last_ref_doc[0].to_date, mcount)) + else: + to_date = get_next_date(last_ref_doc[0].to_date, mcount) + + new_document.set('from_date', from_date) + new_document.set('to_date', to_date) + def get_next_date(dt, mcount, day=None): dt = getdate(dt) dt += relativedelta(months=mcount, day=day) @@ -276,8 +276,11 @@ def assign_task_to_owner(name, msg, users): @frappe.whitelist() def make_subscription(doctype, docname): doc = frappe.new_doc('Subscription') + + reference_doc = frappe.get_doc(doctype, docname) doc.reference_doctype = doctype doc.reference_document = docname + doc.start_date = reference_doc.get('posting_date') or reference_doc.get('transaction_date') return doc @frappe.whitelist() diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py index b74163c92e9..4ccf483c1a4 100644 --- a/erpnext/accounts/doctype/subscription/test_subscription.py +++ b/erpnext/accounts/doctype/subscription/test_subscription.py @@ -30,7 +30,7 @@ class TestSubscription(unittest.TestCase): 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 5ad7970a6e3..ee5b3c9d6a3 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 @@ test_records = frappe.get_test_records('Tax Rule') class TestTaxRule(unittest.TestCase): def setUp(self): - frappe.db.sql("delete from `tabTax Rule` where use_for_shopping_cart <> 1") + frappe.db.sql("delete from `tabTax Rule`") + + def tearDown(self): + frappe.db.sql("delete from `tabTax Rule`") def test_conflict(self): tax_rule1 = make_tax_rule(customer= "_Test Customer", diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 57a8a186b96..c442062ab6f 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -84,6 +84,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.get_data_from_server(function () { me.make_control(); me.create_new(); + me.make(); }); }, @@ -382,7 +383,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ }, setup: function () { - this.make(); this.set_primary_action(); this.party_field.$input.attr('disabled', false); if(this.selected_row) { @@ -1341,6 +1341,12 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.wrapper.find('input.discount-percentage').on("change", function () { me.frm.doc.additional_discount_percentage = flt($(this).val(), precision("additional_discount_percentage")); + + if(me.frm.doc.additional_discount_percentage && me.frm.doc.discount_amount) { + // Reset discount amount + me.frm.doc.discount_amount = 0; + } + var total = me.frm.doc.grand_total if (me.frm.doc.apply_discount_on == 'Net Total') { @@ -1348,15 +1354,15 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ } me.frm.doc.discount_amount = flt(total * flt(me.frm.doc.additional_discount_percentage) / 100, precision("discount_amount")); - me.wrapper.find('input.discount-amount').val(me.frm.doc.discount_amount) me.refresh(); + me.wrapper.find('input.discount-amount').val(me.frm.doc.discount_amount) }); this.wrapper.find('input.discount-amount').on("change", function () { me.frm.doc.discount_amount = flt($(this).val(), precision("discount_amount")); me.frm.doc.additional_discount_percentage = 0.0; - me.wrapper.find('input.discount-percentage').val(0); me.refresh(); + me.wrapper.find('input.discount-percentage').val(0); }); }, @@ -1517,6 +1523,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ var me = this; this.wrapper.find(".net-total").text(format_currency(me.frm.doc.total, me.frm.doc.currency)); this.wrapper.find(".grand-total").text(format_currency(me.frm.doc.grand_total, me.frm.doc.currency)); + this.wrapper.find('input.discount-percentage').val(this.frm.doc.additional_discount_percentage); + this.wrapper.find('input.discount-amount').val(this.frm.doc.discount_amount); }, set_primary_action: function () { diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index bcec0a29c93..ce049f5d872 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -76,7 +76,7 @@ def set_address_details(out, party, party_type, doctype=None, company=None): # shipping address if party_type in ["Customer", "Lead"]: - out.shipping_address_name = get_default_address(party_type, party.name, 'is_shipping_address') + out.shipping_address_name = get_party_shipping_address(party_type, party.name) out.shipping_address = get_address_display(out["shipping_address_name"]) if doctype: out.update(get_fetch_values(doctype, 'shipping_address_name', out.shipping_address_name)) @@ -418,3 +418,32 @@ def get_dashboard_info(party_type, party): info["total_unpaid"] = -1 * info["total_unpaid"] return info + + +def get_party_shipping_address(doctype, name): + """ + Returns an Address name (best guess) for the given doctype and name for which `address_type == 'Shipping'` is true. + and/or `is_shipping_address = 1`. + + It returns an empty string if there is no matching record. + + :param doctype: Party Doctype + :param name: Party name + :return: String + """ + out = frappe.db.sql( + 'SELECT dl.parent ' + 'from `tabDynamic Link` dl join `tabAddress` ta on dl.parent=ta.name ' + 'where ' + 'dl.link_doctype=%s ' + 'and dl.link_name=%s ' + 'and dl.parenttype="Address" ' + 'and ' + '(ta.address_type="Shipping" or ta.is_shipping_address=1) ' + 'order by ta.is_shipping_address desc, ta.address_type desc limit 1', + (doctype, name) + ) + if out: + return out[0][0] + else: + return '' diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 9906893254f..56db3928009 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -44,7 +44,7 @@ class ReceivablePayableReport(object): }) columns += [_("Age (Days)") + ":Int:80"] - + self.ageing_col_idx_start = len(columns) if not "range1" in self.filters: @@ -53,7 +53,7 @@ class ReceivablePayableReport(object): 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 @@ class ReceivablePayableReport(object): }) 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 @@ class ReceivablePayableReport(object): 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] @@ -179,15 +179,15 @@ class ReceivablePayableReport(object): # 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: amount = flt(e.get(reverse_dr_or_cr)) - flt(e.get(dr_or_cr)) @@ -195,11 +195,11 @@ class ReceivablePayableReport(object): 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 @@ class ReceivablePayableReport(object): 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 @@ class ReceivablePayableReport(object): 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))) @@ -250,8 +250,8 @@ class ReceivablePayableReport(object): else: select_fields = "sum(debit) as debit, sum(credit) as credit" - self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party, - voucher_type, voucher_no, against_voucher_type, against_voucher, + self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party, + voucher_type, voucher_no, against_voucher_type, against_voucher, account_currency, remarks, {0} from `tabGL Entry` where docstatus < 2 and party_type=%s and (party is not null and party != '') {1} @@ -277,13 +277,13 @@ class ReceivablePayableReport(object): 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 @@ class ReceivablePayableReport(object): 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 2db4ef8a261..18b07ea5829 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.py +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py @@ -8,18 +8,18 @@ from frappe.utils import flt, cint 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 @@ def execute(filters=None): 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 @@ def get_provisional_profit_loss(asset, liability, equity, period_list, company): 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 @@ def get_provisional_profit_loss(asset, liability, equity, period_list, company): "warn_if_negative": True, "currency": currency }) - + return provisional_profit_loss, total_row def check_opening_balance(asset, liability, equity): @@ -111,17 +111,17 @@ def check_opening_balance(asset, liability, equity): 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 @@ def get_chart_data(filters, columns, asset, liability, equity): 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 07f6979c40c..78e3faab4ea 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -107,6 +107,8 @@ class GrossProfitGenerator(object): 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 @@ class GrossProfitGenerator(object): 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 6729d672c07..89ee63aa649 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 frappe.utils import flt 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_net_profit_loss(income, expense, period_list, company): 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 @@ def get_chart_data(filters, columns, income, expense, net_profit_loss): 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/docs/user/manual/en/subscription/__init__.py b/erpnext/accounts/test/__init__.py similarity index 100% rename from erpnext/docs/user/manual/en/subscription/__init__.py rename to erpnext/accounts/test/__init__.py diff --git a/erpnext/accounts/test/test_utils.py b/erpnext/accounts/test/test_utils.py new file mode 100644 index 00000000000..0fca470fe5e --- /dev/null +++ b/erpnext/accounts/test/test_utils.py @@ -0,0 +1,84 @@ +import unittest +from erpnext.accounts.party import get_party_shipping_address +from frappe.test_runner import make_test_objects + + +class TestUtils(unittest.TestCase): + @classmethod + def setUpClass(cls): + super(TestUtils, cls).setUpClass() + make_test_objects('Address', ADDRESS_RECORDS) + + def test_get_party_shipping_address(self): + address = get_party_shipping_address('Customer', '_Test Customer 1') + self.assertEqual(address, '_Test Billing Address 2 Title-Billing') + + def test_get_party_shipping_address2(self): + address = get_party_shipping_address('Customer', '_Test Customer 2') + self.assertEqual(address, '_Test Shipping Address 2 Title-Shipping') + + +ADDRESS_RECORDS = [ + { + "doctype": "Address", + "address_type": "Billing", + "address_line1": "Address line 1", + "address_title": "_Test Billing Address Title", + "city": "Lagos", + "country": "Nigeria", + "links": [ + { + "link_doctype": "Customer", + "link_name": "_Test Customer 2", + "doctype": "Dynamic Link" + } + ] + }, + { + "doctype": "Address", + "address_type": "Shipping", + "address_line1": "Address line 2", + "address_title": "_Test Shipping Address 1 Title", + "city": "Lagos", + "country": "Nigeria", + "links": [ + { + "link_doctype": "Customer", + "link_name": "_Test Customer 2", + "doctype": "Dynamic Link" + } + ] + }, + { + "doctype": "Address", + "address_type": "Shipping", + "address_line1": "Address line 3", + "address_title": "_Test Shipping Address 2 Title", + "city": "Lagos", + "country": "Nigeria", + "is_shipping_address": "1", + "links": [ + { + "link_doctype": "Customer", + "link_name": "_Test Customer 2", + "doctype": "Dynamic Link" + } + ] + }, + { + "doctype": "Address", + "address_type": "Billing", + "address_line1": "Address line 4", + "address_title": "_Test Billing Address 2 Title", + "city": "Lagos", + "country": "Nigeria", + "is_shipping_address": "1", + "links": [ + { + "link_doctype": "Customer", + "link_name": "_Test Customer 1", + "doctype": "Dynamic Link" + } + ] + } +] diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 28b8b475c2c..534af8bfc50 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -2948,418 +2948,13 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "subscription", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Subscription", - "length": 0, - "no_copy": 1, - "options": "Subscription", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": "is_recurring", - "columns": 0, - "depends_on": "eval:doc.docstatus<2 && !doc.__islocal", - "fieldname": "recurring_order", - "fieldtype": "Section Break", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Recurring Order", - "length": 0, - "no_copy": 0, - "options": "fa fa-time", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 1, "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.docstatus<2", - "description": "", - "fieldname": "is_recurring", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Recurring", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "is_recurring", - "description": "", - "fieldname": "recurring_id", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Reference Document", - "length": 0, - "no_copy": 1, - "options": "Purchase Order", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "recurring_type", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Frequency", - "length": 0, - "no_copy": 1, - "options": "Monthly\nQuarterly\nHalf-yearly\nYearly", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "repeat_on_day_of_month", - "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Repeat on Day of Month", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "end_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "End Date", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "fieldname": "submit_on_creation", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Submit on creation", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", - "description": "", - "fieldname": "notify_by_email", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Notify by email", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name", - "description": "", - "fieldname": "notification_email_address", - "fieldtype": "Code", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Notification Email Address", - "length": 0, - "no_copy": 1, - "options": "Email", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name", - "fieldname": "recurring_print_format", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Recurring Print Format", - "length": 0, - "no_copy": 0, - "options": "Print Format", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break83", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "This Document", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "is_recurring", + "depends_on": "", "description": "", "fieldname": "from_date", "fieldtype": "Date", @@ -3390,7 +2985,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "is_recurring", + "depends_on": "", "description": "", "fieldname": "to_date", "fieldtype": "Date", @@ -3421,10 +3016,8 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "is_recurring", - "description": "", - "fieldname": "next_date", - "fieldtype": "Date", + "fieldname": "column_break_97", + "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -3432,11 +3025,11 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Next Date", "length": 0, - "no_copy": 1, + "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -3445,6 +3038,37 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription", + "length": 0, + "no_copy": 1, + "options": "Subscription", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 } ], "has_web_view": 0, @@ -3458,7 +3082,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-10-05 14:19:04.102534", + "modified": "2017-10-24 12:52:11.272306", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js index 6605a651705..5d196874c98 100644 --- a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js @@ -1,7 +1,7 @@ QUnit.module('Buying'); QUnit.test("test: purchase order", function(assert) { - assert.expect(11); + assert.expect(16); let done = assert.async(); frappe.run_serially([ @@ -40,7 +40,6 @@ QUnit.test("test: purchase order", function(assert) { // Get supplier details assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct"); assert.ok(cur_frm.doc.schedule_date == frappe.datetime.add_days(frappe.datetime.now_date(), 1), "Schedule Date correct"); - assert.ok($('div.control-value.like-disabled-input.for-description').text().includes('Contact 3'), "Contact display correct"); assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Contact email correct"); // Get item details assert.ok(cur_frm.doc.items[0].item_name == 'Test Product 4', "Item name correct"); @@ -53,7 +52,7 @@ QUnit.test("test: purchase order", function(assert) { assert.ok(cur_frm.doc.items[1].qty == 2, "Quantity correct"); assert.ok(cur_frm.doc.items[1].schedule_date == cur_frm.doc.schedule_date, "Schedule Date correct"); // Calculate total - assert.ok(cur_frm.doc.total == 500, "Total correct"); + assert.ok(cur_frm.doc.total == 700, "Total correct"); // Get terms assert.ok(cur_frm.doc.terms == 'This is a term.', "Terms correct"); }, @@ -70,7 +69,7 @@ QUnit.test("test: purchase order", function(assert) { () => frappe.tests.click_button('Submit'), () => frappe.tests.click_button('Yes'), - () => frappe.timeout(0.3), + () => frappe.timeout(1), () => { assert.ok(cur_frm.doc.status == 'To Receive and Bill', "Submitted successfully"); diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json index 44068ce81d0..50d6abdd8fd 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", @@ -903,26 +903,6 @@ "submit": 0, "write": 0 }, - { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Supplier", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 - }, { "amend": 0, "apply_user_permissions": 0, diff --git a/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js index a4d68aa946d..1fcfe75bb03 100644 --- a/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js +++ b/erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js @@ -27,6 +27,7 @@ QUnit.test("test: request_for_quotation", function(assert) { {tc_name: 'Test Term 1'} ]); }, + () => frappe.timeout(3), () => { assert.ok(cur_frm.doc.transaction_date == date, "Date correct"); assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct"); @@ -38,7 +39,7 @@ QUnit.test("test: request_for_quotation", function(assert) { assert.ok(cur_frm.doc.message_for_supplier == 'Please supply the specified items at the best possible rates', "Reply correct"); assert.ok(cur_frm.doc.tc_name == 'Test Term 1', "Term name correct"); }, - () => frappe.timeout(0.3), + () => frappe.timeout(3), () => cur_frm.print_doc(), () => frappe.timeout(1), () => { @@ -65,7 +66,7 @@ QUnit.test("test: request_for_quotation", function(assert) { assert.ok(cur_frm.doc.docstatus == 1, "Quotation request submitted"); }, () => frappe.click_button('Send Supplier Emails'), - () => frappe.timeout(4), + () => frappe.timeout(6), () => { assert.ok($('div.modal.fade.in > div.modal-dialog > div > div.modal-body.ui-front > div.msgprint').text().includes("Email sent to supplier Test Supplier"), "Send emails working"); }, diff --git a/erpnext/buying/doctype/supplier/test_supplier.js b/erpnext/buying/doctype/supplier/test_supplier.js index 99a5bc616dc..05ea04422dd 100644 --- a/erpnext/buying/doctype/supplier/test_supplier.js +++ b/erpnext/buying/doctype/supplier/test_supplier.js @@ -56,7 +56,8 @@ QUnit.test("test: supplier", function(assert) { () => frappe.click_button('New Contact'), () => { return frappe.tests.set_form_values(cur_frm, [ - {first_name: "Contact 3"} + {first_name: "Contact 3"}, + {email_id: "test@supplier.com"} ]); }, () => cur_frm.save(), diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js deleted file mode 100644 index 7097a6dcb2b..00000000000 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js +++ /dev/null @@ -1,23 +0,0 @@ -/* eslint-disable */ -// rename this file from _test_[name] to test_[name] to activate -// and remove above this line - -QUnit.test("test: Supplier Quotation", function (assert) { - let done = assert.async(); - - // number of asserts - assert.expect(1); - - frappe.run_serially('Supplier Quotation', [ - // insert a new Supplier Quotation - () => frappe.tests.make([ - // values to be set - {key: 'value'} - ]), - () => { - assert.equal(cur_frm.doc.key, 'value'); - }, - () => done() - ]); - -}); diff --git a/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js index 76be06c6fbb..2d2b29cb916 100644 --- a/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js +++ b/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js @@ -27,12 +27,13 @@ QUnit.test("test: supplier quotation", function(assert) { {terms: 'This is a term'} ]); }, + () => frappe.timeout(3), () => { // Get Supplier details assert.ok(cur_frm.doc.supplier == 'Test Supplier', "Supplier correct"); assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct"); // Get Contact details - assert.ok(cur_frm.doc.contact_display == 'Contact 3', "Conatct correct"); + assert.ok(cur_frm.doc.contact_person == 'Contact 3-Test Supplier', "Conatct correct"); assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Email correct"); // Get uom assert.ok(cur_frm.doc.items[0].uom == 'Unit', "Multi uom correct"); diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py index 65485912e28..ce6c0c3f43f 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 @@ def get_data(): "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/config/hr.py b/erpnext/config/hr.py index 43f625af42a..ec281bb6ef7 100644 --- a/erpnext/config/hr.py +++ b/erpnext/config/hr.py @@ -176,6 +176,10 @@ def get_data(): { "label": _("Training"), "items": [ + { + "type": "doctype", + "name": "Training Program" + }, { "type": "doctype", "name": "Training Event" diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 4f49c7747bc..ebd45c4c59a 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -83,6 +83,9 @@ class AccountsController(TransactionBase): 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) @@ -259,9 +262,9 @@ class AccountsController(TransactionBase): 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 513b97f53ad..f40d519b928 100644 --- a/erpnext/controllers/item_variant.py +++ b/erpnext/controllers/item_variant.py @@ -201,13 +201,16 @@ def copy_attributes_to_variant(item, variant): variant.variant_of = item.name variant.has_variants = 0 if not variant.description: - variant.description = '' + variant.description = "" if item.variant_based_on=='Item Attribute': if variant.attributes: - variant.description += "\n" + attributes_description = "" for d in variant.attributes: - variant.description += "
-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 @@ has expired, go to accounting settings and make changes.
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 00000000000..efd7377fc41
--- /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 00000000000..cbe6da00773
--- /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 00000000000..929cfd8ef75
--- /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.
+
+
+
+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.
+
+
+
+### Sales Invoice
+
+To print the invoice, you can click on the Invoice Link and print the invoice
+
+
+
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 00000000000..0d4a8abde5d
--- /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.
+
+
+
+### Kanban
+
+As your guests walk in, You can also manage the reservations by making a simple Kanban board for the same.
+
+
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 00000000000..dfbf4ce9717
--- /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.
+
+
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 00000000000..7b72318835e
--- /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.
+
+
+
+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.
+
+
+
+
diff --git a/erpnext/docs/user/manual/en/human-resources/training.md b/erpnext/docs/user/manual/en/human-resources/training.md
index 2aa06791f05..4d39bf1a69c 100644
--- a/erpnext/docs/user/manual/en/human-resources/training.md
+++ b/erpnext/docs/user/manual/en/human-resources/training.md
@@ -1,8 +1,13 @@
# Training
+### Training Program
+
+Create Training Program and schedule Training Events under it. It has a dashboard linked to Training Event to view which event is under the Training Program.
+
+
### Training Event
-Schedule seminars, workshops, conferences etc using Training Event. You can also invite your employees to attend the event using this feature.
+Schedule seminars, workshops, conferences etc using Training Event linked to a Training Program. You can also invite your employees to attend the event using this feature.
@@ -14,11 +19,11 @@ By default the status of the employee will be 'Open'.
-When you submit the Training Event, a notifcation will be sent to the employee notifying that the Training has been scheduled. This is sent via Email Alert "Training Scheduled". You can modifiy this Email Alert to customize the message.
+When you submit the Training Event, a notification will be sent to the employee notifying that the Training has been scheduled. This is sent via Email Alert "Training Scheduled". You can modify this Email Alert to customize the message.
### Training Result
-After compleation of the training Employee-wise training results can be stored based on the Feedback received from the Trainer.
+After completion of the training Employee-wise training results can be stored based on the Feedback received from the Trainer.
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 3a512865428..c53bef92a50 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 @@ fiscal year.
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 @@ A record of the monthly salary given to an Employee.
#### 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 4aae00ed058..634bb43221f 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
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 57086cb9fb1..fca349e5f3f 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
-
-
-
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 24d75eda95d..00000000000
--- 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.
-
-
-
-#### 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
-
-
-
-**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/es/index.txt b/erpnext/docs/user/manual/es/index.txt
index feb68a2fe0b..00cf97b420c 100644
--- a/erpnext/docs/user/manual/es/index.txt
+++ b/erpnext/docs/user/manual/es/index.txt
@@ -1,3 +1,4 @@
introduction
accounts
+projects
schools
diff --git a/erpnext/docs/user/manual/en/subscription/index.txt b/erpnext/docs/user/manual/es/projects/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/subscription/index.txt
rename to erpnext/docs/user/manual/es/projects/__init__.py
diff --git a/erpnext/docs/user/manual/es/projects/activity-cost.md b/erpnext/docs/user/manual/es/projects/activity-cost.md
new file mode 100644
index 00000000000..71eb15e4326
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/activity-cost.md
@@ -0,0 +1,6 @@
+# Costo de Actividad
+
+El costo de la actividad registra la tasa de facturación por hora y la tasa de costos de un empleado en comparación con un tipo de actividad.
+El sistema hace uso de esta tasa mientras hace registros de tiempo. Se usa para Costeo de proyectos.
+
+
diff --git a/erpnext/docs/user/manual/es/projects/activity-type.md b/erpnext/docs/user/manual/es/projects/activity-type.md
new file mode 100644
index 00000000000..20a03e2932d
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/activity-type.md
@@ -0,0 +1,15 @@
+# Tipo de Actividad
+
+Los tipos de actividad son la lista de los diferentes tipos de actividades sobre las que se hacen registro de tiempo.
+
+
+
+Por defecto, los siguientes tipos de actividades son creados.
+
+* Planning
+* Research
+* Proposal Writing
+* Execution
+* Communication
+
+{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/articles/__init__.py b/erpnext/docs/user/manual/es/projects/articles/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/docs/user/manual/es/projects/articles/index.md b/erpnext/docs/user/manual/es/projects/articles/index.md
new file mode 100644
index 00000000000..2d959ecb6e2
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/articles/index.md
@@ -0,0 +1,3 @@
+# Artículos
+
+{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/articles/index.txt b/erpnext/docs/user/manual/es/projects/articles/index.txt
new file mode 100644
index 00000000000..56c193c2776
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/articles/index.txt
@@ -0,0 +1 @@
+project-costing
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/articles/project-costing.md b/erpnext/docs/user/manual/es/projects/articles/project-costing.md
new file mode 100644
index 00000000000..a8820c7e297
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/articles/project-costing.md
@@ -0,0 +1,40 @@
+# Costeo de proyectos
+
+Cada proyecto tiene multiples tareas asociadas a el. Para hacer el seguimiento del costo actual de un proyecto, primeramente en términos de servicios, el usuario
+tiene que crear un registro de tiempo basado en el tiempo que invirtió en una tarea del proyecto. Siguiendo los pasos de como puedes hacer el seguimiento del costo actual de un servicio usando el proyecto.
+
+#### Tipo de actividad
+
+Tipo de actividad es un maestro de los servicios ofrecidos por su personal. Puedes agregar un nuevo Tipo de Actividad desde:
+
+`Project > Activity Type > New`
+
+#### Costo de actividad
+
+Costo de actividad es un maestro donde puedes hacer el seguimiento de los montos de facturación y costo de cada empleado, y por cada tipo de Tipo de Actividad.
+
+
+
+#### Registro de Tiempo
+
+Basados en el tiempo actual invertido en una Tarea del Proyecto, El empleado va a crear un registro de tiempo.
+
+
+
+Al momento de seleccionar el Tipo de Actividad en el Registro de tiempo, el monto de Facturación y Costo del empleado va a ser traído de su respectivo registro en el master de Costo de Actividad.
+
+
+
+Multiplicando esos montos con el total de número de horas en el registro de tiempo, nos da el monto de costos y Facturación para el registro de tiempo específico.
+
+#### Costeo en Proyectos y Tareas
+
+Basados en el total de registros de tiempos creados por una tarea en específico, su costo va a ser actualizado en el registro maestro de la tarea, o sea, en el detalle de la tarea.
+
+
+
+De la misma manera, el detalle del Proyecto va a actualizar su costo basado en el total de registros de tiempo a ese proyecto, y las tareas asociadas a ese proyecto.
+
+
+
+
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/index.md b/erpnext/docs/user/manual/es/projects/index.md
new file mode 100644
index 00000000000..0882752a404
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/index.md
@@ -0,0 +1,15 @@
+# Proyectos
+
+ERPNext le ayuda en la administración de su proyecto a traves de la creacion de tareas y
+poder asignarlas a diferentes personas.
+
+Las compras y las ventas también se pueden rastrear en relación con los proyectos y
+esto puede ayudar a la empresa a controlar su presupuesto, entrega y rentabilidad para un proyecto.
+
+Los proyectos pueden ser usados para manejar los proyectos internos, trabajos de manufacturación y
+planificación de servicios. Para los trabajos de servicios, los Time Sheets (hojas de tiempo) pueden ser creadas
+para facturar a los clientes, en caso que el proceso de facturación se haga basado en tiempo y dinero de tareas.
+
+### Temas
+
+{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/index.txt b/erpnext/docs/user/manual/es/projects/index.txt
new file mode 100644
index 00000000000..716ec1fe3aa
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/index.txt
@@ -0,0 +1,7 @@
+tasks
+project
+time-log-batch
+activity-type
+activity-cost
+articles
+timesheet
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/projects/project.md b/erpnext/docs/user/manual/es/projects/project.md
new file mode 100644
index 00000000000..942433b47b0
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/project.md
@@ -0,0 +1,110 @@
+# Proyecto
+
+El manejo de proyectos en ERPNext se hace a traves de tareas. Puedes crear un proyecto y asignar varias tareas al mismo.
+
+
+
+También puedes hacer el seguimiento del % completado del proyecto usando diferentes métodos.
+
+ 1. Tareas Completadas
+ 2. Progreso de tareas
+ 3. Peso de tarea
+
+
+
+Algunos ejemplos de como el % completado es cálculado basado en tareas.
+
+
+
+
+
+### Manejando tareas
+
+Los proyecto pueden ser divididos en multiples tareas.
+Las tareas pueden ser creadas a traves del documento de Proyecto o pueden ser creadas via [Tarea](/docs/user/manual/en/projects/tasks.html)
+
+
+
+* Para ver las tareas creadas a un proyecto click en 'Tasks'
+
+
+
+
+
+* También puedes ver las tareas desde la misma vista del proyecto.
+
+
+
+* Para agregar peso a las tareas puedes seguir los pasos siguientes
+
+
+
+
+
+### Manejando tiempo
+
+ERPNext usa [Time Log](/docs/user/manual/en/projects/time-log.html) para hacer el seguimiento del progreso de un Proyecto.
+Puedes crear registros de tiempo sobre cada Tarea.
+El tiempo actual de inicio y finalización junto con el costo deben ser actualizados basados en los Registros de Tiempo.
+
+* Para ver los Registros de Tiempo realizados a un proyecto, dar click en 'Time Logs'
+
+
+
+
+
+* Puedes agregar un registro de tiempo directamente y luego asociarlo con el proyecto.
+
+
+
+### Gestión de gastos
+
+Puede reservar la [Reclamación de gastos](/docs/user/manual/en/human-resources/expense-claim.html) contra una tarea de proyecto.
+El sistema actualizará el monto total de las reclamaciones de gastos en la sección de costos del proyecto.
+
+* Para ver las reclamaciones de gastos realizadas en un proyecto, haga clic en 'Reclamaciones de gastos'
+
+
+
+* También puede crear un Reclamo de gastos directamente y vincularlo al Proyecto.
+
+
+
+* El monto total de los Reclamos de gastos reservados contra un proyecto se muestra en 'Reclamo de gastos totales' en la Sección de Costos del proyecto
+
+
+
+### Centro de Costo
+
+Puedes crear un [Cost Center](/docs/user/manual/en/accounts/setup/cost-center.html) sobre un proyecto o usar un centro de costo existente para hacer el seguimiento de todos los gastos realizados al proyecto.
+
+
+
+###Costeo del proyecto
+
+La sección Costeo del proyecto le ayuda a rastrear el tiempo y los gastos incurridos en relación con el proyecto.
+
+
+
+* La sección de cálculo de costos se actualiza según los registros de tiempo realizados.
+
+* El margen bruto es la diferencia entre el monto total de costos y el monto total de facturación
+
+###Facturación
+
+Puedes crear/enlazar una [Sales Order](/docs/user/manual/en/selling/sales-order.html) a un proyecto. Una vez asociada puedes usar el módulo de ventas para facturar a un cliente sobre el proyecto.
+
+
+
+###Gantt Chart
+
+Un Gantt Chart muestra la planificación del proyecto.
+ERPNext te provee con una vista para visualizar las tareas de forma calendarizada usando un Gantt Chart (Hoja de Gantt).
+
+* Para visualizar el gantt chart de un proyecto, ve hasta el proyecto y dar click en 'Gantt Chart'
+
+
+
+
+
+{next}
diff --git a/erpnext/docs/user/manual/es/projects/tasks.md b/erpnext/docs/user/manual/es/projects/tasks.md
new file mode 100644
index 00000000000..b07b305b7ac
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/tasks.md
@@ -0,0 +1,61 @@
+# Tareas
+
+Proyecto es dividido en Tareas.
+En ERPNext, puedes crear las tareas de forma independiente.
+
+
+
+### Estado de una Tarea
+
+Una tarea puede tener uno de los siguientes estados - Abierto, Trabajando, Pendiente de Revisión, Cerrado, o Cancelado.
+
+
+
+* Por defecto, cada nueva tarea creada se le establece el estado 'Abierto'.
+
+* Si un registro de tiempo es realizado sobre una tarea, su estado es asignado a 'Working'.
+
+### Tarea Dependiente
+
+Puedes especificar una lista de tareas dependientes en la sección 'Depende de'
+
+
+
+* No puedes cerrar una tarea padre hasta que todas las tareas dependientes esten cerradas.
+
+* Si una tarea dependiente se encuentra en retraso y se sobrepone con la fecha esperada de inicio de la tarea padre, el sistema va a re calandarizar la tarea padre.
+
+### Manejando el tiempo
+
+ERPNext usa [Time Log](/docs/user/manual/en/projects/time-log.html) para seguir el progreso de una tarea.
+Puedes crear varios registros de tiempo para cada tarea.
+El tiempo de inicio y fin actual junto con el costo es actualizado en base al Registro de Tiempo.
+
+* Para ver el Registro de tiempo realizado a una tarea, dar click en 'Time Logs'
+
+
+
+
+
+* Puedes también crear un Registro de Tiempo directamente y luego asociarlo a una Tarea.
+
+
+
+### Gestión de gastos
+
+Puede reservar la [Reclamación de gastos](/docs/user/manual/en/human-resources/expense-claim.html) contra una tarea de proyecto.
+El sistema actualizará el monto total de las reclamaciones de gastos en la sección de costos del proyecto.
+
+* Para ver las reclamaciones de gastos realizadas en un proyecto, haga clic en 'Reclamaciones de gastos'
+
+
+
+* También puede crear un Reclamo de gastos directamente y vincularlo al Proyecto.
+
+
+
+* El monto total de los Reclamos de gastos reservados contra un proyecto se muestra en 'Reclamo de gastos totales' en la Sección de Costos del proyecto
+
+
+
+{next}
diff --git a/erpnext/docs/user/manual/es/projects/time-log-batch.md b/erpnext/docs/user/manual/es/projects/time-log-batch.md
new file mode 100644
index 00000000000..72c77b4ff82
--- /dev/null
+++ b/erpnext/docs/user/manual/es/projects/time-log-batch.md
@@ -0,0 +1,25 @@
+# Lote de registro de tiempo
+
+Puede facturar Registros de tiempo viéndolos juntos. Esto le da la flexibilidad de administrar la facturación de su cliente de la manera que desee. Para crear una nueva hoja de tiempo, ve a
+
+> Projects > Time Sheet > New Time Sheet
+
+O
+
+Simplemente abra su lista de registro de tiempo y marque los elementos que desea agregar al registro de tiempo. A continuación, haga clic en el botón "Crear hoja de tiempo" y se seleccionarán estos registros de tiempo.
+
+
+
+###Creando Factura de Venta
+
+* Despues de crear la Hoja de Tiempo/Horario, el botón "Crear Factura" debe aparecer.
+
+
+
+* Haga clic en ese botón para hacer una factura de venta usando la hoja de tiempo.
+
+
+
+* Cuando "Presente" la Factura de Ventas, el número de Factura de Ventas se actualizará en los Registros de Tiempo y la Hoja de Horario y su estado cambiará a "Facturado".
+
+{next}
\ No newline at end of file
diff --git a/erpnext/domains/__init__.py b/erpnext/domains/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/domains/distribution.py b/erpnext/domains/distribution.py
new file mode 100644
index 00000000000..020ab3b83b1
--- /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 00000000000..7a86c764c81
--- /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 00000000000..3c54b01d424
--- /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 00000000000..bc55d9c47a6
--- /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 00000000000..b8bb7e05783
--- /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 00000000000..1bfd65faf82
--- /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 00000000000..1fb0e19edd2
--- /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 4b34892ffd3..9d331fa74be 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 c4117782ffd..7818a42ac5e 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 0899a399715..f600838b654 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 70482cba555..400703af614 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 b8155b9b490..e16c22176c7 100755
--- a/erpnext/healthcare/doctype/consultation/consultation.py
+++ b/erpnext/healthcare/doctype/consultation/consultation.py
@@ -78,7 +78,7 @@ def create_invoice(company, patient, physician, consultation_id):
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 b14ce9491c6..936c2c50a99 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 1de0e937d9f..350aaedcba9 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 c96df228c2c..5647d3c88e9 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 4bbd20b9bae..595539cd852 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 8681641fde5..7d9f2c78513 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 00000000000..1b620d5f5da
--- /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 2d1a8d6b255..cd9943b76da 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 93e40ccb716..8677c82d077 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 0daf9cba73d..6fd9535ecc3 100644
--- a/erpnext/healthcare/doctype/lab_test/lab_test.py
+++ b/erpnext/healthcare/doctype/lab_test/lab_test.py
@@ -291,5 +291,5 @@ def create_invoice(company, patient, lab_tests, prescriptions):
@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 d5607f05616..86be5443590 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 9e692d5418f..091e2f9a1ad 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 daa533dfa6f..fab88e2268d 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 71a2278b071..a2e72475179 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 9e754a74dc0..f53f001569f 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 ef5abd5652b..265c1163b75 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 f5ce458f7d8..6f9f2fc5e92 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 98526cc027e..f4d9a43ea3a 100644
--- a/erpnext/healthcare/doctype/patient/patient.py
+++ b/erpnext/healthcare/doctype/patient/patient.py
@@ -111,10 +111,10 @@ def make_invoice(patient, company):
@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 9520e7766bd..57e568b6b3d 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 eab2f2d004f..2647034f78a 100755
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
@@ -125,7 +125,7 @@ def create_invoice(company, physician, patient, appointment_id, appointment_date
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 06149230e67..9cbcf7b9b75 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 e97e1b24c03..209a3746a6e 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 565653b89c0..4348e9035ea 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 bd8e539c539..b1b31290217 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 9c095061931..9fb0dbc13ca 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 ee2f83f01c7..39788fbd548 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 620f37a59aa..eddfda90566 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 e656b512792..86f5e26f0a3 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 89545e9acd1..4c97e41138c 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 83f3cb6fd93..372af0a9594 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 e44af280082..bab80f554e1 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 78%
rename from erpnext/setup/setup_wizard/healthcare.py
rename to erpnext/healthcare/setup.py
index 43a02371f48..69a92b348ba 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 @@ def setup_healthcare():
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_healthcare_item_groups():
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_items():
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_lab_test_template():
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 bf6f5aac863..44a3b18f78d 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -53,6 +53,16 @@ calendars = ["Task", "Production Order", "Leave Application", "Sales Order", "Ho
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 bafee91df24..99e79942bfa 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/offer_letter/test_offer_letter.js b/erpnext/hr/doctype/offer_letter/test_offer_letter.js
index 20695326129..c9b08a6c50d 100644
--- a/erpnext/hr/doctype/offer_letter/test_offer_letter.js
+++ b/erpnext/hr/doctype/offer_letter/test_offer_letter.js
@@ -27,13 +27,13 @@ QUnit.test("Test: Offer Letter [HR]", function (assert) {
]},
]);
},
- () => frappe.timeout(8),
+ () => frappe.timeout(10),
() => frappe.click_button('Submit'),
() => frappe.timeout(2),
() => frappe.click_button('Yes'),
- () => frappe.timeout(8),
+ () => frappe.timeout(5),
+ // To check if the fields are correctly set
() => {
- // To check if the fields are correctly set
assert.ok(cur_frm.get_field('status').value=='Accepted',
'Status of job offer is correct');
assert.ok(cur_frm.get_field('designation').value=='Software Developer',
@@ -45,7 +45,7 @@ QUnit.test("Test: Offer Letter [HR]", function (assert) {
() => {
assert.ok(cur_list.data[0].docstatus==1,'Offer Letter Submitted successfully');
},
- () => frappe.timeout(4),
+ () => frappe.timeout(2),
() => done()
]);
});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index f769d6f3dbc..7581624bef7 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -70,6 +70,7 @@ class SalarySlip(TransactionBase):
'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_slip/test_salary_slip.js b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
index a49c973d132..619e5300ca7 100644
--- a/erpnext/hr/doctype/salary_slip/test_salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.js
@@ -15,7 +15,7 @@ QUnit.test("test salary slip", function(assert) {
{ employee: employee_name}
]);
},
- () => frappe.timeout(1),
+ () => frappe.timeout(3),
() => {
// To check if all the calculations are correctly done
if(ename === 'Test Employee 1')
@@ -43,7 +43,7 @@ QUnit.test("test salary slip", function(assert) {
() => salary_slip('Test Employee 1'),
() => frappe.timeout(6),
() => salary_slip('Test Employee 3'),
- () => frappe.timeout(3),
+ () => frappe.timeout(5),
() => done()
]);
});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.js b/erpnext/hr/doctype/salary_structure/test_salary_structure.js
index 8276a82cb79..542fa503549 100644
--- a/erpnext/hr/doctype/salary_structure/test_salary_structure.js
+++ b/erpnext/hr/doctype/salary_structure/test_salary_structure.js
@@ -1,5 +1,5 @@
QUnit.test("test Salary Structure", function(assert) {
- assert.expect(6);
+ assert.expect(7);
let done = assert.async();
let employee_name1;
@@ -9,10 +9,12 @@ QUnit.test("test Salary Structure", function(assert) {
employee_name1 = r.name;
}
),
+ () => frappe.timeout(5),
() => frappe.db.get_value('Employee', {'employee_name': "Test Employee 3"}, 'name',
(r) => {
// Creating Salary Structure for employees);
return frappe.tests.make('Salary Structure', [
+ { __newname: 'Test Salary Structure'},
{ company: 'For Testing'},
{ payroll_frequency: 'Monthly'},
{ employees: [
@@ -47,16 +49,14 @@ QUnit.test("test Salary Structure", function(assert) {
]);
}
),
- () => frappe.timeout(18),
- () => cur_dialog.set_value('value','Test Salary Structure'),
- () => frappe.timeout(1),
- () => frappe.click_button('Create'),
- () => frappe.timeout(1),
+ () => frappe.timeout(15),
() => {
- // To check if all the fields are correctly set
- assert.ok(cur_frm.doc.employees[0].employee_name.includes('Test Employee 1') &&
- cur_frm.doc.employees[1].employee_name.includes('Test Employee 3'),
- 'Employee names are correctly set');
+ // To check if all the fields are correctly set
+ assert.ok(cur_frm.doc.employees[0].employee_name=='Test Employee 1',
+ 'Employee 1 name correctly set');
+
+ assert.ok(cur_frm.doc.employees[1].employee_name=='Test Employee 3',
+ 'Employee 2 name correctly set');
assert.ok(cur_frm.doc.employees[0].base==25000,
'Base value for first employee is correctly set');
diff --git a/erpnext/hr/doctype/training_event/test_training_event.py b/erpnext/hr/doctype/training_event/test_training_event.py
index 03416ee1f43..57123e304f5 100644
--- a/erpnext/hr/doctype/training_event/test_training_event.py
+++ b/erpnext/hr/doctype/training_event/test_training_event.py
@@ -5,8 +5,38 @@ from __future__ import unicode_literals
import frappe
import unittest
-
-# test_records = frappe.get_test_records('Training Event')
+from frappe.utils import today, add_days
+from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
class TestTrainingEvent(unittest.TestCase):
- pass
+ def setUp(self):
+ create_training_program("Basic Training")
+ self.employee = make_employee("robert_loan@trainig.com")
+ self.employee2 = make_employee("suzie.tan@trainig.com")
+
+ def test_create_training_event(self):
+ if not frappe.db.get_value("Training Event", "Basic Training Event"):
+ frappe.get_doc({
+ "doctype": "Training Event",
+ "event_name": "Basic Training Event",
+ "training_program": "Basic Training",
+ "location": "Union Square",
+ "start_time": add_days(today(), 5),
+ "end_time": add_days(today(), 6),
+ "introduction": "Welcome to the Basic Training Event",
+ "employees": get_attendees(self.employee, self.employee2)
+ }).insert()
+
+def create_training_program(training_program):
+ if not frappe.db.get_value("Training Program", training_program):
+ frappe.get_doc({
+ "doctype": "Training Program",
+ "training_program": training_program,
+ "description": training_program
+ }).insert()
+
+def get_attendees(employee, employee2):
+ return [
+ {"employee": employee},
+ {"employee": employee2}
+ ]
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_event/tests/test_training_event.js b/erpnext/hr/doctype/training_event/tests/test_training_event.js
index a359af3329d..8ff4fecd6ee 100644
--- a/erpnext/hr/doctype/training_event/tests/test_training_event.js
+++ b/erpnext/hr/doctype/training_event/tests/test_training_event.js
@@ -1,7 +1,7 @@
QUnit.module('hr');
QUnit.test("Test: Training Event [HR]", function (assert) {
- assert.expect(4);
+ assert.expect(5);
let done = assert.async();
let employee_name;
@@ -21,7 +21,8 @@ QUnit.test("Test: Training Event [HR]", function (assert) {
{ employees: [
[
{employee: employee_name},
- {employee_name: 'Test Employee 1'}
+ {employee_name: 'Test Employee 1'},
+ {attendance: 'Optional'}
]
]},
]);
@@ -41,6 +42,9 @@ QUnit.test("Test: Training Event [HR]", function (assert) {
assert.ok(cur_frm.doc.employees[0].employee_name=='Test Employee 1',
'Attendee Employee is correctly set');
+
+ assert.ok(cur_frm.doc.employees[0].attendance=='Optional',
+ 'Attendance is correctly set');
},
() => frappe.set_route('List','Training Event','List'),
diff --git a/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js b/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js
deleted file mode 100644
index 6364308f731..00000000000
--- a/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js
+++ /dev/null
@@ -1,40 +0,0 @@
-QUnit.module('hr');
-
-QUnit.test("test: Training Event", function (assert) {
- // number of asserts
- assert.expect(1);
- let done = assert.async();
-
- frappe.run_serially([
- // insert a new Training Event
- () => frappe.set_route("List", "Training Event", "List"),
- () => frappe.new_doc("Training Event"),
- () => frappe.timeout(1),
- () => frappe.click_link('Edit in full page'),
- () => cur_frm.set_value("event_name", "Test Event " + frappe.utils.get_random(10)),
- () => cur_frm.set_value("start_time", "2017-07-26, 2:00 pm PDT"),
- () => cur_frm.set_value("end_time", "2017-07-26, 2:30 pm PDT"),
- () => cur_frm.set_value("introduction", "This is a test report"),
- () => cur_frm.set_value("location", "Fake office"),
- () => frappe.click_button('Add Row'),
- () => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'),
- (r) => {
- console.log(r);
- return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.employee = r.message.name;
- },
- () => {
- return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.attendance = "Optional";
- },
- () => frappe.click_button('Save'),
- () => frappe.timeout(2),
- () => frappe.click_button('Submit'),
- () => frappe.timeout(2),
- () => frappe.click_button('Yes'),
- () => frappe.timeout(1),
- () => {
- assert.equal(cur_frm.doc.docstatus, 1);
- },
- () => done()
- ]);
-
-});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_event/training_event.json b/erpnext/hr/doctype/training_event/training_event.json
index cb8518bf9ba..4b812a992e0 100644
--- a/erpnext/hr/doctype/training_event/training_event.json
+++ b/erpnext/hr/doctype/training_event/training_event.json
@@ -42,6 +42,37 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "training_program",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Training Program",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Training Program",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_bulk_edit": 0,
"allow_on_submit": 1,
@@ -778,7 +809,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-06 10:59:09.217283",
+ "modified": "2017-10-23 06:13:29.065781",
"modified_by": "Administrator",
"module": "HR",
"name": "Training Event",
@@ -806,7 +837,7 @@
"write": 1
}
],
- "quick_entry": 1,
+ "quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "event_name",
diff --git a/erpnext/hr/doctype/training_program/__init__.py b/erpnext/hr/doctype/training_program/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.js b/erpnext/hr/doctype/training_program/test_training_program.js
similarity index 66%
rename from erpnext/buying/doctype/purchase_order/test_purchase_order.js
rename to erpnext/hr/doctype/training_program/test_training_program.js
index e9db270b4fd..3a62b2fa221 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.js
+++ b/erpnext/hr/doctype/training_program/test_training_program.js
@@ -2,15 +2,15 @@
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
-QUnit.test("test: Purchase Order", function (assert) {
+QUnit.test("test: Training Program", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
- frappe.run_serially('Purchase Order', [
- // insert a new Purchase Order
- () => frappe.tests.make([
+ frappe.run_serially([
+ // insert a new Training Program
+ () => frappe.tests.make('Training Program', [
// values to be set
{key: 'value'}
]),
diff --git a/erpnext/hr/doctype/training_program/test_training_program.py b/erpnext/hr/doctype/training_program/test_training_program.py
new file mode 100644
index 00000000000..9d5b28616b1
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/test_training_program.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestTrainingProgram(unittest.TestCase):
+ pass
diff --git a/erpnext/hr/doctype/training_program/training_program.js b/erpnext/hr/doctype/training_program/training_program.js
new file mode 100644
index 00000000000..7d85cab59dc
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/training_program.js
@@ -0,0 +1,5 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Training Program', {
+});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_program/training_program.json b/erpnext/hr/doctype/training_program/training_program.json
new file mode 100644
index 00000000000..d9b33d5de7d
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/training_program.json
@@ -0,0 +1,454 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:training_program",
+ "beta": 0,
+ "creation": "2017-10-11 04:43:17.230065",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "training_program",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Training Program",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Scheduled",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Scheduled\nCompleted\nCancelled",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_5",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "trainer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Trainer Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "trainer_email",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Trainer Email",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_8",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contact_number",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Contact Number",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_11",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Amended From",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Training Program",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2017-10-16 05:34:23.055153",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Training Program",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "title_field": "training_program",
+ "track_changes": 1,
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_program/training_program.py b/erpnext/hr/doctype/training_program/training_program.py
new file mode 100644
index 00000000000..7a3720b66b6
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/training_program.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class TrainingProgram(Document):
+ pass
diff --git a/erpnext/hr/doctype/training_program/training_program_dashboard.py b/erpnext/hr/doctype/training_program/training_program_dashboard.py
new file mode 100644
index 00000000000..a314081c6b9
--- /dev/null
+++ b/erpnext/hr/doctype/training_program/training_program_dashboard.py
@@ -0,0 +1,12 @@
+from frappe import _
+
+def get_data():
+ return {
+ 'fieldname': 'training_program',
+ 'transactions': [
+ {
+ 'label': _('Training Events'),
+ 'items': ['Training Event']
+ },
+ ]
+ }
\ No newline at end of file
diff --git a/erpnext/hr/email_alert/training_scheduled/training_scheduled.json b/erpnext/hr/email_alert/training_scheduled/training_scheduled.json
index e1631f86839..0782f0cfc11 100644
--- a/erpnext/hr/email_alert/training_scheduled/training_scheduled.json
+++ b/erpnext/hr/email_alert/training_scheduled/training_scheduled.json
@@ -10,8 +10,8 @@
"idx": 0,
"is_standard": 1,
"message": "{{ doc.introduction }}
\n\n{{_("An error occured while creating recurring")}} {{ type }} {{ name }} {{_("for")}} {{ party }}.
{{_("This could be because of some invalid Email Addresses in the")}} {{ type }}.
-{{_("To stop sending repetitive error notifications from the system, we have checked "Disabled" field in the subscription")}} {{ subscription}} {{_("for the")}} {{ type }} {{ name }}.
-{{_("Please correct the")}} {{ type }} {{_('and unchcked "Disabled" in the')}} {{ subscription }} {{_("for making recurring again.")}}
+{{_("To stop sending repetitive error notifications from the system, we have checked Disabled field in the subscription")}} {{ subscription}} {{_("for the")}} {{ type }} {{ name }}.
+{{_("Please correct the")}} {{ type }} {{_('and unchcked Disabled in the')}} {{ subscription }} {{_("for making recurring again.")}}
{{_("It is necessary to take this action today itself for the above mentioned recurring")}} {{ type }} {{_('to be generated. If delayed, you will have to manually change the "Repeat on Day of Month" field diff --git a/erpnext/templates/utils.py b/erpnext/templates/utils.py index 6ebe41185fd..7ee39602f55 100644 --- a/erpnext/templates/utils.py +++ b/erpnext/templates/utils.py @@ -28,11 +28,12 @@ def send_message(subject="Website Query", message="", sender="", status="Open"): )).insert(ignore_permissions=True) opportunity = frappe.get_doc(dict( - doctype='Opportunity', + doctype ='Opportunity', enquiry_from = 'Customer' if customer else 'Lead', status = 'Open', title = subject, - to_discuss=message + contact_email = sender, + to_discuss = message )) if customer: diff --git a/erpnext/tests/ui/make_fixtures.js b/erpnext/tests/ui/make_fixtures.js index 0bd74915c29..949e92b1ca4 100644 --- a/erpnext/tests/ui/make_fixtures.js +++ b/erpnext/tests/ui/make_fixtures.js @@ -231,7 +231,9 @@ QUnit.test('Make fixtures', assert => { 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 f35f6d7bc1b..e7de60439ae 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -72,7 +72,6 @@ erpnext/hr/doctype/appraisal/test_appraisal.js erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js erpnext/hr/doctype/expense_claim/test_expense_claim.js erpnext/hr/doctype/training_event/tests/test_training_event.js -erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js erpnext/hr/doctype/training_result_employee/test_training_result.js erpnext/hr/doctype/training_feedback/test_training_feedback.js erpnext/hr/doctype/loan_type/test_loan_type.js @@ -129,4 +128,8 @@ erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_issue_with 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/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