Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove use of can_create for Payment Request #41647

Merged

Conversation

ruthra-kumar
Copy link
Member

@ruthra-kumar ruthra-kumar commented May 27, 2024

regression: #41384

Payment Request is configured to be 'User Cannot Create'. So, it won't be available in can_create list, which means the Payment Request option under the Create button won't be available for anyone.

Before

Screenshot from 2024-05-27 09-48-04

After

Screenshot from 2024-05-27 09-47-35

@ruthra-kumar
Copy link
Member Author

@barredterra

@barredterra
Copy link
Collaborator

Thanks for the hotfix!

The combination of "User cannot create" with a literal "Create" button seems weird. 🤔 Would it make sense to disable this setting?

@barredterra barredterra merged commit 47bc569 into frappe:develop May 27, 2024
16 checks passed
mergify bot pushed a commit that referenced this pull request May 27, 2024
(cherry picked from commit 47bc569)

# Conflicts:
#	erpnext/selling/doctype/sales_order/sales_order.js
mergify bot pushed a commit that referenced this pull request May 27, 2024
(cherry picked from commit 47bc569)

# Conflicts:
#	erpnext/selling/doctype/sales_order/sales_order.js
@ruthra-kumar
Copy link
Member Author

ruthra-kumar commented May 27, 2024

Thanks for the hotfix!

The combination of "User cannot create" with a literal "Create" button seems weird. 🤔 Would it make sense to disable this setting?

Setting is fine, as it is better for Payment Request to be created only programmatically.

can_create doesn't hold any doctype where 'User Cannot Create' is enabled.
https://github.com/frappe/frappe/blob/4893beee51940c5d96f1f4237465e3a9e2d98418/frappe/utils/user.py#L132-L135

I think Framework needs some classification/mechanism to represent cases where the user is not allowed to create, but the Document can still be created programmatically.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants