feat(stock): automatically link portal users to their associated contact profiles for customers and suppliers

(cherry picked from commit 337a06dfb6)
This commit is contained in:
Afsal Syed
2026-07-16 14:44:49 +05:30
committed by Sudharsanan11
parent 8946fc41a2
commit 134d63de78
3 changed files with 73 additions and 2 deletions

View File

@@ -16,7 +16,10 @@ from erpnext.accounts.party import (
validate_party_accounts,
validate_party_currency_before_merging,
)
from erpnext.controllers.website_list_for_contact import add_role_for_portal_user
from erpnext.controllers.website_list_for_contact import (
add_role_for_portal_user,
link_portal_users_to_contacts,
)
from erpnext.utilities.transaction_base import TransactionBase
@@ -109,6 +112,7 @@ class Supplier(TransactionBase):
def on_update(self):
self.create_primary_contact()
self.create_primary_address()
link_portal_users_to_contacts(self)
def add_role_for_user(self):
for portal_user in self.portal_users: