Replies: 3 comments 2 replies
-
Would be a great addition. We already have something some name templating implemented - that work could be generalized and reused probably. See:
Similar thoughts were brought up several times - although I am not aware of accessible forks or plugins for this. See: |
Beta Was this translation helpful? Give feedback.
-
@miggland I would definitely support this. We have facility for "templating" various fields, although it is not immediately obvious to me how to implement your exact use case.
Regarding 3. we keep a "shadow copy" of the reference field for each order (PO / SO / BO) which is an integer cast of the reference: InvenTree/InvenTree/InvenTree/models.py Line 96 in 79f498a We attempt to create an integer version of each reference which is stored in the database. This is necessary for efficient natural sorting of orders - otherwise string sort has to be used. We would be happy to support a PR for this, but it requires some careful consideration regarding implementation |
Beta Was this translation helpful? Give feedback.
-
Thanks for taking this up! I'll continue here, because the FR should be more for detailed discussions on implementation I guess. At the moment, I manually put a number like '1043-6790' in the PO reference. The next one (assuming the same project) would be '1044-6790'. However, InvenTree puts '1043-6791'. It is smart enough to increment the number already, it just increments the wrong part. As you write in the FR @SchrodingersGat , regex can be confusing! I was thinking more along the lines of (which I have seen in other software, eg my scanner:
The user could fill in a reference template like: to have "PO1234-xxxx" show up in the form, and I would fix the project number manually. We would never know how exactly users want the number part to behave. Eg in the third example, what does a user want next year? Start at 1, continue, ...? Originally, I wasn't talking about enforcement either - just pre-filling the form. I guess in the API one would still have to supply value though? |
Beta Was this translation helpful? Give feedback.
-
For reasons, my company creates purchase orders with a pattern of four digits followed by a dash, and then a second part consisting of four digits.
The first four digits are the part that should be incremented for each order, while the second part refers to which project they belong to - ie its manually added.
I've been creating POs in InvenTree, and it is smart - unfortunately, it increments the project number and not the first part, so I have to manually check what the correct number is each time.
Is there some way in which we could create the PO number from a pattern, ie define:
po_pattern = "nnnn-blah"
and then have InvenTree realise it should increment the nnnn part, and just insert the rest?
Maybe this would open for creating PO numbers from other variables, such as dates, as well?
Edit: @SchrodingersGat - I have opened an issue here - #3167
Beta Was this translation helpful? Give feedback.
All reactions