Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 140
    • Merge requests 140
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !710

Merged
Created Jul 10, 2018 by Jérome Perrin@jeromeOwner

Constraints on currencies instead of required fields

  • Overview 8
  • Commits 6
  • 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
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fix/no_required_or_validator_on_currency
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7