-
-
Notifications
You must be signed in to change notification settings - Fork 790
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
Add PO wildcard default setting #8532
Add PO wildcard default setting #8532
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
Just an idea/question for someone who is more familiar with the reference syntax. I guess if this is a custom implementation, maybe we could add some kind of |
That does feel cleaner... especially because it probably means we can do it all in one place instead of a setting per object type |
I like the suggestion by @wolflu05 too. @jacobfelknor do you think you can rework the PR to use that approach? This way is generic and automatically rolls out against all other reference types |
I mean the syntax is still TBD. I'd really like to hear your ideas here, as I'm not so familiar with the ref syntax, never did something there. |
Yes, I will explore it |
This ended up being quite elegant in my opinion. Using the reference pattern I still need to update tests/docs |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8532 +/- ##
==========================================
- Coverage 84.61% 84.24% -0.38%
==========================================
Files 1178 1178
Lines 53584 54252 +668
Branches 2026 2026
==========================================
+ Hits 45340 45704 +364
- Misses 7722 8026 +304
Partials 522 522
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Ok, added to docs/tests. I wasn't sure exactly where to put the test, but I put it where it made most sense to me. Let me know if there's anything else I should do |
@jacobfelknor nice work, this is very clean indeed. The tests look appropriate, too. Thanks for the great contribution! |
This PR is definitely a work in progress, but I wanted to float this idea because it addresses one of the complaints I get about my InvenTree instance.
At my company, purchase orders may be prepended with a
P
or aT
depending on the situation. For example, a reference may beP-12345
orT-12345
. As a result, my PO reference pattern is?-{ref:05d}
.However, a majority of POs get the
P
version of the reference, and the create PO form suggests the literal?
from the reference, like?-12345
. This means users must replace the?
with aP
in a majority of cases, which is annoying. If I change the reference toP-{ref:05d}
, theT
version is no longer accepted (which is correct and expected).I propose adding a setting
PURCHASEORDER_REFERENCE_PATTERN_WILDCARD_DEFAULT
(and similar for other types of references) which suggests in the form a default value for the wildcard?
, but continues to accept other characters in this position. If the setting is set toNone
, no replacement happens and the form continues to suggest?
.As I mentioned, this PR is incomplete in its current state and does not consider tests or other objects that use reference patterns. I also only implemented setting the value in the CUI because I have no familiarity with developing in the PUI yet (but will if this becomes real). This is more to gather feedback on the idea before I commit more time to it,