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 139
    • Merge requests 139
  • 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
  • !2053

Merged
Created Jan 24, 2025 by Titouan Soulard@tsoulardDeveloper

About `Movement_isQuantityEditable` and `Movement_isQuantityEnabled` scripts

  • Overview 9
  • Commits 2
  • Pipelines 5
  • Changes 4

This is a half-serious MR about these Movement_isQuantityEditable and Movement_isQuantityEnabled scripts, which is more about asking questions, maybe none of it should get merged, or maybe just parts, I do not know. My main concerns are :

  • why is Movement_isQuantityEditable checking for items? Quantity set by the quantity of items seems to have been invented for this script. To me, if I have a thread of electrical wire of 10 meters, and you use 22 cm of it for each ORS you produce, then the thread item is to be put on multiple ORS Manufacturing Execution Lines, without altering the quantity of these lines.
  • if it really should check for items, why then is is not checking for required items, because items are supposed to be optional by default; except otherwise defined on the product;
  • then, once you have removed this constraint of items, why are there two different scripts for editable and enabled? There remains the difference of omit_optional_variation=1 in editable, and the exclusion of Cells (ie. quantity is always editable on Cells, but not always enabled), which both look like what we also want in enabled;
  • why is there another script in erp5_advanced_trade? This one is not checking for cells, which seems wrong: I should not be able to edit the quantity of swimsuits if I already know that I sold 2 blue ones and 3 green ones, making a total of 5. Except if we allow mixing variated and unvariated products on the same line, but I'm quite sure it is supported nowhere.

As-is, the MR assumes no reason for any of the above, and:

  • deletes both scripts from advanced trade;
  • renames Movement_isQuantityEditable to Movement_isQuantityEnabled, and use the latter everywhere;
  • removes item constraint from the script.

Will fix tests if any is failing, and we want to merge at least some parts. What’s for sure is that I have modified the script on Nexedi ERP5 and will again, so there’s at least one projet where the current behavior doesn’t fit.

/cc @romain @jerome @yusei

Edited Jan 24, 2025 by Titouan Soulard
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: for-mr-pig
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7