Remove Company from Patient - Patches Added (#11716)

* Remove Company from Patient - Patches Added

* Update patient DOB field label to Date of birth

* Patient marital status default null

* Update patient.py
This commit is contained in:
Jamsheer 2017-11-28 10:47:06 +05:30 committed by Nabin Hait
parent 8eda0cc8ba
commit b488475d92
4 changed files with 14 additions and 36 deletions

View File

@ -185,7 +185,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "DOB",
"label": "Date of birth",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -353,37 +353,6 @@
"set_only_once": 1,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"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": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@ -884,7 +853,7 @@
"label": "Marital Status",
"length": 0,
"no_copy": 0,
"options": "Single\nMarried\nDivorced\nWidow",
"options": "\nSingle\nMarried\nDivorced\nWidow",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -1274,7 +1243,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 50,
"modified": "2017-11-22 14:21:56.653361",
"modified": "2017-11-24 12:39:33.061005",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient",

View File

@ -69,7 +69,10 @@ class Patient(Document):
frappe.db.set_value("Patient", self.name, "disabled", 0)
send_registration_sms(self)
if(frappe.get_value("Healthcare Settings", None, "registration_fee")>0):
sales_invoice = make_invoice(self.name, self.company)
company = frappe.defaults.get_user_default('company')
if not company:
company = frappe.db.get_value("Global Defaults", None, "default_company")
sales_invoice = make_invoice(self.name, company)
sales_invoice.save(ignore_permissions=True)
return {'invoice': sales_invoice.name}
@ -110,7 +113,7 @@ def make_invoice(patient, company):
return sales_invoice
@frappe.whitelist()
def get_patient_detail(patient, company=None):
def get_patient_detail(patient):
patient_dict = frappe.db.sql("""select * from tabPatient where name=%s""", (patient), as_dict=1)
if not patient_dict:
frappe.throw("Patient not found")

View File

@ -462,4 +462,5 @@ erpnext.patches.v9_0.update_employee_loan_details
erpnext.patches.v9_2.delete_healthcare_domain_default_items
erpnext.patches.v9_2.rename_translated_domains_in_en
erpnext.patches.v9_2.repost_reserved_qty_for_production
erpnext.patches.v9_2.remove_company_from_patient
erpnext.patches.v9_2.set_item_name_in_production_order

View File

@ -0,0 +1,5 @@
import frappe
def execute():
if 'company' in frappe.db.get_table_columns("Patient"):
frappe.db.sql("alter table `tabPatient` drop column company")