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

feat: Ignore permlevel for specific fields #30686

Merged

Conversation

nabinhait
Copy link
Member

@nabinhait nabinhait commented Apr 12, 2022

Current Behaviour:
Currently, if a field has a higher permlevel and a user does not have permission to that permlevel, on saving the document system resets the value of the field if there are any changes.

Solution:
There are some use-cases where the value of the field is changed by the code, not by the user. To allow those changes, introduced a document level flag to mention those specific fields for which permlevel will be ignored.

Actual Use Case:
In the ERPNext sales cycle, users want to set a higher permlevel for the price_list field because they want to control and it is set based on configuration.
On loading a transaction, the default value for price_list is set based on default_price_list set on Selling Settings. Then on the selection of Customers, it gets overwritten by the customer's default price list. But on saving the transaction, the system resets the price_list field's value to the original (system settings). This change will fix it.

Associated PR on the Frappe: frappe/frappe#16590

docs: no-docs

@nabinhait
Copy link
Member Author

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Apr 12, 2022

backport version-13-hotfix

🟠 Waiting for conditions to match

  • merged [:pushpin: backport requirement]

@mergify
Copy link
Contributor

mergify bot commented Apr 12, 2022

backport version-13-hotfix

✅ Backports have been created

deepeshgarg007 added a commit that referenced this pull request Apr 12, 2022
…-30686

feat: Ignore permlevel for specific fields (backport #30686)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buying needs-tests This PR needs automated unit-tests. selling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants