From 3a75a5e9b57249f56bac60c819b9aaee639746ac Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 18 Sep 2017 16:04:52 +0530 Subject: [PATCH] New Party Type Member Added --- erpnext/non_profit/doctype/member/member.py | 5 ++++- erpnext/patches.txt | 3 ++- erpnext/patches/v8_9/set_member_party_type.py | 7 +++++++ erpnext/setup/setup_wizard/install_fixtures.py | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v8_9/set_member_party_type.py diff --git a/erpnext/non_profit/doctype/member/member.py b/erpnext/non_profit/doctype/member/member.py index 52cb096fa5..083d698b88 100644 --- a/erpnext/non_profit/doctype/member/member.py +++ b/erpnext/non_profit/doctype/member/member.py @@ -5,6 +5,9 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address class Member(Document): - pass + def onload(self): + """Load address and contacts in `__onload`""" + load_address_and_contact(self) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 54f4dfd13f..487bc35524 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -449,7 +449,8 @@ erpnext.patches.v8_9.remove_employee_from_salary_structure_parent erpnext.patches.v8_9.delete_gst_doctypes_for_outside_india_accounts erpnext.patches.v8_9.set_default_fields_in_variant_settings erpnext.patches.v8_9.update_billing_gstin_for_indian_account -erpnext.patches.v9_0.add_user_to_child_table_in_pos_profile #2017-11-28 +erpnext.patches.v8_9.set_member_party_type +erpnext.patches.v9_0.add_user_to_child_table_in_pos_profile erpnext.patches.v9_0.set_schedule_date_for_material_request_and_purchase_order erpnext.patches.v9_0.student_admission_childtable_migrate erpnext.patches.v9_0.fix_subscription_next_date #2017-10-23 diff --git a/erpnext/patches/v8_9/set_member_party_type.py b/erpnext/patches/v8_9/set_member_party_type.py new file mode 100644 index 0000000000..f4664ccfb3 --- /dev/null +++ b/erpnext/patches/v8_9/set_member_party_type.py @@ -0,0 +1,7 @@ +import frappe + +def execute(): + if not frappe.db.exists("Party Type", "Member"): + party = frappe.new_doc("Party Type") + party.party_type = "Member" + party.save() diff --git a/erpnext/setup/setup_wizard/install_fixtures.py b/erpnext/setup/setup_wizard/install_fixtures.py index ed89568947..7e9ba49392 100644 --- a/erpnext/setup/setup_wizard/install_fixtures.py +++ b/erpnext/setup/setup_wizard/install_fixtures.py @@ -213,6 +213,7 @@ def install(country=None): {'doctype': "Party Type", "party_type": "Customer"}, {'doctype': "Party Type", "party_type": "Supplier"}, {'doctype': "Party Type", "party_type": "Employee"}, + {'doctype': "Party Type", "party_type": "Member"}, {'doctype': "Opportunity Type", "name": "Hub"}, {'doctype': "Opportunity Type", "name": _("Sales")},