fix!: UX of supplier linking with supplier users on portal pages (#35836)

* fix: create and add Portal Users child table in Supplier/Customer

Issue #35772

* fix: modify the original permission check hook

* fix: auto-add role for portal users

* fix: added patch for auto-populating portal users

* fix: modify patch to fetch users correctly

* fix: remove unnecessary code for updating naming_series

* fix(UX): show portal user in list view

Also split columns to reduce whitespace.

* refactor: simpler role checking

* fix: consider parenttype while fetching portal user

* refactor: simpler code, rename variable

* test: supplier portal user can access their docs

* refactor: only add role if not added

* refactor: rename and move patch to supplier

* refactor: dont add role if no perm or existing doc

* fix: add role before save

* refactor: run query directly

* refactor: split patch and apply roles

- if role isn't present dont add portal user
- ignore failure as it's not critical

* test: fix permission creation for webform test

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
Gursheen Kaur Anand
2023-06-28 11:22:40 +05:30
committed by GitHub
parent e832455790
commit 5113a417a1
15 changed files with 259 additions and 47 deletions

View File

@@ -0,0 +1,34 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2023-06-20 14:01:35.362233",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"user"
],
"fields": [
{
"fieldname": "user",
"fieldtype": "Link",
"in_list_view": 1,
"label": "User",
"options": "User",
"reqd": 1,
"search_index": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-06-26 14:15:34.695605",
"modified_by": "Administrator",
"module": "Utilities",
"name": "Portal User",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class PortalUser(Document):
pass