erp5_core: available to invalidate when in Draft state
-
Owner
This is causing
testBase.TestBase.test_metaWorkflowTransition
to fail. Please check which needs to be modified. -
Owner
Also to me, conceptually "invalidated" slightly implies that it use to be valid before but it is no longer valid, so it does not make sense to be draft then invalidated without having been validated for some time. At least in french, when we say something is "invalidé" it makes me a bit feel it was "validé" before.
This is also what I could read in https://dictionary.cambridge.org/dictionary/english/invalidated :
to officially stop a document, ticket, law, etc. being legally or officially acceptable
but honestly, I looked a few other dictionaries and not all of them have this concept of "stop from being valid" (which means it was valid) - also, as I said, I have a bit this understanding of the implied meaning and I might be wrong.
What I am saying is that even though the test fail for different reasons, instead of trying to rewrite the test to not depend on this workflow, maybe we should revert the change to keep validation workflow without this draft->invalidated transition.
Conceptually, both draft and invalidated carry the same meaning of "it should not be used", so from user point of view there should be no need to invalidate a draft. I'm curious why we had to introduce this transition. Is it because of this check in accounting workflow ? or because of transformations / trade conditions which can use draft during composition ? These are two behaviours I know and don't like but never suggested to change because of the problems changing this behaviour now might cause.
-
Developer
@cedric.leninivin was talking with @jp and @tb about this, the conclusion is it's should be possible to invalidate a Draft document. @cedric.leninivin can you explaint more about it?
-
Maintainer
From semantic point of view I agree with you. But this transition has been added to reflect user usage and empty user worklists. Elements in Draft appear in user worklists and it means they have to be dealt with. On the other hand "Invalidated" don't appear in there. After discussion with @tb users validate then invalidate objects in order to empty their Worklist. This new transition reflect this usage.
-
Owner
So please update the test to reflect this new usage pattern. Personally I don't mind either way, as long as we do not have such regression in tests results.