* 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>
I just applied semgrep autofix. Untested completed, review before merging.
```yaml
- id: frappe-set-value-semantics
patterns:
- pattern-either:
- pattern: frappe.db.set_value($DOCTYPE, None, $...AFTER)
- pattern: frappe.db.set_value($DOCTYPE, $DOCTYPE, $...AFTER)
fix: frappe.db.set_single_value($DOCTYPE, $...AFTER)
message: |
If $DOCTYPE is a single doctype then using `frappe.db.set_value` is discouraged for setting values in DB. Use db.set_single_value for single doctype instead.
languages: [python]
severity: ERROR
```
Getting error while clicking create sales order button from quotation
Taceback (most recent call last):
File "apps/frappe/frappe/app.py", line 66, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 45, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1607, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/model/mapper.py", line 36, in make_mapped_doc
return method(source_name)
File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 263, in make_sales_order
return _make_sales_order(source_name, target_doc)
File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 333, in _make_sales_order
doclist = get_mapped_doc(
File "apps/frappe/frappe/model/mapper.py", line 144, in get_mapped_doc
postprocess(source_doc, target_doc)
File "apps/erpnext/erpnext/selling/doctype/quotation/quotation.py", line 291, in set_missing_values
for d in customer.get("sales_team"):
TypeError: 'NoneType' object is not iterable