Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • erp5erp5
  • Merge requests
  • !710

Constraints on currencies instead of required fields

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jérome Perrin requested to merge jerome/erp5:fix/no_required_or_validator_on_currency into master Jul 10, 2018
  • Overview 8
  • Commits 6
  • Pipelines 0
  • Changes 9

We have this [Do Not Test Required In Field View Form](https://www.erp5.com/documentation/developer/guideline/module/erp5-Guideline.Module.Creation#do-not-test-required-in-field-view-form rule) rule:

This kind of constraint should be defined in Constraints documents and should to be checked in workflow transitions.

Checking a field as "required" can cause problems like not saving the data when the user clicks on the save button. The same applies to the use of External Validators scripts in fields.

Currency view was not respecting this, there was both required fields and external validator. Also, the external validator was using an incorrect way of getting the "context document", so it was not working on RenderJS UI.

We are removing required fields and validator here, because this should be implemented using constraints instead. To somehow preserve the same behavior, a new constraint is added in erp5_base and enabled in erp5_configurator_standard. Custom projects probably want to enable this constraint, but (as far as I know) we don't enable constraint by default.

This Base_uniqueReferenceInFolderValidator was apparently not used anywhere else and not working anymore, so we are just removing it.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/no_required_or_validator_on_currency
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7