Skip to content

Commit

Permalink
Merge pull request frappe#2090 from shadrak98/add-partner-mem
Browse files Browse the repository at this point in the history
fix: add partner in customer team member
  • Loading branch information
shadrak98 authored Aug 22, 2024
2 parents 84784a5 + 9808a32 commit a842be8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions press/api/partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ def approve_partner_request(key):
if partner_request_doc.approved_by_partner:
partner_request_doc.approved_by_frappe = True
partner_request_doc.status = "Approved"

partner = frappe.get_doc("Team", partner_request_doc.partner)
customer_team = frappe.get_doc("Team", partner_request_doc.requested_by)
customer_team.partner_email = partner.partner_email
team_members = [d.user for d in customer_team.team_members]
if partner.user not in team_members:
customer_team.append("team_members", {"user": partner.user})
customer_team.save(ignore_permissions=True)
else:
partner_request_doc.approved_by_frappe = True

Expand Down

0 comments on commit a842be8

Please sign in to comment.