mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00:00
Merge pull request #49946 from frappe/mergify/bp/version-15-hotfix/pr-49721
feat: add company links to Email Account and Communication (backport #49721)
This commit is contained in:
@@ -25,6 +25,7 @@ def after_install():
|
||||
|
||||
set_single_defaults()
|
||||
create_print_setting_custom_fields()
|
||||
create_custom_company_links()
|
||||
add_all_roles_to("Administrator")
|
||||
create_default_success_action()
|
||||
create_default_energy_point_rules()
|
||||
@@ -132,6 +133,39 @@ def create_print_setting_custom_fields():
|
||||
)
|
||||
|
||||
|
||||
def create_custom_company_links():
|
||||
"""Add link fields to Company in Email Account and Communication.
|
||||
|
||||
These DocTypes are provided by the Frappe Framework but need to be associated
|
||||
with a company in ERPNext to allow for multitenancy. I.e. one company should
|
||||
not be able to access emails and communications from another company.
|
||||
"""
|
||||
create_custom_fields(
|
||||
{
|
||||
"Email Account": [
|
||||
{
|
||||
"label": _("Company"),
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"options": "Company",
|
||||
"insert_after": "email_id",
|
||||
},
|
||||
],
|
||||
"Communication": [
|
||||
{
|
||||
"label": _("Company"),
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"options": "Company",
|
||||
"insert_after": "email_account",
|
||||
"fetch_from": "email_account.company",
|
||||
"read_only": 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def create_default_success_action():
|
||||
for success_action in get_default_success_action():
|
||||
if not frappe.db.exists("Success Action", success_action.get("ref_doctype")):
|
||||
|
||||
Reference in New Issue
Block a user